Help with req id



  • Sensor log

    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    repeater started, id=255, parent=0, distance=1
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    

    Gateway log

    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    

    Somebodey can help me with getting sensor ID


  • Plugin Developer

    Hi!

    It looks as your current node sketch is set to request node id from the controller. Do you have a controller connected to the gateway that supports auto assigning node ids?

    If not, you can set a manual node id in the node sketch.

    See "Starting up the library" at http://www.mysensors.org/download/sensor_api_15#the-full-api.



  • I reed this manual 100 times but dont understand how to add sensor id manualy.

    Wich file have to change?? wich part of thiss file have to change???

    My controler haven't support or not set auto assigning node id



  • void begin(void (*_msgCallback)(const MyMessage &), uint8_t nodeId, boolean repeaterMode,uint8_t parentNodeId);

    you must set the 2nd parameter to the value you want (i.e 10).



  • 10X

    i fix this problem


  • Hardware Contributor

    Pretty much add this line to setup()
    gw.begin(NULL, 10);

    Null = Node doesnt accept any incoming messages
    10 = node id.



  • @sundberg84 where do I add this code? I'm having the same problem


  • Hardware Contributor

    You add it in setpu{}
    Change the gw.begin() to ge.begin(NULL, ID)



  • @sundberg84 sorry to be such a pain but I'm not understanding. Do I add that to the node sketch? When I do I get "null was not declared in this scope".

    Also looking at domoticz log is there a way to know for sure that domo and my gateway are communicating?

    Thanks in advance for your help!


  • Hardware Contributor

    Hi! Yes, in node sketch

    Example Binary Sketch: (1.5.X and below)

    #include <MySensor.h>
    #include <SPI.h>
    #include <Bounce2.h>
    
    #define CHILD_ID 3
    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
    
    MySensor gw;
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    
    void setup()  
    {  
      gw.begin(NULL, 5);
    
     // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
      
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(5);
      
      // Register binary input sensor to gw (they will be created as child devices)
      // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
      // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
      gw.present(CHILD_ID, S_DOOR);  
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
     
      if (value != oldValue) {
         // Send in the new value
         gw.send(msg.set(value==HIGH ? 1 : 0));
         oldValue = value;
      }
    } 
    

Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 2
  • 15
  • 2
  • 3

19
Online

11.2k
Users

11.1k
Topics

112.5k
Posts