💬 Serial Protocol - 2.x
-
Where can I find the structure for the payload of the internal command I_LOG_MESSAGE ? e.g. payload "TSF:MSG:SEND,211-0-220-220,s=211,c=1,t=23,pt=2,l=2,sg=0,ft=0,st=OK:69"
I know I'm sending a value from node 211 to node 220 with the value 69. What does c=1, t=23, pt=2, l=2, sg=0,ft=0 mean? -
-
how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?
ps I´m using openhab
@siod said in 💬 Serial Protocol - 2.x:
how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?
ps I´m using openhab
I just tested this using a Serial gateway.
Sending
sendHeartbeat()from node displays this on my Serial gateway:... 214;255;3;0;22;73 214;255;3;0;22;108 214;255;3;0;22;143 ...3=internal message
0=nack
22=I_HEARTBEAT_RESPONSEIn MyTransport.cpp I found
uint32_t transportGetHeartbeat(void) { return transportTimeInState(); } --- uint32_t transportTimeInState(void) { return hwMillis() - _transportSM.stateEnter; }So the payload is some elapsed time in milliseconds.
-
@siod said in 💬 Serial Protocol - 2.x:
how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?
ps I´m using openhab
I just tested this using a Serial gateway.
Sending
sendHeartbeat()from node displays this on my Serial gateway:... 214;255;3;0;22;73 214;255;3;0;22;108 214;255;3;0;22;143 ...3=internal message
0=nack
22=I_HEARTBEAT_RESPONSEIn MyTransport.cpp I found
uint32_t transportGetHeartbeat(void) { return transportTimeInState(); } --- uint32_t transportTimeInState(void) { return hwMillis() - _transportSM.stateEnter; }So the payload is some elapsed time in milliseconds.
@gvorster Thank you for explanation!
One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?
-
@gvorster Thank you for explanation!
One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?
@siod said in 💬 Serial Protocol - 2.x:
@gvorster Thank you for explanation!
One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?
There are many examples code how to do this. One Timer library I use myself is this https://playground.arduino.cc/Code/Timer
e.g. for a repeater you could use this:
#include "Timer.h" Timer t; void setup() { t.every(60000, sendImAlive); } void loop() { t.update(); } void sendImAlive() { sendHeartbeat(); } -
Hi there,
do you know that, you've built a node like a 100 times and I think it's all routine and then something that completely bluffs you? I happened to me with a simple Temp/Hum node (DHT22) that keeps sending me messages that I can't seem to figure out: 43;255;3;0;33;300000 and 43;255;3;0;32;500 - They seem to show up in the frequency that other nodes send a heartbeat signal, but no heartbeat is sent from this node. The regular DHT22 datapoints are sent as normal. Anyone knows what this means? -
hm, you might be right on the 300000 as that#s indeed the smartsleep wait time I'm setting. Not sure about the 500, but certainly possible (is that documented somewhere?) I'm wondering, though, why this node is sending this info, but not the other ones?! I don't think I have changed anything t the sketch other than the node-id and node name...
-
Try reflash the older node, maybe you updated library or else. Why do you need heatbeat if the node is sending every 5 minutes?
@gohan fair question, I don't need it, it's just still in the code and besides, the 5 min message from smartsleep seems to show up every two mins (the heartbeaat rate)
And yes, I did indeed update the library, so maybe that's why. Turns out, the bigger problem is that these message seem to cause an exception in the openhab mysensor binding, so at best I'd like to figure out how to stop the node from sending them... Will do some digging -
yes, I am sure now: https://forum.mysensors.org/topic/8933/mysensors-2-2-0-released/27
Looks like the only way to eliminate the messages is to not use smartsleep ;)