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. Development
  3. Node to node comunication with optional controller

Node to node comunication with optional controller

Scheduled Pinned Locked Moved Development
nodecontroller
12 Posts 3 Posters 3.3k 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.
  • DoomicD Doomic

    I have a very small node.. planning to build into the wall... I know there are a lot of topics about this.. but the hadware is not THE problem.
    The purpose of the node is when it is switched on.. call to another node that he is online... the other node will switch on the house ventilation system.. and will check once in a while the node that requested the highest fan speed if that node is still on...
    The whole system can run without the need of a controller. Most of the time my home server is on.. but i don't want to depend on it.

    My only last problem is.
    when the node is starting up. it will first connect to the controller.. if it can't connect.. it is looping until it will connect.
    I am using the newest version of the api (V2.1). I tried to set the
    #define MY_REGISTRATION_RETRIES (1u)

    and
    #undef MY_REGISTRATION_FEATURE

    but it stays looping.
    i also found these 2 lines
    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC

    but than the controller is trying to send a nack message.

    i prefer to see it will connect to the controller if it is online.. but doent wait for it before sending messages to the other nodes.
    However, if that isn't posible.. disconnecting this node from the controller is also an option.
    anyone knows how?

    AWIA Offline
    AWIA Offline
    AWI
    Hero Member
    wrote on last edited by AWI
    #2

    @Doomic use: #define MY_TRANSPORT_WAIT_READY_MS 1 // sketch moves on if no registration and you can skip the other definitions (if not needed for something else). Great for use in 'autonomous' nodes.

    1 Reply Last reply
    0
    • DoomicD Offline
      DoomicD Offline
      Doomic
      wrote on last edited by
      #3

      looks good. I will try this later today.

      1 Reply Last reply
      0
      • DoomicD Offline
        DoomicD Offline
        Doomic
        wrote on last edited by
        #4

        @AWI get an error. [!MCO:SND:NODE NOT REG]
        perhaps you have changed more? in you MyConfig.h maybe?

        AWIA 1 Reply Last reply
        0
        • DoomicD Doomic

          @AWI get an error. [!MCO:SND:NODE NOT REG]
          perhaps you have changed more? in you MyConfig.h maybe?

          AWIA Offline
          AWIA Offline
          AWI
          Hero Member
          wrote on last edited by
          #5

          @Doomic This is what I have in the sketch.. no changes in the config

          // Enable debug prints to serial monitor
          #define MY_DEBUG 
          #define MY_PARENT_NODE_ID 0
          #define MY_NODE_ID 90											// fixed node number
          
          // Enable and select radio type attached
          #define MY_RADIO_NRF24
          #define MY_RF24_CHANNEL 83										// 83, radio channel, default = 76
          #define MY_RF24_PA_LEVEL RF24_PA_LOW							// helps (sometimes) to get a stable communication
          
          #define MY_TRANSPORT_WAIT_READY_MS 1							// sketch moves on if no registration
          1 Reply Last reply
          0
          • DoomicD Offline
            DoomicD Offline
            Doomic
            wrote on last edited by
            #6

            I don't get it.
            It keep saying "NODE NOT REG"

            I have cleaned my sketch completly and it is now looking like below. But no progress on this.
            Compared myconfig.h file.. no changes with the one on github.
            removed some defines, tried all kind of combination.

            What am i missing?

            #define MY_DEBUG
            
            #define MY_RADIO_NRF24
            #define MY_RF24_CHANNEL 83
            #define MY_RF24_PA_LEVEL RF24_PA_LOW 
            
            #define MY_NODE_ID 21
            #define MY_PARENT_NODE_ID 0
            #define MY_PARENT_NODE_IS_STATIC
            #define MY_REGISTRATION_RETRIES 0
            #undef MY_REGISTRATION_FEATURE
            #define MY_TRANSPORT_WAIT_READY_MS 1
            
            #include <SPI.h>
            #include <MySensors.h>
             
            MyMessage msgTest(2, V_LIGHT);
            
            void setup()  
            { 
              msgTest.setDestination(20);
            }
            
            void presentation()
            {
              sendSketchInfo("Test", "1.0");
            }
            
            void loop() 
            {
              Serial.println("send");
              send(msgTest.set(false));
              wait(3000);
            } 
            
            Boots33B AWIA 2 Replies Last reply
            0
            • DoomicD Doomic

              I don't get it.
              It keep saying "NODE NOT REG"

              I have cleaned my sketch completly and it is now looking like below. But no progress on this.
              Compared myconfig.h file.. no changes with the one on github.
              removed some defines, tried all kind of combination.

              What am i missing?

              #define MY_DEBUG
              
              #define MY_RADIO_NRF24
              #define MY_RF24_CHANNEL 83
              #define MY_RF24_PA_LEVEL RF24_PA_LOW 
              
              #define MY_NODE_ID 21
              #define MY_PARENT_NODE_ID 0
              #define MY_PARENT_NODE_IS_STATIC
              #define MY_REGISTRATION_RETRIES 0
              #undef MY_REGISTRATION_FEATURE
              #define MY_TRANSPORT_WAIT_READY_MS 1
              
              #include <SPI.h>
              #include <MySensors.h>
               
              MyMessage msgTest(2, V_LIGHT);
              
              void setup()  
              { 
                msgTest.setDestination(20);
              }
              
              void presentation()
              {
                sendSketchInfo("Test", "1.0");
              }
              
              void loop() 
              {
                Serial.println("send");
                send(msgTest.set(false));
                wait(3000);
              } 
              
              Boots33B Offline
              Boots33B Offline
              Boots33
              Hero Member
              wrote on last edited by
              #7

              @Doomic

              That compiles ok for me. Are you using MySensors v2.1.1 ?

              it might be best to re install the mysensor library and try again

              1 Reply Last reply
              0
              • DoomicD Offline
                DoomicD Offline
                Doomic
                wrote on last edited by
                #8

                Yes i am using the newest 2.1 version. I may try to reinstall mysensors, however i dont think that is the problem.

                Compiling isnt the problem, but when i run the sketch on my Arduino, It tells me trough the serial monitor that the node is not registered. (Because i doesnt have a gateway/controller nearby). Therefor it can't make calls.

                1 Reply Last reply
                0
                • DoomicD Doomic

                  I don't get it.
                  It keep saying "NODE NOT REG"

                  I have cleaned my sketch completly and it is now looking like below. But no progress on this.
                  Compared myconfig.h file.. no changes with the one on github.
                  removed some defines, tried all kind of combination.

                  What am i missing?

                  #define MY_DEBUG
                  
                  #define MY_RADIO_NRF24
                  #define MY_RF24_CHANNEL 83
                  #define MY_RF24_PA_LEVEL RF24_PA_LOW 
                  
                  #define MY_NODE_ID 21
                  #define MY_PARENT_NODE_ID 0
                  #define MY_PARENT_NODE_IS_STATIC
                  #define MY_REGISTRATION_RETRIES 0
                  #undef MY_REGISTRATION_FEATURE
                  #define MY_TRANSPORT_WAIT_READY_MS 1
                  
                  #include <SPI.h>
                  #include <MySensors.h>
                   
                  MyMessage msgTest(2, V_LIGHT);
                  
                  void setup()  
                  { 
                    msgTest.setDestination(20);
                  }
                  
                  void presentation()
                  {
                    sendSketchInfo("Test", "1.0");
                  }
                  
                  void loop() 
                  {
                    Serial.println("send");
                    send(msgTest.set(false));
                    wait(3000);
                  } 
                  
                  AWIA Offline
                  AWIA Offline
                  AWI
                  Hero Member
                  wrote on last edited by AWI
                  #9

                  @Doomic I have compiled (a stripped version of) you sketch and it show the behaviour I would expect. i.e. it does not loop any more but gets going. Next thing is that it cannot send messages because it did not find any node in the network where it can register. For me that is certain as I purposely set #define MY_RF24_CHANNEL ... to a non used channel in my network.

                  You need a gateway with the same communicaton characteristics to get communication going....

                  1 Reply Last reply
                  0
                  • DoomicD Offline
                    DoomicD Offline
                    Doomic
                    wrote on last edited by Doomic
                    #10

                    A gateway you say..
                    There is a problem.. because the gateway is connected to my pc where the controller is running.
                    The Gateway is not always switched on.
                    That is the reason why i want to use node to node communication. Not depending on anther node (gateway) to work.

                    But why does it need a gateway?
                    Both nodes have a fixed id. Therefor there is nothing to register, is it?

                    The title should be: "Node to node communication with optional controller gateway"
                    Lets ask my question a litle bit different:

                    Is it posible to only have 2 standalone nrf24/arduino devices running the mysensors library to communicate with each other.
                    And if there is; what should the sketches look like?

                    AWIA 1 Reply Last reply
                    0
                    • DoomicD Doomic

                      A gateway you say..
                      There is a problem.. because the gateway is connected to my pc where the controller is running.
                      The Gateway is not always switched on.
                      That is the reason why i want to use node to node communication. Not depending on anther node (gateway) to work.

                      But why does it need a gateway?
                      Both nodes have a fixed id. Therefor there is nothing to register, is it?

                      The title should be: "Node to node communication with optional controller gateway"
                      Lets ask my question a litle bit different:

                      Is it posible to only have 2 standalone nrf24/arduino devices running the mysensors library to communicate with each other.
                      And if there is; what should the sketches look like?

                      AWIA Offline
                      AWIA Offline
                      AWI
                      Hero Member
                      wrote on last edited by AWI
                      #11

                      @Doomic A pretty similar discussion in this thread. Should give you some answers :abc:

                      1 Reply Last reply
                      0
                      • DoomicD Offline
                        DoomicD Offline
                        Doomic
                        wrote on last edited by
                        #12

                        i think i finally get it.
                        It is impossible... well the only way to let nodes communicate with each other is when a gateway is available (directly or trough other nodes) when the node is starting up.
                        This forum discussion is explaining me the most..

                        a solution may be.. transform the node that is always on to an gateway. And use antoher channel.. Sidenode; then you can't tell the controller what the status is.

                        Is there realy no way that this can supported? Node to node comunication without the need of an gateway inside the network? Skipping the registration and just send the message around.
                        perhaps i will dive into the source one day and change the registration behavior.

                        Thanks anyway for the help and the very fast responding.

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


                        17

                        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