FL42
FL42
Hello @Luposoft63 @fredlcore Thanks for your quick answer, Let me detail my use case: I'm using Home Assistant (HA) to control my heater using BSB LAN. My sensors in HA...
@fredlcore I agree with you, I updated my code in #410 I'll test and let you know
#410 works for me
In fact `lastMQTTTime=millis()-log_interval*1000;` could be problematic if millis() < log_interval*1000 (e.g., after a restart if you have large log_interval) #410 runs for me for few days now without major issue...
> I thought you are looking for an immediate update. Now you are happy with 1 or 2 seconds. Actually I don't have the choice: some parameters are not updated...
Hello @fredlcore @Luposoft63, IMO the +1000 is required. > You are right that some parameters are not updated immediately in the microcontroller of the heater. For instance updating heater mode...
I'm glad to hear that another user was able to reproduce the issue. Just be clear, what would happen if millis() returns 100000 (i.e., 100s after boot) and log_interval =...
> i.e.: lastMQTTTime = -1699000 lastMQTTTime cannot be negative as it's an *unsigned* long So `lastMQTTTime = 100000 - (1800*1000) + 1000` will result to `lastMQTTTime = 4294967295 + -1699000...
Is relying on out-of-bound roll over a good idea? It's not HW dependent? For me adding a condition to ensure the result is positive (or set to 0) sounds safer,...
I was thinking if some hw catches the out of bound and set to 0 or whatever instead of "normal" roll over But that's fine, thanks for the explanation :)