WiFi functions timing out

I’m trying to use the WiFi functions to send some connection data over MQTT, but for some reason, the RSSI() function is returning 2, and the SSID function only works the first time, not on future requests. I’m sending this data every 5 minutes as part of some other diag data I use internally.

This is what i use to send

StaticJsonDocument<250> json;
json["network"]["ssid"] = WiFi.SSID();
json["network"]["signalquality"] = (int8_t) WiFi.RSSI();
json["photon"]["freemem"] = System.freeMemory();
json["photon"]["uptime"] = System.uptime();
json["photon"]["appid"] = g_appid;

and this is what comes over the line


But the SSID call works at startup in a different message


Why would these calls just not work? Is there some sort of restriction on when or how they can be called? It’s not in the documentation, and the RSSI call returns 2, so I know it’s a timeout. I also know WiFi is up, the message gets sent. Note that I just migrated to 1.5.0, this still happened in 1.4.4 as well.

Sometimes the calls DO work. I still don’t know why though.


Thanks for any help.

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