Page 1 of 1

Domoticz Long to reconnect to mysensors ESP after ESP powercycle

Posted: Friday 19 February 2016 22:42
by fcoelho
Hello,

I am using a connection between Domoticz and ESP with mysensors and works fines, but, after making a power down power up in the ESP Domoticz takes about 17 minutes to try the connection after that it works
What would be the cause?
  • 2016-02-19 20:27:44.738 (ESP Mysensors relay 2) Lighting 2 (Light 0)
    2016-02-19 20:27:44.743 (ESP Mysensors relay 2) Lighting 2 (Light 0)
    2016-02-19 20:27:44.749 (ESP Mysensors relay 2) Lighting 2 (Light 0)

    2016-02-19 20:34:57.260 Incoming connection from: 115.239.228.10
    2016-02-19 20:44:14.982 TCP: Reconnecting in 30 seconds...
    2016-02-19 20:44:44.986 TCP: Reconnecting...
    2016-02-19 20:44:45.987 MySensors: connected to: 192.168.1.121:5003
    2016-02-19 20:44:45.987 MySensors: Gateway Ready...
    2016-02-19 20:44:46.991 MySensors: Gateway Version: 1.6.0-beta

Re: Domoticz Long to reconnect to mysensors ESP after ESP powercycle

Posted: Saturday 20 February 2016 10:36
by gizmocuz
Maybe you have set a data timeout to 15 minutes ? (on the mysensors hardware setup)
This is because domoticz does not get a clean disconnect/close, infact it does not know it
maybe the system cleans up the socket after a while, and then domoticz knows
If you have a sensor node that transmits for example every 4 minutes something to domoticz (like a hearbeat message (new since 2.0), or a temperature), you could set a data timeout to 5 minutes
Thats at least better then 17

Re: Domoticz Long to reconnect to mysensors ESP after ESP powercycle

Posted: Saturday 20 February 2016 21:10
by fcoelho
Many thanks for you Quick answer.
In reality i have two relays to on off from domoticz.
There is no timeout. To test what happens if i simulator an energy failure only in the esp with two relays attached.
Domoticz only after 15min tries to reconnect. It is what I see in the log. Mysensors acts as a server in the relay standard sketch?
The question is why only after 15min there is a visible retry in the log? How to have more log detail?
TIA

Re: Domoticz Long to reconnect to mysensors ESP after ESP powercycle

Posted: Saturday 14 May 2016 17:41
by zaphodus
In the MySensors development version the gateway can be a sensor node too. The domoticz send the heartbeat message to the gateway in every 10 second, but do nothing with the response. If the heartbeat response processed as incoming data the "data timeout" funtion will work properly.
I have made a patch for this issue: https://github.com/domoticz/domoticz/pull/656

Re: Domoticz Long to reconnect to mysensors ESP after ESP powercycle

Posted: Saturday 14 May 2016 19:23
by gizmocuz
Thanks, patch is merged in the repository