ph1p / ikea-led-obegraensad

ESP32/Arduino hack for the ikea OBEGRÄNSAD led wall lamp
MIT License
578 stars 78 forks source link

Reconnect to WiFi in case of disconnection #108

Open c64emulator opened 2 months ago

c64emulator commented 2 months ago

Es gab bereits schon mal ein Ticket und einen PR dazu. Das Problem scheint nicht behoben bzw. wieder da zu sein: Leider musste ich bei meinem neuen WLAN-Router einen Scheduler einrichten, der in jeder Nacht (nachdem die FRITZ!Box einen DSL-Reconnect durchgeführt hat) den Router neu bootet. Das war notwendig, weil das WLAN extrem unzuverlässig lief. Als Folge davon öffnet das LED-Panel nun seinen AP (mit Webserver auf 192.168.4.1). Allerdings zeigt es dort dann die normale GUI (und nicht die WiFi-Konfiguration). Problematisch dabei ist, dass in den Default-Einstellungen kein WLAN-PW für den AP-Mode vorgesehen ist. Originally posted by @c64emulator in https://github.com/ph1p/ikea-led-obegraensad/issues/14#issuecomment-2052633457

* Setup successfull, starting loop()! Lost connection to Wi-Fi. Reconnecting... wm:AutoConnect [10995390][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3001 wm:Connecting to SAVED AP: MyWLAN wm:connectTimeout not set, ESP waitForConnectResult... wm:AutoConnect: FAILED for 3727 ms wm:StartAP with SSID: IKEA OBEGRANSAD LED-Panel -- WiFi Setup wm:AP IP address: 192.168.4.1 wm:Starting Web Portal

c64emulator commented 2 months ago

small modification in "connectToWiFi()" fixed it for me:

wifiManager.setConfigPortalTimeout(300); bool res; res = wifiManager.autoConnect(WIFI_MANAGER_SSID, WIFI_MANAGER_PW); if (!res) { Serial.println("***** Failed to connect - RESTARTING..."); ESP.restart(); }

WRedux commented 3 weeks ago

Hallo,

bin C-technisch nicht so gut drauf....

Kannst mir bitte sagen, wo und wie Du die "connectToWiFi()" modifiziert hast? Einfach dazuhängen ging nicht...

Danke!