Ack

Moderator: leecollings

pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: Ack

Post by pj-r »

Anticimex wrote:It does not happen every time. Just approx. every second attempt.
Can you debug if domoticz won't get ack reply from node for its first message and retries because of that?
I'm just quessing..
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
Anticimex
Posts: 14
Joined: Sunday 29 November 2015 18:36
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Ack

Post by Anticimex »

It could be. I'm not sure. The node does send ACK but domoticz has a too short timeout for the ACK to arrive. On the communication channel, the ACK is sent to domoticz before domoticz sends the second message but I am not sure of the order "inside" domoticz. I have a different thread where I have explained the problem with ACK timeout. This might be related to that. The ACK timeout really needs to be increased for MySensors, or be configurable. I have a simple setup, with one gateway and one node. The only difference from the simplest form is that I enable message signing with add some time to message processing. This appear to make the turnaround for a message be slightly longer than domoticz accepts. Other controller softwares I have tried does not seem to have a problem with this. I suspect their ACK timeouts are longer.
markswift
Posts: 1
Joined: Saturday 02 April 2016 13:58
Target OS: Windows
Domoticz version:
Contact:

Re: Ack

Post by markswift »

Hi guys,

Just started with Domoticz, and have implemented my sensors. Firstly, the ack seems to work great returning an error if it isn't received! Thanks.

My question is, I have a number of flows that send with a relay action on a my sensors node. i.e. if node reports reports rain, toggle node relay. The issue is, the node relay is attached to my robot mower, which might be out of range cutting the garden... What I'd like is for the toggle to be resent until it's successful, instead of just once (which might fail, thanks to ack). Any ideas?
casio
Posts: 7
Joined: Monday 16 May 2016 12:56
Target OS: Linux
Domoticz version:
Contact:

Re: Ack

Post by casio »

Hi Anticimex, All,

I had the same feeling that the timeout is too short and the message is send twice (while using HW signing). I just did some experimenting using the Soft Signing in, the response is faster which ensure that the ACK is received by Domoticz within the 1200ms. When using the Secure Element (HW signing) the time to produce the nonce, wait for the signed message (from GW), verifying the signed message, and sending back the message with the ACK seem to take too long. Currently, the retry counter (hardware/MySensorsBase.cpp) is 12 with a 100ms sleep. By gradually increasing the counter the timeout (and resending the same message) stopped occurring from 14 (~1.4s) or higher.

As I use HW signing on all my nodes to ensure a proper random number, besides sensors that only send stuff (e.g. door sensors as they get the nonce from the GW) I would be great if this can be added as an options that can be set in the Setup > Hardware > Mysensors, or at least increase it to >1.4 seconds.

BTW great work what you did on the signing, this was one of my prerequisites before using My Sensors. Ensuring authenticity and integrity are key and in my opinion a minimum requirement for all IoT devices.
Anticimex
Posts: 14
Joined: Sunday 29 November 2015 18:36
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Ack

Post by Anticimex »

Hi,
yes, I have noticed the same thing. This in combination with the fact that a node can be several hops away, strongly motivates a setting to make ACK timeout longer or at least configurable. I have filed a issue on the github page for this. Hopefully, it will be included in future releases.
Thanks, btw :)
casio
Posts: 7
Joined: Monday 16 May 2016 12:56
Target OS: Linux
Domoticz version:
Contact:

Re: Ack

Post by casio »

Thanks for filing the issue. Actually, I should register on GitHub as well. As I'm gratefully using Domoticz (and My Sensors) it would be great to contribute if/where possible.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest