Why does the FritzBox 7490 fail with WiFi?

My FritzBox7490 works well in my home, but it seems to not like either Arduino or ESP32 or the combination of it. The following very simple code demonstrates the problem:

// FritzBox 7490 Wifi connection problems

#include <WiFi.h>

const char*     ssid            = "mySSID";
const char*     password        = "myPassword";

void setup() {
    delay(2000);
    Serial.begin(115200);
    Serial.println("\nConnecting to WIFI");
    
    WiFi.begin(ssid, password);   // 1st
    delay(500);                          // 100ms: not ok, 500ms: mostly ok
    WiFi.begin(ssid, password);   // 2nd
    
    while (WiFi.status() != WL_CONNECTED) {
        Serial.print(".");
        delay(250);
    }
    
    long rssi = WiFi.RSSI(); // RSSI (Received Signal Strength in dBm)
    Serial.printf("Successfully connected, getting RSSI: %li \n", rssi);
}
    
void loop() {
    Serial.print("Looping ");
    delay(1000);
}

My ESP32 almost never successfully connects to the FB7490 on the first try; I’d say success is 1 in 100 trials, or even less. And it connects to the FB almost always - more than 99 in 100 trials - on the second try.

It does not seem to be a issue of that specific ESP device, as I tried the ESP32-Dev, ESP32-Pico, and ESP32-Wrover versions, all the same.

It is also not a FritzBox issue per se: I tried an older FritzBox 7272: connections almost always succeeded on first try.

I also configured my Android smartphone as a WiFi router, and again connections were almost always successful on the first try.

I contacted the FritzBox service, but they did not seem to be very interested. If they really looked into this, then they had no answer. They provided a few pre-release firmware versions of their FB7490, but that did not change anything.

As you see in the sketch I found a workaround by programmatically doing the double-barrelled WiFi connections. They can’t get too close; a delay of 100ms is too short, a delay of 500ms works most of the time.

I am using this for several months now, and it is very reproducible and at least the work-around is reliable.

But I think this is not acceptable. I am surprised that AVM (the FritzBox company) isn’t embarrassed enough to solve this problem.

Anyone with the same or different experience? A solution?

Is really nobody using the FritzBox 7490 and has made this bad experience?

So first of all, I can only encourage you to search the problem on you, yourselfm your code and your settings instead of expecting to AVM to be embarrassed... Because I have a surprise for you, they don't care at all.

Second. This sounds for me like your settings on your main router 7490. I have a feeling, that you did some network settings tweaking yourself which creates some issues. The whole thing sounds for me like, Fritzbox needs too long the first time you are trying to log in and your ESP8266 times out. Second time, FB Cache is existent: Handshakes are done and cached, Device ID is known to FB and therefore it is much faster.

If I were you: I would stay with workaround because your software is just delayed for a couple of seconds after you restarted your arduino. No idea why you think this is "unacceptable" but you do you man...

If you really want to debug this problem, i would check - If Guest WLAN is activated and you are trying to login to guest wlan - If your FB thinks your ESP8266 is always a different device (with a different Device ID) - If it is possible to increase timeout or retry values of your ESP8266

Have a great one

First, this is an ESP32, not an ESP8266.

Second, I am afraid you shouldn't rely too much on your feelings. In my case the FB is as close to factory setting as possible.

Third, accepting workarounds may be acceptable for hobbyists, but only to a limit. For serious use, I find it not acceptable.

There is a better discussion going on here:

https://github.com/espressif/arduino-esp32/issues/2501