Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Connecting first node to new gateway - what am I missing?

Connecting first node to new gateway - what am I missing?

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 6 Posters 6.0k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JonnyDev13J JonnyDev13

    @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:PDT
    

    I see that something is a "FAILURE", but what? Any ideas what is going wrong at this point?

    TheoLT Offline
    TheoLT Offline
    TheoL
    Contest Winner
    wrote on last edited by
    #4

    @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.

    1. Did you add a capacitor?
    2. How do you power the radio?
    1 Reply Last reply
    0
    • JonnyDev13J Offline
      JonnyDev13J Offline
      JonnyDev13
      wrote on last edited by
      #5

      @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.

      TheoLT 1 Reply Last reply
      0
      • JonnyDev13J JonnyDev13

        @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.

        TheoLT Offline
        TheoLT Offline
        TheoL
        Contest Winner
        wrote on last edited by TheoL
        #6

        @JonnyDev13 @JonnyDev13 One thing at a time.

        1. 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...

        mfalkviddM 1 Reply Last reply
        0
        • TheoLT TheoL

          @JonnyDev13 @JonnyDev13 One thing at a time.

          1. 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...

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #7

          @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.

          TheoLT 1 Reply Last reply
          1
          • mfalkviddM mfalkvidd

            @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.

            TheoLT Offline
            TheoLT Offline
            TheoL
            Contest Winner
            wrote on last edited by
            #8

            @mfalkvidd That's the one. Thanx buddie!

            1 Reply Last reply
            1
            • LOSTL Offline
              LOSTL Offline
              LOST
              wrote on last edited by
              #9

              @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.

              TheoLT 1 Reply Last reply
              0
              • LOSTL LOST

                @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.

                TheoLT Offline
                TheoLT Offline
                TheoL
                Contest Winner
                wrote on last edited by
                #10

                @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

                tekkaT 1 Reply Last reply
                0
                • TheoLT TheoL

                  @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

                  tekkaT Offline
                  tekkaT Offline
                  tekka
                  Admin
                  wrote on last edited by tekka
                  #11

                  @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.

                  1 Reply Last reply
                  1
                  • LOSTL Offline
                    LOSTL Offline
                    LOST
                    wrote on last edited by LOST
                    #12

                    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.

                    1 Reply Last reply
                    0
                    • LOSTL Offline
                      LOSTL Offline
                      LOST
                      wrote on last edited by
                      #13

                      Ok, @tekka. Thanks.

                      1 Reply Last reply
                      0
                      • JonnyDev13J Offline
                        JonnyDev13J Offline
                        JonnyDev13
                        wrote on last edited by
                        #14

                        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 2
                        

                        This 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 1
                        

                        to the sensor node's sketch, and

                        #define MY_NODE_ID 1
                        

                        to 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!

                        1 Reply Last reply
                        1
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        7

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.0k

                        Posts


                        Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • MySensors
                        • OpenHardware.io
                        • Categories
                        • Recent
                        • Tags
                        • Popular