Connecting first node to new gateway - what am I missing?
-
@Boots33, thanks for the tip! That definitely gets me a little bit farther. I removed the Serial.begin line and set the speed to 115200. Now instead of garbage I'm getting this message over and over when I have the serial monitor watching the sensor node:
Starting sensor (RNNNA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDTI see that something is a "FAILURE", but what? Any ideas what is going wrong at this point?
-
@Boots33, thanks for the tip! That definitely gets me a little bit farther. I removed the Serial.begin line and set the speed to 115200. Now instead of garbage I'm getting this message over and over when I have the serial monitor watching the sensor node:
Starting sensor (RNNNA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDTI see that something is a "FAILURE", but what? Any ideas what is going wrong at this point?
@JonnyDev13 if I'm not mistaken your sensor tries to connect to your gateway but the radio on your sensor isn't able to find the gateway.
In most cases this is power related.
- Did you add a capacitor?
- How do you power the radio?
-
@TheoL, you're absolutely right. I was just about to post about that. In the instructions about Connecting the Radio to your Arduino it mentions "Refer to the notes about using a regulator or a coupling-capacitor below." The "or" in there made me think I didn't need a capacitor since maybe the regulator took care of the problem or something. I added in a capacitor and the sensor is connecting to the gateway!
Now the gateway is at least receiving messages and passing them on to MQTT. Unfortunately, the messages don't contain any numbers. There also seems to be something wrong on the sensor node side. I don't see any of the serial prints that should be showing the temperature readings in the serial monitor:
Here's the sensor node serial output:
!TSM:CHKID:FAIL (ID=255) !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: !TSM:CHKID:FAIL (ID=255)And here's some output from the gateway. (I'm not sure if they line up exactly.)
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255) 0;255;3;0;9;TSP:CHKUPL:OK 0;255;3;0;9;TSP:MSG:GWL OK 0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:SANCHK:OK 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;TSP:MSG:BC 0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)The mygateway1-out/255/255/3/0/3 topic is receiving blank messages.
Is there a reference somewhere about what the output failure messages mean? I feel like I could look some of these things up myself if I knew where to look.
-
@TheoL, you're absolutely right. I was just about to post about that. In the instructions about Connecting the Radio to your Arduino it mentions "Refer to the notes about using a regulator or a coupling-capacitor below." The "or" in there made me think I didn't need a capacitor since maybe the regulator took care of the problem or something. I added in a capacitor and the sensor is connecting to the gateway!
Now the gateway is at least receiving messages and passing them on to MQTT. Unfortunately, the messages don't contain any numbers. There also seems to be something wrong on the sensor node side. I don't see any of the serial prints that should be showing the temperature readings in the serial monitor:
Here's the sensor node serial output:
!TSM:CHKID:FAIL (ID=255) !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSM:FPAR TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok: !TSM:CHKID:FAIL (ID=255)And here's some output from the gateway. (I'm not sure if they line up exactly.)
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255) 0;255;3;0;9;TSP:CHKUPL:OK 0;255;3;0;9;TSP:MSG:GWL OK 0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:SANCHK:OK 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0: 0;255;3;0;9;Sending message on topic: mygateway1-out/255/255/3/0/3 0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;TSP:MSG:BC 0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)The mygateway1-out/255/255/3/0/3 topic is receiving blank messages.
Is there a reference somewhere about what the output failure messages mean? I feel like I could look some of these things up myself if I knew where to look.
@JonnyDev13 @JonnyDev13 One thing at a time.
- You can communicate. That's great to hear.
I investigated your sketch. I don't see anything strange at the first glance. Maybe @mfalkvidd can help us with locating the reference, because I've seen him post that somewhere. I'd want to look them up myself, but have limited time at moment.
What I find strange, is that your gateway is saying mygateway1-out/255/255/3/0/3 so I'd expected at least two or three MQTT messages in that topic...
-
@JonnyDev13 @JonnyDev13 One thing at a time.
- You can communicate. That's great to hear.
I investigated your sketch. I don't see anything strange at the first glance. Maybe @mfalkvidd can help us with locating the reference, because I've seen him post that somewhere. I'd want to look them up myself, but have limited time at moment.
What I find strange, is that your gateway is saying mygateway1-out/255/255/3/0/3 so I'd expected at least two or three MQTT messages in that topic...
-
@TheoL reference to how to read the 2.0 output? In that case it is available in the usual place, https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/4
I have not learned how to read the 2.0 debug output yet myself.@mfalkvidd That's the one. Thanx buddie!
-
@JonnyDev13
Do you have a controller connected to the MQTT server? My thought is (not being an expert at all) that your node does not get an ID from a controller, and set it locally to 255...If you don't have a controller that hands out id's to nodes, set the node_id in the node sketch.
-
@JonnyDev13
Do you have a controller connected to the MQTT server? My thought is (not being an expert at all) that your node does not get an ID from a controller, and set it locally to 255...If you don't have a controller that hands out id's to nodes, set the node_id in the node sketch.
@LOST Not 100% positive on this one. But I have always thought that the gateway is responsible for handing out node id's. The controller assigns his own internal ID. At least that's what Domoticz is doing in mine setup.
Otherwise assigning a static Node id couldn't work...... I think
-
@LOST Not 100% positive on this one. But I have always thought that the gateway is responsible for handing out node id's. The controller assigns his own internal ID. At least that's what Domoticz is doing in mine setup.
Otherwise assigning a static Node id couldn't work...... I think
@TheoL @LOST @JonnyDev13 The GW does not assign node IDs, either you set them locally using
#define NODE_ID 10(to be placed before
#include <MySensors.h>)
or your controller supports node ID assignments.
This debug log indicates a node requesting an ID from the controller:
TSM:ID TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:If no ID assigned after a few retries, the node will emit an error:
!TSM:CHKID:FAIL (ID=255)and re-initialise.
-
Off Topic:
As I said, I'm no expert at all, not even experienced in MySensors..but in https://www.mysensors.org/about/network it says:Each node is assigned a unique sensorId or address that is used for sending and receiving point-to-point messages. You can assign a static sensorId or let the controller automatically assign one to the sensor. AUTO-mode configures the sensor to request a sensorId from the controller and is the default option for all the examples that we provide. The sensor stores the assigned sensorId in its non-volatile memory to ensure the correct sensorId persists across power transitions. -
Ok, now we're cooking! @tekka, thanks for explaining some of the details that I was missing. I'm sure I read that before, but I guess I swapped "gateway" with "controller" in my head, assuming that the sensor node would be assigned an id by the gateway.
I placed the following in my sensor node's sketch:
#define MY_NODE_ID 2This avoided any errors, but I still wasn't seeing the correct message come through MQTT.
Not sure if it was required, but I ended up having to add
#define MY_PARENT_NODE_ID 1to the sensor node's sketch, and
#define MY_NODE_ID 1to the gateway node's sketch. Once I did that, the temperature readings started showing up in MQTT!
Thanks for the help everybody. I still have quite a bit to learn, but getting a working sensor sending data all the way through the gateway to MQTT was the biggest hurdle to really making progress on implementing these. THANK YOU!