Arduino UNO r4 WIFI wont connect to any routers

I have been trying to get two uno r4 boards to talk with each other but i cant even get one of them to connect to any routers, i have tried my home wifi and mobile hotspot neither of which have worked, the code just continues printing a "." when it hasnt connected yet.

#include <WiFi.h>
#include <WiFiServer.h>

char* ssid = "iphone";
char* password = "abcdefgh";

WiFiServer server(80);

void setup() {
  Serial.begin(9600);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print(".");
  }
  Serial.println("Connected to Wi-Fi");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());
  server.begin();
}

void loop() {
  WiFiClient client = server.available();
  if (client) {
    Serial.println("Client connected");
    while (client.connected()) {
      if (client.available()) {
        String data = client.readStringUntil('\n');
        Serial.print("Received data: ");
        Serial.println(data);
      }
    }
    client.stop();
    Serial.println("Client disconnected");
  }
}

Check if your Wifi is set to only work on 5 Ghz channels. If so, also enable the 2.4 Ghz channels and then try to connect.

R4 is not capable of 5Ghz wifi.

1 Like

Hey, I'm pretty sure that when mobile hotspot is in maximize efficiency mode it will be in 2.4 Ghz but just incase ill check my home internet and retry. Thanks

So the router is in 2.4 Ghz mode and I'm still encountering the same issue, do you have any other possible problems.

You might be able to make progress if you print the actual status returned so you can fix that specific part.

You must use the WiFiS3 library instead of WiFi.

https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples/

And check that WiFiServer is compatible with the ESP32-S3.

Regards

Man your a legend, thanks so much, I didnt realise that there was an S3 variant of the wifi library. Everything works now.

1 Like

I just googled "Uno R4 wifi library", no big deal either. :wink: