Issues Running MJPEG Streaming AP Program on OpenMV4

I am using OpenMV4 with the accompanying ATWINC1500 to run the MJPEG Streaming AP program from the IDE, and I receive the following message:
“Waiting for connections… socket error: [Errno 11] EAGAIN.”

Both the hardware and firmware are up-to-date, and my friend has encountered the same issue.

Hi, I get the same error too if I connect multiple times in non-ap. The code in the example doesn’t really handle cleanup of the main socket on disconnect.

We get this question asked a lot from folks. I’m just going to write a class up that’s robust for this.

Hi, I wrote a new robust MJPEG server: lib: Add mjpeg server. by kwagyeman · Pull Request #1982 · openmv/openmv · GitHub

Also, made some improvements to the MJPEG scripts: scripts: Improve OpenMV Boards MJPEG Examples. by kwagyeman · Pull Request #1983 · openmv/openmv · GitHub

However, I ran the AP mode setup code and it doesn’t seem to work anymore. So, there’s something wrong with AP mode. I could not connect to the wifi module via that mode. So, the underlying issue was not related to sockets.

Mmm, apparently this issue was encountered by someone else: "socket error: [Errno 11] EAGAIN" on WiFi shield · Issue #1849 · openmv/openmv · GitHub

Seems like it will go away once you connect.

I had trouble finding the AP on my phone. But, I guess it’s not broken.

The error message is normal, the server socket just times out and restarts. Setting a timeout on the server socket is a workaround for a WINC driver/firmware bug, it has always been this way and it works fine, maybe a host driver update in the future will fix it. As for the AP mode issue, WEP security has been deprecated since firmware 19.7.6, that’s why it stopped working a while ago. I made some changes and fixes to support using WPA with AP mode, if you try the latest development firmware, AP mode should be working fine now (just remove the security arg, and use ssid) . Also I’m going refactor all of the networking scripts soon, for all boards, to switch to a common WiFi interface and update all those args.