I have completed a port of a messaging app to the Arduino MKR 1010. The app was developed on LINUX using a RPI 4.
Without too much trouble, the socket layers were moved to the WiFiNINA WiFi and Client APIs. The app opens a persistent socket to a server and then starts passing messages back and forth. The protocol negotiates, so there are quite a few (like a dozen) very short messages (< 15 bytes) initially.
The LINUX/RPI is rock solid.
The MKR 1010 experiences staged degradation until it simply becomes useless and requires powering off.
Stage 1: The outgoing messages partially stick on the WiFi MKR 1010 somewhere between Client.write() and the wire. No amount of flushing writing etc. seems to unjam it. It will sometimes wait 30 seconds or more. The data is all there, because ultimately the messages all get processed. When I restart the 1010, sometimes they'll all come through then. But this behaviour has rendered the app unusable.
Stage 2: The WiFiNINA begins disconnecting after a few minutes. It connects, then disconnects, over. This has been excellent at working out the bugs in the reconnect and recovery code in the app, since the RPI handles a lot of that at a lower level. But after that, it becomes inconvenient.
Stage 3: The WiFiNINA simply no longer can create sockets. The WiFi network disconnects. The recovery code reconnects and verifies a CONNECTED status. It then tries to open a socket which fails with no sockets available. The recovery/reconnect methods are closing the previous sockets , disconnecting the client, and deleting the previous client object and when the network comes back ups, creating a new one.
While this is occuring, I have the RPI version connected to the same server over the same wifi network, and it stays up with fast response times while the MKR is suffering. The router is 8 ft away in the same room, so good signal. I verified the firmware is the latest, made sure I'm using the latest WiFiNINA libraries etc. I also have several of these 1010's lying around, so I tried another with the same problem.
I'm rather disappointed. This seems like such a fun board, but the performance has me concerned. Anyone have any experience or successes stories with persistent socket connections to encourage me to keep trying to make this work? I see several chat board topics but never any clear resolutions. So I thought I'd post here. Esp wrt to the outgoing message delays.
Thank you.