Skip to content

Pinging an ESP32 stops on certain Wifi networks (ESP8266 doesn't) #1245

@korstiaanS

Description

@korstiaanS

Hardware:

Board: DoIT DEVKIT
Core Installation/update date: 21/mar/2018
IDE name: Arduino IDE
Flash Frequency: 40Mhz or 80MHz
Upload Speed: 115200

Description:

Pinging an ESP32 using a simple sketch (just connect to an AP, with or without DHCP), no other communication is active, times out forever always after 5-120sec after a reboot.
Strangely enough it only happens on certain networks (Cisco, Meraki) and on other it keeps on working and there is no problem (D-Link, Asus).
And also strange; if I do the same tests with an ESP8266 it always works, on ALL networks (all brands).
What can cause this problem on the ESP32?

Sketch:

#include <WiFi.h>
#include <WiFiUdp.h>

int status = WL_IDLE_STATUS;
char ssid[] = "yourssid";      //  your network SSID (name)
char pass[] = "yourpassword";  // your network password (use for WPA, or use as key for WEP)

char packetBuffer[21];      //buffer to hold incoming packet
char ReplyBuffer[] = "OK";  // a string to send back

uint8_t ip1=10,ip2=0,ip3=91,ip4=100;
uint8_t gw1=10,gw2=0,gw3=88,gw4=1;
uint8_t sn1=255,sn2=255,sn3=252,sn4=0;
uint8_t dns1_1=10,dns1_2=0,dns1_3=0,dns1_4=101;
uint8_t dns2_1=10,dns2_2=0,dns2_3=0,dns2_4=102;


IPAddress ip = IPAddress(ip1,ip2,ip3,ip4);
IPAddress subnet = IPAddress(sn1,sn2,sn3,sn4);
IPAddress gateway = IPAddress(gw1,gw2,gw3,gw4);
IPAddress dns1 = IPAddress(dns1_1,dns1_2,dns1_3,dns1_4);
IPAddress dns2 = IPAddress(dns2_1,dns2_2,dns2_3,dns2_4);

WiFiUDP Udp;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  WiFi.config(ip, gateway, subnet, dns1, dns2); // do not use for DHCP!
  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");  
  printWifiStatus();
}


void loop() {
  delay(10);
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions