Node to Node communication without gatway



  • Hello,
    I have two sensor nodes and I want to send data from one node to the other.
    But I want to use them in an environment where is no gateway available.
    I got the communication to work with the gateway.
    So I can send data from the first node to the second (which is configured as a repeater).
    But if I disconnect the gatway nothing works.
    How do I have to configure the two nodes so that they can talk directly with each other without a gateway?

    node one (sender):
    #define MY_NODE_ID 150
    #define CHILD_ID 0 // Id of the sensor child
    MyMessage msg(CHILD_ID, V_TEXT);
    void presentation()
    {
    sendSketchInfo("Liedanzeige_Sender", "1.0");
    present(CHILD_ID, S_INFO,"Lied",true);
    }

    send Data with : "send(msg.setSensor(CHILD_ID).setDestination(151).set("Test"),true);"

    node two (receiver):
    #define MY_REPEATER_FEATURE
    #define MY_NODE_ID 151
    #include <MySensors.h>
    #define CHILD_ID 0 // Id of the sensor child
    MyMessage msg(CHILD_ID, V_TEXT);
    void presentation()
    {
    sendSketchInfo("Liedanzeige_Empfang", "1.0");
    present(CHILD_ID, S_INFO, "Empfänger", true);
    }



  • @btmerz If the controller is not present, the nodes won't enter loop(). To avoid this, use (3000 may be changed)

    #define MY_TRANSPORT_WAIT_READY_MS 3000
    


  • Hi, meanwhile I was able to solve the problem.
    #define MY_PASSIVE_NODE did the trick.


 

282
Online

7.6k
Users

8.5k
Topics

91.1k
Posts