All of my ESP32 can't connect to Router but to hotspot?

Hey

I've changed to my Router (alcatel hh72vm).
Now, all of my ESP32 can't connect to the router?
Raspberry pi, Phone and even two esp8266(!!!) can connect to the Router.

When I'm change the settings (SSID) to my mobile hotspot from the smartphone, the esp32 (tested with 3 ESP32) can connect to the hotspot - but not the router...

I changed 2,4 to 5 GHZ... changed the SSID and password, encryption, wifi channel.
Sketches loops through "conecting to ......", also static IP adress fails..

/*
     Example of connection using Static IP
     by Evandro Luis Copercini
     Public domain - 2017
*/

#include <WiFi.h>

const char* ssid     = "mysssid";
const char* password = "mypassword";

// IPAddress local_IP(192, 168, 178, 15);
// IPAddress gateway(192, 168, 178, 1);
// IPAddress subnet(255, 255, 255, 0);
// IPAddress primaryDNS(8, 8, 8, 8); //optional
// IPAddress secondaryDNS(8, 8, 4, 4); //optional

void setup()
{
  Serial.begin(115200);

  Serial.print("Connecting to ");
  

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected!");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.print("ESP Mac Address: ");
  Serial.println(WiFi.macAddress());
  Serial.print("Subnet Mask: ");
  Serial.println(WiFi.subnetMask());
  Serial.print("Gateway IP: ");
  Serial.println(WiFi.gatewayIP());
  Serial.print("DNS: ");
  Serial.println(WiFi.dnsIP());
}

void loop()
{
 
}

any ideas?

What channel/region did you choose in the router configuration?

1 Like

How about doing a wifi-scan as the first step?

/*
  Example from WiFi > WiFiScan
  Complete details at https://RandomNerdTutorials.com/esp32-useful-wi-fi-functions-arduino/
*/

#include "WiFi.h"

void setup() {
  Serial.begin(115200);

  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  Serial.println("Setup done");
}

void loop() {
  Serial.println("scan start");

  // WiFi.scanNetworks will return the number of networks found
  int n = WiFi.scanNetworks();
  Serial.println("scan done");
  if (n == 0) {
      Serial.println("no networks found");
  } else {
    Serial.print(n);
    Serial.println(" networks found");
    for (int i = 0; i < n; ++i) {
      // Print SSID and RSSI for each network found
      Serial.print(i + 1);
      Serial.print(": ");
      Serial.print(WiFi.SSID(i));
      Serial.print(" (");
      Serial.print(WiFi.RSSI(i));
      Serial.print(")");
      Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
      delay(10);
    }
  }
  Serial.println("");

  // Wait a bit before scanning again
  delay(5000);
}

have a look here to analyse more with the
what info you can print about WiFi.status()
(ESP32 Useful Wi-Fi Library Functions (Arduino IDE) | Random Nerd Tutorials)

best regards Stefan

1 Like

I was having the same issue, and the problem was my SSID (even though I hadn't changed it). The default SSID was "GL-X750-39c", and I had to change it to "GLX75039c". Now it is connecting just fine!

1 Like

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