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. No controller, no gateway | passive node

No controller, no gateway | passive node

Scheduled Pinned Locked Moved Development
11 Posts 2 Posters 3.2k Views 2 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.
  • berkseoB Offline
    berkseoB Offline
    berkseo
    wrote on last edited by berkseo
    #1

    1

    bool state = true;
     
    #define MY_DEBUG
    
    #define MY_RADIO_NRF24
    
    #define MY_NODE_ID 101
    
    #define MY_PASSIVE_NODE
    
    #include <MySensors.h>
    
    #define BUTTON 1
    
    MyMessage msg(BUTTON,V_STATUS);
    
    void presentation()
    {
      present(BUTTON,  S_BINARY);
      sendSketchInfo("TEST BUTTON", "1.1");
    }
    
    void setup()
    {
      Serial.begin(115200);
    }
    
    void loop()
    {
    
    Serial.println(" SEND HELLO ");
    send(msg.setDestination(100).setSensor(1).set(state));
      delay(5000);  
    
    }
    
    void receive(const MyMessage &message) {
    
      if (message.type == V_STATUS) {
      Serial.println("Hello is delivered");
          }
    }
    

    2

    bool state = true;
     
    #define MY_DEBUG
    
    #define MY_RADIO_NRF24
    
    #define MY_NODE_ID 100
    
    #define MY_PASSIVE_NODE
    
    #include <MySensors.h>
    
    #define RELAY 1
    
    MyMessage msg(RELAY,V_STATUS);
    
    void presentation()
    {
      present(RELAY, S_BINARY);
      sendSketchInfo("TEST RELAY", "1.1");
    }
    
    void setup()
    {
      Serial.begin(115200);
    }
    
    void loop()
    {
    Serial.println(" SEND HELLO ");
    send(msg.setDestination(101).setSensor(1).set(state));
      delay(5000);  
    }
    
    void receive(const MyMessage &message) {
    
      if (message.type == V_STATUS) {
      Serial.println("Hello is delivered");
          }
    }
    
    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      So are you basically sending a message from one node to the other without gateway, right?

      1 Reply Last reply
      0
      • berkseoB Offline
        berkseoB Offline
        berkseo
        wrote on last edited by berkseo
        #3

        Yes, You are right. This is a simple example of sending and receiving messages between two nodes without the participation of the gateway.

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

          It is one way communication only? Like a garage door/gate 433mhz remote

          berkseoB 1 Reply Last reply
          0
          • gohanG gohan

            It is one way communication only? Like a garage door/gate 433mhz remote

            berkseoB Offline
            berkseoB Offline
            berkseo
            wrote on last edited by
            #5

            @gohan You can send and receive messages in both directions. It all depends on how it will be implemented in the sketch. You can use more than two nodes. I would use it in case of a gateway failure. This will preserve the basic functionality of the device. For example, a light switch that is physically divided into two nodes. On one node, the touch panel on the other relay node controls the light. There can be a lot of use cases.

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

              Could you please post the code for everyone?

              berkseoB 1 Reply Last reply
              1
              • gohanG gohan

                Could you please post the code for everyone?

                berkseoB Offline
                berkseoB Offline
                berkseo
                wrote on last edited by berkseo
                #7

                @gohan Of course, everything is simple there, uses one public function.

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

                  I know it is just to keep a reference here on the forum and for others less expert in programming that would like to see the actual code :wink:

                  berkseoB 1 Reply Last reply
                  0
                  • gohanG gohan

                    I know it is just to keep a reference here on the forum and for others less expert in programming that would like to see the actual code :wink:

                    berkseoB Offline
                    berkseoB Offline
                    berkseo
                    wrote on last edited by
                    #9

                    @gohan said in no controller, no gateway:

                    I know it is just to keep a reference here on the forum and for others less expert in programming that would like to see the actual code

                    ready, in the first post

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

                      you didn't put the "MY_PARENT_NO_ID 100" that I saw in the video: is it ok?

                      berkseoB 1 Reply Last reply
                      0
                      • gohanG gohan

                        you didn't put the "MY_PARENT_NO_ID 100" that I saw in the video: is it ok?

                        berkseoB Offline
                        berkseoB Offline
                        berkseo
                        wrote on last edited by berkseo
                        #11

                        @gohan said in no controller, no gateway:

                        you didn't put the "MY_PARENT_NO_ID 100" that I saw in the video: is it ok?

                        yes this is normal, this def is not needed. just forgot to delete when recording a video

                        two-way sending is done in the above application, this is also not in the video. you just asked about it earlier.

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


                        9

                        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