WiFi connection unreliable

Hi,

I'm hoping for some help on how to maintain a reliable WiFi connection as I'm really struggling. First some context:

  • MKR WiFi 1010: 2 bought within the last few weeks, both upgraded to 1.5.0,
  • Using MKR 485 for Modbus connectivity
  • Libraries:
    • Scheduler - To help with multiple processes. I've avoided delay(...) in all my code, but many of the Arduino libraries use it but I see yield() is called in the delay loop so should avoid blocking,
    • ArduinoModbus,
    • Arduino_ConnectionHandler,
    • WiFiNINA,
    • coap-simple.
  • Router: tested on a BT Connect Hub and Google WiFi Pro Mesh... occurs with both.

Symptoms:
When running after an indeterminate amount of time (could seconds, could be hours) I get the following from the Arduino_ConnectionHandler library:

[DBG_INFO   ] WiFi.status(): 255
[DBG_ERROR  ] WiFi Hardware failure.

At this point it seems the WiFi connection is unrecoverable, even when I use WiFi.end() and start reconnecting from scratch. My only option seems to be a NVIC_SystemReset which, frankly, smells!

I wondered if it was my Sketch causing this so I tried the one from Connecting to WiFi Network tutorial with added:

void printCurrentNet() {
  Serial.print("Status: ");
  Serial.println(WiFi.status());
  // ... other code unchanged

This also exhibits the same issue.

Any thoughts?

To add a bit more context, I've connected an Opta WiFi using a very similar example to the 'Connecting to WiFi Network' (changed as that can't use WiFiNINA). And that does not suffer the same amount of disconnects... in fact... I've not had one!

I'm wondering if it's related to this: WiFi.status() returns 255 randomly but remains connected and operational · Issue #85 · arduino/nina-fw (github.com)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.