Arduino UNO WiFi rev2 loses signal

Over time, generally from 2 to 5 days, the signal strength on my Wi-Fi connection fades and reaches the point where I have programmed the board to reset. When that happens, the signal strength immediately pops up to its strongest value and operation continues normally.

Because the signal strength is being estimated in the module on board handling Wi-Fi, which as I understand it is a separate processor, I haven’t been able to think of a way to debug this.

Has anybody else seen this sort of behavior?

The overall sketch is over 1000 lines, so I haven’t got a good model of what parts of it to post without some ideas where to look.

How are you “estimating” the WiFi signal strength?

Is your sketch uploaded to the ESP8266, or on the Uno?

Pete.

I’m getting the signal strength directly from the WiFi.rSSi routine in the library-it’s totally out of my control. My sketch is uploaded to the Uno and nowhere else. That’s the essence of why am struggling so. I can’t see how anything I would’ve done it would cause this effect

Okay, well when you use one of these boards, it is in effect an Arduino Uno with an ESP8266 as its WiFi modem.
The ESP8266 needs to be running the factory AT commands and the Uno running a Blynk sketch that uses the BlynkSimpleShieldEsp8266.h library.

The problem is, this library doesn’t support RSSI reporting without hacking the Blynk library, as described here…

This makes me think that you are running the sketch on the ESP8266 rather than the Uno.

Can you share your sketch please (correctly formatted with triple backticks of course).

Pete.

Nope. This is the code getting RSSI, all on the UNO:


// --------------------------------------------------------------------------------------
// Parametrics for RSSI display
#define MIN_RSSI -80
#define MAX_RSSI -50
#define NUM_BARS 7

// --------------------------------------------------------------------------------------
// Convert the RSSI estimate into the number of bars, ranging 0...NUM_BARS
// and scaled linearly against the range MIN_RSSI...MAX_RSSI
int rssiBars() {
    auto rssi = WiFi.RSSI();
    if (rssi <= MIN_RSSI) {
        // out of range, low
        return 0;
    } else if (rssi >= MAX_RSSI) {
        // out of range, high
        return NUM_BARS;
    } else {
        // in range, make zero based, rescale, and round (add 0.5 and truncate)
        float inputRange = (MAX_RSSI - MIN_RSSI);
        float outputRange = (NUM_BARS - 1);
        return (int)( ((float)(rssi - MIN_RSSI) * outputRange / inputRange) + 0.5 );
    }
}

These are what I presume are the relevant includes:

#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>

Barry

I’d be happy to share the entire sketch, but it’s over 1K lines before I start stripping comments and routines to get under the 9K character limit.

I can only assume that you’re waiting for me to post all the code, which I’m willing to do-how would you best like me to post a sketch that large? I cannot simply post it directly here, as the forum won’t let me post more than 9000 characters.

I very much appreciate the time and effort you put into helping people here on this forum!

Barry