ACKs... Scarce information
-
I've read through the api, several forum topics and it is still unclear to me.
By default acks are disabled.
Is it a good practice to enable them on sensors with switches and dimmers?
If yes.
In the api it says - * if you want destination node *
Destination node in this case is the gateway which must send the ack upon the receipt of data?
-
Inter node acks is always enabled. The result is returned when calling send().
But if you want destination node to send a ack back to the origin you must enable this manually when calling send. The end-to-end ack message appears in the incomingMessage function.
-
Strangly i have a sketch with the following
float mq_reading = analogRead(MQ_Pin); if (isnan(mq_reading)) { Serial.println("Failed mq_reading"); } else if (mq_reading != last_mq_reading) { last_mq_reading = mq_reading; gw.send(msgMQ.set(mq_reading, 1));
And on the controller (MQTT client gateway on NODEMcu) i never see ACK enabled
mygateway1-out/71/6/1/0/37 309.0
-
I don't understand, could you rephrase?
-
On one of my nodes i have ack message set for the MQ sensor as can be seen in the code
gw.send(msgMQ.set(mq_reading, 1));
On the controller (Openhab) i see the message like
mygateway1-out/71/6/1/0/37 309.0
This sensor conencts to the MQTT client gateway and the structure of MQTT is supposed to be
MY_MQTT_PUBLISH_TOPIC_PREFIX/FROM-NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE
So shouldn't the message have 1 before 37 at the end like below?
mygateway1-out/71/6/1/1/37 309.0
-
To enable ack you must call:
gw.send(msgMQ.set(mq_reading, 1), true);
-
Thank you didn't notice that it was a decimal point one.
So is it reasonable to enable ack for switches? And leave it disabled for sensors reporting data?
-
You only need to enable if if you actually use the resulting ack message for something.
If you look at the RelayWithButton example you can see an example of how the local relay only get updated when the ack is received (after pressing the local button).
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
Combination of networks
General Discussion • 1 Feb 2025, 17:30 • Sniker 4 Feb 2025, 01:02 -
Running out of nodeId's
General Discussion • 3 Sept 2024, 07:33 • NielBierman 25 Jan 2025, 17:19 -
ESP-NOW
General Discussion • 22 Apr 2018, 05:58 • NeverDie 17 Feb 2025, 22:24 -
Why is the output of ACS712 current measurement module unchanged?
General Discussion • 19 Jul 2021, 09:09 • Tessie T 2 days ago -
Meet in Malmö, Summer 2016?
General Discussion • 1 Feb 2016, 15:34 • bjacobse 28 days ago