tspopp / AquaMQTT

Monitor and control your Groupe Atlantic (Explorer, Aquawin,...) heat pump using MQTT
Apache License 2.0
12 stars 3 forks source link

Reconnect to wifi #26

Open Turbox35 opened 3 weeks ago

Turbox35 commented 3 weeks ago

I have an issue about wifi. Indeed, after an firmware update of my router I discovered that the ESP32 didn't reconnect. I have to reboot it to see it again on the network. I made additionals test, each time I reset my wifi or reboot my router, the ESP32 didn't reconnect. I have a lot of devices at home (with some esp) and this is the only one with this behaviour. How is implemented the strategy when the device lost the wifi connexion ?

tspopp commented 3 weeks ago

Well, this one is interesting. I thought I fixed automatic WiFi reconnect in https://github.com/tspopp/AquaMQTT/commit/b21f5325526c0ba40fecddf4887106e9fb7e361a

Back then I've found several examples, which suggested doing it this way. Since I've never observed any issues, I thought it just works 🤷‍♂️ Will look into this, as soon I have time.

tspopp commented 3 weeks ago

I tried to recreate the issue yesterday: I've been playing around with a WiFi hotspot created using my Android phone. The esp is always reconnecting in case WiFi hotspot is disabled and reenabled.

Maybe it is due to the network topology or router, but it is strange, since the auto reconnect behavior seems to be the default arduino esp32 behavior anyway 🤷‍♂️ What kind of router are you using?

Do you use the latest platform framework libraries? Maybe a pio pkg update before building helps? If there has been an issue in the arduino framework, a pkg update might resolve it...

Turbox35 commented 2 weeks ago

Hello @tspopp , Thanks for your help. On my side, I made additionals tests.

If I restart WiFi on my router, it succeeds to reconnect. If I reboot my router, it fails to reconnect. I see nothing on router logs. For the difference between both WiFi restarting is the time without WiFi, as it takes 20s for WiFi restart and more than 1min for the router reboot.

I have reflashed the esp after an pio pkg update but it changes nothing.