Gateway Ack Message
-
Hello all, who does the Node handles missed messages, messages without a returned ack? Does it try again? Is there a time out? Can I catch a missed ack? I'm using this code in my switch actuators. What happens is that sometimes I click the button and nothing happens, because the GW never replayed back. Questions:
- Can I make it retry if failed by timeout?
- Can I catch that time out in any method like the response?
Thank you all
-
@soloam https://www.mysensors.org/download/sensor_api_20#sending-data
bool send(MyMessage &msg, bool ack);
Set second argument to true and function send will return true if ack was received and false in contrary. Then you need to write your own procedure to resend message (or do anything else) if function returns false. But mention that ack is send by the first node who receives your message. It means that if you have a repeater node between your node and GW you will only know if repeater gets the message, but you cant be sure if GW received it afterwards.
-
@monte that's actually incorrect. But I don't blame you, many people have made the same conclusion as you did. That includes me. It took me about 40 hours of reading forum posts and source code hunting for an answer before I learned how it actually works.
The return value of the send function is not affected by the ack parameter at all. But the ack parameter is related to delivery to final node, not just the next node (repeater).
Some information is available here: https://forum.mysensors.org/post/34267
I have unfortunately not found a way to describe how the different acks work in a way that is easy to understand.
-
And do we have a way to get a feedback if act was successful? So that We can make something like... if it fails... do it again
-
@mfalkvidd funny thing is that I read that thread, but somehow after some time and some reading it all messed up in my mind again. I hope this time I'll remember this for longer.
@Soloam you need to write a code in receive function, which will check if ack message is returned. This will ensure your message is received by the GW. Read the thread mentioned by @mfalkvidd.
-
@monte yeah, I will have to go back to that thread again and read it thoroughly if I ever need to implement something that requires reliable messages.
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
MQTT-Help me understand about the MQTT Gateway.
Development • 28 days ago • dpcons 17 days ago -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26