ThingPulse / esp8266-weather-station-color

ESP8266 Weather Station in Color using ILI9341 TFT 240x320 display
https://thingpulse.com/product/esp8266-wifi-color-display-kit-2-4/
MIT License
565 stars 221 forks source link

ESP8266 can't connect to ASUS Routers #165

Closed sweig closed 4 months ago

sweig commented 1 year ago

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 --------------------------------

ik0adr commented 1 year ago

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!!