I'm trying to connect my Arduino Uno WiFi Rev 2 with my Network which has both 2,4 and 5 GHz, but I can only connect sometimes. I modified the default connect code from the WiFiNINA examples to also send the status- and reason code with Serial.
My code:
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
Serial.print("Statuscodes: ");
Serial.print(status);
Serial.print(" ");
Serial.println(WiFi.reasonCode());
}
Sometimes the Arduino directly connects with status 3 and reason 0.
But other times it randomly disconnects while connecting (status 6) and returns 2 different reason codes. Sometimes the reason code is 8, which means "Disassociated because sending station is leaving (or has left) basic service set (BSS)", but most of the time the reason code is 204 - which doesn't even exist. (Looking at this list)
So.. what does 204 mean and how can I reliably connect to the wifi?