Why a node installed from several days try find parent?


  • Hardware Contributor

    Hi to all,
    I'm using a RPI3 with Domoticz. Gateway is installed in Pi itself and I'm using version 2.2 RC2 (branch development).

    I have, in particular, a node that sleeps continuously and every 10 minutes send Temp, Hum and voltage level and resleep and so on.

    I have active security and signing and weak_security (this is my configure, to understand:

    ./configure --my-gateway=ethernet --my-transport=nrf24 --my-rf24-irq-pin=18 --my-rf24-channel=83 --my-leds-err-pin=12 --my-leds-rx-pin=11 --my-leds-tx-pin=7 --my-leds-blinking-inverse --my-signing=software --my-signing-request-signatures --my-signing-weak_security --my-signing-debug
    

    I did enable traffic led and noticed some red light.

    I did enable debug and this is the output:

    mysgw: TSF:MSG:SEND,0-0-23-23,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:18.7
    mysgw: TSF:MSG:READ,23-23-0,s=0,c=1,t=1,pt=7,l=5,sg=0:71.0
    mysgw: TSF:MSG:ACK REQ
    mysgw: SGN:SGN:NREQ=23
    mysgw: TSF:MSG:SEND,0-0-23-23,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:71.0
    mysgw: TSF:MSG:READ,23-23-0,s=2,c=1,t=38,pt=7,l=5,sg=0:2.70
    mysgw: TSF:MSG:READ,23-23-0,s=255,c=3,t=0,pt=1,l=1,sg=0:62
    mysgw: GWT:RFC:C=0,MSG=0;0;3;0;18;PING
    mysgw: GWT:RFC:C=0,MSG=0;0;3;0;18;PING
    mysgw: TSF:MSG:READ,51-51-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=51
    mysgw: TSF:PNG:SEND,TO=0
    mysgw: TSF:CKU:OK
    mysgw: TSF:MSG:GWL OK
    mysgw: SGN:SGN:NREQ=51
    mysgw: !TSF:MSG:SEND,0-0-51-51,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    mysgw: GWT:RFC:C=0,MSG=0;0;3;0;18;PING
    mysgw: TSF:MSG:READ,51-51-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=51
    mysgw: TSF:CKU:OK,FCTRL
    mysgw: TSF:MSG:GWL OK
    mysgw: SGN:SGN:NREQ=51
    mysgw: !TSF:MSG:SEND,0-0-51-51,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    mysgw: GWT:RFC:C=0,MSG=0;0;3;0;18;PING
    

    With the help of log parser, I got

    Sent Message
    Sender: 0
    Last Node: 0
    Next Node: 51
    Destination: 51
    Sensor Id: 255
    Command: INTERNAL
    Message Type:I_FIND_PARENT_RESPONSE
    Payload Type: P_BYTE
    Payload Length: 1
    Signing: 0
    Failed uplink counter: 0
    Status: NACK (OK=success, NACK=no radio ACK received)
    Payload: 0
    

    Now, in my knowledge, why gateway (node 0) try to find the parent (???) from node that at that moment is sleeping? Or I do not understand the working flow?

    This is also the relevant part of sketch transmitting to the gateway (the node has watchdog enabled):

    [...]
    void sendTemperatureToGateway(float temperature) {
    
      // if temperature is different from previous or we are other the max reads
      if (temperature != last_temperature || nNoUpdatesTemp == FORCE_UPDATE_N_READS) {
    
        last_temperature = temperature;
        // Reset no updates counter
        nNoUpdatesTemp = 0;
        // add the offset (if any
        temperature += SENSOR_TEMP_OFFSET;
        // send the msg
        // send(msgTemp.set(temperature, 1));
    
    
        bool transmission_was_ok = false;
        int i = 0;
        do {
      
          transmission_was_ok = send(msgTemp.set(temperature, 1) , true);
          i++;
          wait(150);
        
          if ( i > 30 ) {
          
            delay(5000); // this delay will call watchdog!
              
          }
            
        } while (transmission_was_ok == false);
    
    
        
        
      } else {
        // Increase no update counter if the temperature stayed the same
        nNoUpdatesTemp++;
      }
          
    }[...]
    

    Thank you very much!


  • Mod

    @sineverba

    TSF:MSG:READ,51-51-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    mysgw: TSF:MSG:BC
    mysgw: TSF:MSG:FPAR REQ,ID=51
    

    from the gateway log means that the gateway received a find parent request from node 51. So the gateway responds. That's what the gateway should do.

    You'll need the debug log from node 51 to see why node 51 wants to find its parent.


  • Hardware Contributor

    @mfalkvidd Thank you, I did not notice it. Is there a flag to set the ID parent static and not request it never? I imagine for lost signal (51 is placed not so near to the gateway).

    PS OT: I did not receive anymore the email of answer to my topic. I have email notification enabled and email are not neither in spam....


  • Mod

    @sineverba yes see https://www.mysensors.org/apidocs-beta/group__RoutingNodeSettingGrpPub.html

    I've asked hek to see if he can see anything in the email logs.


  • Hardware Contributor

    @mfalkvidd For email probably solved. I re-saved my option and now seems working.

    Thank you for the link. Sorry, I did not understand... I did see the link. Do I need to set both:

    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC
    

    Or only the second one (MY_PARENT_NODE_IS_STATIC) ? 'Cause I see for first one (MY_PARENT_NODE_ID ) default is AUTO, but I know that gateway is 0.

    Thank you very much


  • Mod

    @sineverba I think setting both is best.


  • Hardware Contributor

    @mfalkvidd I did introduce both on "difficult" node and after 24h NO NACK anymore.... Thank you very much!


  • Mod

    @sineverba great! Thanks for reporting back.


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts