OpenEVSE / ESP8266_WiFi_v2.x

ESP8266 WiFi for OpenEVSE Version 2.x
https://openevse.openenergymonitor.org
76 stars 46 forks source link

Missmatch between code and comment for intervalls #248

Closed beikeland closed 4 years ago

beikeland commented 4 years ago

https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/blob/76577408ca1ce8d8266db463adfe5f0b173b1d86/src/mqtt.cpp#L187-L188

Not sure if comment or code is correct, but 5s != 50000ms

glynhudson commented 4 years ago

This looks correct to me, try and reconnect continuously for 5s (now < 50000) then try to re-connect every 10s ((now - lastMqttReconnectAttempt) > 100000))

beikeland commented 4 years ago

5 seconds is 5,000ms not 50,000ms which explains my trouble with mqtt thinking it was the server not accepting the connection, but instead it was the wifi waiting almost two minutes to reconnect, despite thinking it should take 10 seconds.

glynhudson commented 4 years ago

Damit, I was obviously blind to the number of zeros! Thanks, I've made the changes to fix