jantenhove / GoodWeLogger

ESP8266 based logger for GoodWe inverters. Can upload to pvoutput and publishes MQTT topics
GNU General Public License v3.0
98 stars 24 forks source link

Adding Wifi connector class #20

Closed bram2202 closed 5 years ago

bram2202 commented 5 years ago

Fixes a bug that when the wifi connection drops out you need do reset the board to regain a wifi connection. This is due to the fact that the wifi connection is made in the main setup and never checked again.

This commit fixes that by:

jantenhove commented 5 years ago

Thanks for the pull request. I will review and test it.

lgespee commented 5 years ago

This is one of the main issues I'm experiencing. Our inverter is just a tad too far from the WiFi access point for a stable connection. Unplugging the ESP has too be done weekly.

bram2202 commented 5 years ago

Hi, did you, by any chance, had the time to review and test this PR?

jantenhove commented 5 years ago

I did test it. Without your Wificonnector class the GoodWeLogger automatically reconnects, which is what an ESP8266 does by default. I don't really see any need for a separate class. If your ESP does not automatically reconnects, it might be related to a bug in the SDK: https://github.com/esp8266/Arduino/issues/4161. I suggest upgrading to the latest SDK.

jantenhove commented 5 years ago

@bram2202 @lgespee Can you test with a later version of the ESP SDK if this is resolved?

I observed similair disconnects a while back, but after upgrading the SDK, I didn't come across it anymore.

jantenhove commented 5 years ago

In the latest commits an extra check is added which will auto restart the ESP if the Wifi is lost for more than 30 seconds (and the ESP can't auto reconnect within that time for whatever reason).