ESP8266/WEMOS D1 should connect to the local WiFi network
Actual behavior
ESP8266/WEMOS D1 tries forever to connect but fails 99% of the time. Sometimes it gets lucky and gets an IP address.
It seems to be a known issue: https://github.com/esp8266/Arduino/issues/8299
8<------------------------ END BUG REPORT -------------------------------------
To fix the problem a line needs to be added to the WiFi module settings in esp8266weather-station-color.ino
Please see below for an example. I inserted the bold line below. In my case to line 140.
void connectWifi() {
if (WiFi.status() == WL_CONNECTED) return;
//Manual Wifi
Serial.printf("Connecting to WiFi %s/%s", WIFI_SSID.c_str(), WIFI_PASS.c_str());
WiFi.disconnect();
WiFi.mode(WIFI_STA);
WiFi.setPhyMode(WIFI_PHY_MODE_11G); // Fix for ASUS RT-AX86U RT-AC86 Routers
WiFi.hostname(WIFI_HOSTNAME);
8<------------------------ END FEATURE REQUEST --------------------------------
Hi. By adding the line it connects to wifi, but only after being programmed.
If you cycle the power is unable to connect again, a new upload is needed.
Could anyone fix this please?
Many Thanks!!
8<------------------------ BUG REPORT -----------------------------------------
Expected behavior
ESP8266/WEMOS D1 should connect to the local WiFi network
Actual behavior
ESP8266/WEMOS D1 tries forever to connect but fails 99% of the time. Sometimes it gets lucky and gets an IP address. It seems to be a known issue: https://github.com/esp8266/Arduino/issues/8299
8<------------------------ END BUG REPORT -------------------------------------
8<------------------------ FEATURE REQUEST ------------------------------------
To fix the problem a line needs to be added to the WiFi module settings in esp8266weather-station-color.ino Please see below for an example. I inserted the bold line below. In my case to line 140.
void connectWifi() { if (WiFi.status() == WL_CONNECTED) return; //Manual Wifi Serial.printf("Connecting to WiFi %s/%s", WIFI_SSID.c_str(), WIFI_PASS.c_str()); WiFi.disconnect(); WiFi.mode(WIFI_STA); WiFi.setPhyMode(WIFI_PHY_MODE_11G); // Fix for ASUS RT-AX86U RT-AC86 Routers WiFi.hostname(WIFI_HOSTNAME);
8<------------------------ END FEATURE REQUEST --------------------------------