JAndrassy / arduino-firmware-wifilink

Arduino WiFi Link firmware for ESP8266 based boards
MIT License
28 stars 12 forks source link

In the environment which having a weak WiFi signal, WiFi.status() took a long long time. #4

Closed kalsolio closed 6 years ago

kalsolio commented 6 years ago

with the Correct SSID and password, if the wifi is so week, Visible, but very weak , WiFi.status() will took many Minutes. ps. if the wifi is not found, or the password is error, .status() will work ok.

origin code:

  Serial1.resetESP();
  delay(3000); //wait while WiFiLink firmware connects to WiFi with Web Panel settings
  WiFi.init(&Serial1);
  Serial.println("wait wifi status...");
  while (WiFi.status() != WL_CONNECTED) {
     delay(100);
  }

After I change it like this, reboot my board to try more times, there is a chance to connect WiFi success

  WiFi.init(&Serial1);
  Serial.println("wait wifi status...");

  wdt_enable(WDTO_8S);
  delay(7000);
  wdt_reset();

  while (WiFi.status() != WL_CONNECTED) {
   delay(100);
  }
JAndrassy commented 6 years ago

the success of the esp8266 is in price not in reliability :-)