Domoticz data timeout
-
I think with domoticz its might be enough to call sendHeartbeat() from your gateway every 30 seconds.
It should update the m_LastHeartbeatReceive of the HW and thats what mainworker uses when it defines if the HW should be "rebooted".Here is a example(NOT TESTED):
#define HEARTBEAT_SEND_FREQUENCY 30000 unsigned long lastHeartBeatSend; .... void setup() { lastHeartBeatSend = 0; } ... void loop() { unsigned long now = millis(); if(now - lastHeartBeatSend > HEARTBEAT_SEND_FREQUENCY) { sendHeartbeat(); lastHeartBeatSend = now; } }See:
https://github.com/domoticz/domoticz/blob/8bb0420c3ba4a10bbacd6f2e2f9b40b06ff0c7ac/main/mainworker.cpp#L12864
https://github.com/domoticz/domoticz/blob/8bb0420c3ba4a10bbacd6f2e2f9b40b06ff0c7ac/hardware/MySensorsBase.cpp#L487
https://www.mysensors.org/download/sensor_api_20@pjr , what you are suggesting is exactly what I wanted at the beginning..... but... my understanding from the first answer I got and for this https://www.domoticz.com/forum/viewtopic.php?f=42&t=9775&sid=1fea4af7b12f84f656ca4aa825eb6115
is that the sendHeartbeat() function is basically accepted but disregarded in Domoticz, meaning, would not create problems but not fixing the issues.
Of course this is my understanding and would be glad to have additional opinions/tests -
@pjr, thanks for your update. I went to check the solution proposed in the link you attached... and let me confess... got the concept, but it's complexity is currently not something at my reach.
Meaning.. as my solution is very small and working, for the time been I'll stick to it and spend my time for further function implementation.
My only worry... your example was just a few lines... understandable... how did they end up with 1700 lines of code or this?
Whatever.. I'l go back to it when I have some more time as I prefer an official implementation to a patch like mine... -
@kimot , right now I'm using the Arduino IDE application which allows me to upload to NodeMCU just using the USB cable.
Reading the ESPeasy documentation I understand that this type of connection is not an option and you must have a USB to TTL interface.
I'd be very happy to hear that I don't need it... otherwise I'm going to get one on monday...@gbuico
USB to TTL serial is on board on NodeMCU and Wemos.Download
ESPEasy mega dev.13Upload to your NodeMCU using "FlashESP8266.exe" from .zip
Upload to NodeMCUUse "....._normal_4096.bin" file
Power off - on !!! your NodeMCU ( reconnect USB cable )
Make basic setup:
With smart phone or notebook connect to your NodeMCU, which works like wifi acces point now ( name like "ESP_Easy_0" )
If password required - "configesp"
Type in browser address 192.168.4.1
wifi setup
Set your home wifi access info in config page.
You will see actual IP your NodeMCU in your wifi network.
Connect to this IP and make basic setup.
( you can set Fixed IP, IP of your Domoticz, etc )
ESPEasy setup