I am trying to run PetPy/main.py at master · IeiuniumLux/PetPy · GitHub just so I can see how a HTTP server is implemented
It doesn’t work, Chrome and Firefox both report that the connection is refused. Port used is 8088, I tried port 80 too (but the code definitely says port 8088). And I made sure it was http not https
My router’s client list shows a client “WINC-a5-3d” which is definitely correct, so I know the connection is good. Furthermore, ping to the IP assigned shows replies about 3ms.
Modifying the code to examine the args of the OSError shows it is error -6, digging through the OpenMV github reveals this is “SOCK_ERR_INVALID_ARG” in /src/winc1500/include/socket/include/socket.h , most likely returned from “sint8 WINC1500_EXPORT(accept)(SOCKET sock, struct sockaddr *addr, uint8 *addrlen)” in /src/winc1500/src/socket.c . That function isn’t exactly an IO operation, so the acceptance is happening elsewhere. I am not familiar enough with the code to trace too far. It looks like something in function “static void m2m_ip_cb(uint8 u8OpCode, uint16 u16BufferSize,uint32 u32Address)” sets it after getting “u8OpCode == SOCKET_CMD_ACCEPT”.
Changing to soft-AP mode yields identical behaviour
I have tried changing the timeout from blocking to something short and it does not allow a connection to be accepted.
My firmware version: MicroPython v1.12-omv OpenMV v3.6.7 2020-07-20; OPENMV4P-STM32H743
WINC firmware is version: (19, 6, 1, 19, 3, 0, 1377184)
oh and UDP is definitely working, my other project implements a DNS server on port 53 and it’s responding to name resolution requests
Please help, thanks