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. Controllers
  3. OpenHAB
  4. Lost beginner - nodes, parent nodes and changes needed to sketches ?

Lost beginner - nodes, parent nodes and changes needed to sketches ?

Scheduled Pinned Locked Moved OpenHAB
18 Posts 3 Posters 3.8k Views 3 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.
  • gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #4

    Each sensor in a node has a child ID (look at the examples) so I guess that is the number you are looking to specify in Openhab when adding a new thing

    1 Reply Last reply
    0
    • A anonymouslemming

      Hi all,

      I'm trying to get OpenHAB working in a test environment. I've built a serial gateway on an Arduino uno and used the GatewaySerial sketch.

      I can add this as a Thing to OpenHAB by specifying the serial device and it shows as 'Online' in the Things view.

      I'm now trying to add a switch which is an Arduino nano with a radio and a relay running the RelayActuator example sketch. Nothing is discovered, so I've chosen 'Manually Add Thing' and then chosen Switch.

      In the switch menu, it prompts me for a node ID and a child node ID.

      What values should I be using for these? And what do I need to change in my RelayActuator sketch for the device to have this info available ?

      Thanks,

      parachutesjP Offline
      parachutesjP Offline
      parachutesj
      wrote on last edited by
      #5

      @anonymouslemming I am still using openhab 1. it never assigned device ID's automatically. So I set them manually and burned them to the ROM. There are sketches here to do this. So in principle you start withe node -1- write thet to ROM and the burn the sketch to it in 2nd step.
      If you add more nodes later, you just number them and make sure they are unique.
      For the child id, it is easier, this is within the sketch. Usually the first is 0
      If you have a node with one switch it should be 0 if not specified differently. All sample sketches are this way.
      If you build a more complex with e.g. a temp, humidity and light sensor the child id's will become 0, 1, 2

      Ok?

      Btw: if you have the node connected to the serial console you should see that information. Post your debug output if still in doubt

      SJ

      1 Reply Last reply
      0
      • A Offline
        A Offline
        anonymouslemming
        wrote on last edited by
        #6

        I've taken OpenHAB out of the equation for the moment in the hopes of simplifying things. I'm just trying to get the 2 radios to connect.

        I'm lost as to the actual syntax I should be using to set node IDs and sensor IDs.

        On my serial gateway, I get the following when plugging it in:

        0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
        0;255;3;0;9;TSM:INIT
        0;255;3;0;9;TSF:WUR:MS=0
        0;255;3;0;9;TSM:INIT:TSP OK
        0;255;3;0;9;TSM:INIT:GW MODE
        0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
        0;255;3;0;9;MCO:REG:NOT NEEDED
        0;255;3;0;14;Gateway startup complete.
        0;255;0;0;18;2.1.1
        0;255;3;0;9;MCO:BGN:STP
        0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
        

        That looks about right to me.

        On the sensor (light switch) device, I see the following when plugging it in:

        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
        

        From what I can tell, that means that the connection from the Arduino to the radio is good and the radio is healthy, but it's not being able to connect to anything.

        I'm lost as to what part of the examples I should be including here to get these to connect.

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #7

          make sure #define MY_NODE_ID 3 and all other mysensors related defines are written before the #include <MySensors.h>

          A 1 Reply Last reply
          0
          • gohanG gohan

            make sure #define MY_NODE_ID 3 and all other mysensors related defines are written before the #include <MySensors.h>

            A Offline
            A Offline
            anonymouslemming
            wrote on last edited by
            #8

            @gohan said in Lost beginner - nodes, parent nodes and changes needed to sketches ?:

            make sure #define MY_NODE_ID 3 and all other mysensors related defines are written before the #include <MySensors.h>

            I've got the following near the top of the sketch:

            // Enable debug prints to serial monitor
            #define MY_DEBUG
            // Enable and select radio type attached
            #define MY_RADIO_NRF24
            #define MY_NODE_ID 3
            #include <MySensors.h>
            

            There are no occurrences of MY_NODE_ID above this, but I'm seeing the same behaviour.

            Is this test even useful? insofar as testing radio connectivity without a gateway in place ?

            Is anyone able to share a circuit and a sketch for a simple relay that's known to work with OpenHAB, or should the examples be working ?

            thanks,

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #9

              What do you mean you don't have a gateway in place?

              A 1 Reply Last reply
              0
              • gohanG gohan

                What do you mean you don't have a gateway in place?

                A Offline
                A Offline
                anonymouslemming
                wrote on last edited by
                #10

                @gohan said in Lost beginner - nodes, parent nodes and changes needed to sketches ?:

                What do you mean you don't have a gateway in place?

                Apologies - I mean that I don't have a controller in place at the moment. I do have the serial gateway running, but no node ID variables / defines in there.

                parachutesjP 1 Reply Last reply
                0
                • A anonymouslemming

                  @gohan said in Lost beginner - nodes, parent nodes and changes needed to sketches ?:

                  What do you mean you don't have a gateway in place?

                  Apologies - I mean that I don't have a controller in place at the moment. I do have the serial gateway running, but no node ID variables / defines in there.

                  parachutesjP Offline
                  parachutesjP Offline
                  parachutesj
                  wrote on last edited by
                  #11

                  @anonymouslemming have you tried another arduino? I think I had once a similar issue, all was set correct but node did not connect. Changed the arduino and it worked.

                  A 1 Reply Last reply
                  0
                  • parachutesjP parachutesj

                    @anonymouslemming have you tried another arduino? I think I had once a similar issue, all was set correct but node did not connect. Changed the arduino and it worked.

                    A Offline
                    A Offline
                    anonymouslemming
                    wrote on last edited by
                    #12

                    @parachutesj said in Lost beginner - nodes, parent nodes and changes needed to sketches ?:

                    @anonymouslemming have you tried another arduino? I think I had once a similar issue, all was set correct but node did not connect. Changed the arduino and it worked.

                    I've tried 3 different Arduino Nano's on the switch module and 2 different radios. Replaced cables too. I tried a different Arduino Uno on the gateway module too.

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #13

                      according to the log the node is not getting an ID otherwise it should show in the first lines that it is using ID = 3
                      You could try running the cleareeprom sketch and upload your sketch again

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        anonymouslemming
                        wrote on last edited by
                        #14

                        I finally got this working. My problem was my radio's were not communicating. I went back to basics with an RF24 example sketch and found one of my radio's to be dead. After replacing it, I simply set
                        MY_NODE_ID in my sketch and everything is now working.

                        gohanG 1 Reply Last reply
                        0
                        • A anonymouslemming

                          I finally got this working. My problem was my radio's were not communicating. I went back to basics with an RF24 example sketch and found one of my radio's to be dead. After replacing it, I simply set
                          MY_NODE_ID in my sketch and everything is now working.

                          gohanG Offline
                          gohanG Offline
                          gohan
                          Mod
                          wrote on last edited by
                          #15

                          @anonymouslemming it is always good to have spare parts around :D

                          A 1 Reply Last reply
                          0
                          • gohanG gohan

                            @anonymouslemming it is always good to have spare parts around :D

                            A Offline
                            A Offline
                            anonymouslemming
                            wrote on last edited by
                            #16

                            @gohan I have SOOO many spare RF24's now - I bought a batch of 10 off of Amazon while debugging this.

                            :D

                            1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #17

                              I hope yours are not the cheap crappy chinese clones like I got from Amazon too. If you paid less than 12$ for those, they most likely are too.

                              A 1 Reply Last reply
                              0
                              • gohanG gohan

                                I hope yours are not the cheap crappy chinese clones like I got from Amazon too. If you paid less than 12$ for those, they most likely are too.

                                A Offline
                                A Offline
                                anonymouslemming
                                wrote on last edited by
                                #18

                                @gohan I'm almost 100% sure they're clones, yeah. But they've been going for 2 days now across the range of my house (while in low power mode - no capacitor in place yet), so they'll do for prototyping.

                                Once I get to designing and printing boards, then I'll be a lot fussier :)

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


                                19

                                Online

                                11.7k

                                Users

                                11.2k

                                Topics

                                113.1k

                                Posts


                                Copyright 2025 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