NODE NOT REG - Node not registered?



  • I've seen this pattern on a few of my nodes.

    I will present the sketch and everything seems to be going ok at first. But as soon as I start presenting children I get "NODE NOT REG".

    The delay between radio sends is already at 400 milliseconds. Giving the radio some breathing space usually solves any issues I have.

    What is 'node registration'? I had a look in the MySensors code. Does this mean the node needs to get an ID from the controller first?

    // Looking at it further, I suspect there's something wrong with the send command.

    I tried changing this:

    send(buttonmsg.setSensor(replayableID).set( loadState(replayableID) )); wait(RADIO_DELAY);
    

    To this:

        boolean state = loadState(replayableID);
        send(buttonmsg.setSensor(replayableID).set( state?false:true )); wait(RADIO_DELAY); // Tell the controller in what state the lock is.
    
    

    But no luck.

    Then I tried moving the send() commands out of the presentation function. Perhaps it only allows presentation commands. But no luck there either.

    25 TSM:INIT
    31 TSF:WUR:MS=10000
    38 TSM:INIT:TSP OK
    40 TSF:SID:OK,ID=5
    43 TSM:FPAR
    78 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    141 TSF:MSG:READ,4-4-5,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    146 TSF:MSG:FPAR OK,ID=4,D=2
    571 TSF:MSG:READ,0-0-5,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    575 TSF:MSG:FPAR OK,ID=0,D=1
    2085 TSM:FPAR:OK
    2086 TSM:ID
    2087 TSM:ID:OK
    2089 TSM:UPL
    2126 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    2132 TSF:MSG:READ,0-0-5,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2138 TSF:MSG:PONG RECV,HP=1
    2141 TSM:UPL:OK
    2142 TSM:READY:ID=5,PAR=0,DIS=1
    2147 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2153 TSF:MSG:READ,0-0-5,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2160 TSF:MSG:SEND,5-5-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
    2168 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    2179 TSF:MSG:READ,0-0-5,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    PRESENTATION
    2186 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=11,pt=0,l=10,sg=0,ft=0,st=OK:Signal Hub
    2195 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
    2604 TSF:MSG:SEND,5-5-0-0,s=1,c=0,t=36,pt=0,l=13,sg=0,ft=0,st=OK:Device status
    Detectable child ID 10
    3414 TSF:MSG:SEND,5-5-0-0,s=10,c=0,t=0,pt=0,l=10,sg=0,ft=0,st=OK:Detected 1
    recog loadState at presentation: 0
    3821 !MCO:SND:NODE NOT REG
    Detectable child ID 11
    4228 TSF:MSG:SEND,5-5-0-0,s=11,c=0,t=0,pt=0,l=10,sg=0,ft=0,st=OK:Detected 2
    recog loadState at presentation: 0
    4635 !MCO:SND:NODE NOT REG
    Detectable child ID 12
    5042 TSF:MSG:SEND,5-5-0-0,s=12,c=0,t=0,pt=0,l=10,sg=0,ft=0,st=OK:Detected 3
    recog loadState at presentation: 0
    5449 !MCO:SND:NODE NOT REG
    


  • @alowhum
    Could you post the code for the node please?



  • The entire node is quite huge. But here's the relevant parts.

    I am now looking into the progmem char array.

    
    PROGMEM const char detectedMessage[] = { "Detected  " }; // This construction saves some memory.
    PROGMEM const char replayMessage[]   = { "Replay    " }; // This construction saves some memory.
    
    boolean resend_button_states = 1;
    
    
    void presentation()
    { 
    
      Serial.println(F("PRESENTATION"));
      
      sendSketchInfo(F("Signal Hub"), F("1.1"), 1); wait(RADIO_DELAY); // Child 0. Sends the sketch version information to the gateway and Controller
      present(DEVICE_STATUS_ID, S_INFO, F("Device status")); wait(RADIO_DELAY); // Child 1. This outputs general status details.
      send(textmsg.setSensor(DEVICE_STATUS_ID).set( F("Hi") )); wait(RADIO_DELAY);
      
      //present(LISTENER_OUTPUT_ID, S_INFO, F("Detected codes")); wait(RADIO_DELAY); // Child 2. This outputs the ID of detected signals that were matched to signals in eeprom.
    #if !(defined(HAS_TOUCH_SCREEN))
      present(LEARN_SIMPLE_BTN_ID, S_BINARY, F("Recognise a single code")); wait(RADIO_DELAY);// Child 3
      present(LEARN_ON_OFF_BTN_ID, S_BINARY, F("Recognise an ON+OFF code")); wait(RADIO_DELAY); // Child 4
      present(COPYING_SIMPLE_BTN_ID, S_BINARY, F("Copy a single code")); wait(RADIO_DELAY); // Child 5
      present(COPYING_ON_OFF_BTN_ID, S_BINARY, F("Copy an ON/OFF code")); wait(RADIO_DELAY); // Child 6
    #endif
    
      char childNameMessage[11];
      strcpy_P(childNameMessage, detectedMessage);
      
      // We loop over all the detect-only signals, and present them to the controller. Their Child ID's are between 10 and 99.
      for( byte recognisedID=10; recognisedID < 10 + (amountOfStoredSignals - amountOfStoredReplayableSignals); recognisedID++ ){
        Serial.print(F("Detectable child ID ")); Serial.println(recognisedID);
        childNameMessage[9] = recognisedID + 39; // (recognisedID - 10) + 49;
        present(recognisedID, S_DOOR, childNameMessage); wait(RADIO_DELAY);
      }
    
      wait(RADIO_DELAY);
    
      strcpy_P(childNameMessage, replayMessage);
      // We loop over all the replayable signals, and present them to the controller. Their child ID's are between 100 and 200.
      for( byte replayableID=100; replayableID < 100 + amountOfStoredReplayableSignals; replayableID++ ){
        Serial.print(F("Replayable child ID ")); Serial.println(replayableID);
        childNameMessage[7] = (replayableID - 100) + 49;
        present(replayableID, S_BINARY, childNameMessage); wait(RADIO_DELAY);
      }
    
      resend_button_states = 1;
    }
    
    
    
    void send_all_button_states(){
    
      Serial.println(F("Sending button states"));
      
      // We loop over all the replayable signals, and send their values.
      for( byte replayableID=10; replayableID < 10 + amountOfStoredReplayableSignals; replayableID++ ){
        Serial.print(F("replay loadState at presentation: ")); Serial.println(loadState(replayableID));
        if( loadState(replayableID) > 1 ){ saveState(replayableID, 0); }
        boolean state = loadState(replayableID);
        send(buttonmsg.setSensor(replayableID).set( state?false:true )); wait(RADIO_DELAY); // Tell the controller in what state the child is.
      }
    
      wait(RADIO_DELAY);
    
      // We loop over all the detect-only signals, and send their values.
      for( byte recognisedID=100; recognisedID < 100 + (amountOfStoredSignals - amountOfStoredReplayableSignals); recognisedID++ ){
        send(detectmsg.setSensor(recognisedID).set( 0 )); wait(RADIO_DELAY); // Tell the controller in what state the child is.
      }
    
    void loop()
    {
        if( resend_button_states ){
          resend_button_states = 0;
          send_all_button_states();
        }
    
    }
    
    


  • I removed the last send() message from the presentation function, and now it seems to work.

    Apparently the presentation function only eats presentation messages. Better put: it seems like after that function is done, MySensors sends a "register" command, and only after that can you then send updates for the children to it.



  • That is my conclusion as well!


 

280
Online

8.4k
Users

9.3k
Topics

97.9k
Posts