SerialGateway is rebooting on relay.



  • Hi.

    Maybe someone has an idea.

    My setup is: Node6 and Node7, and a SerialGateway.
    When all 3 devices are ON, I can fine transmit from Node6 to Node7, via the SerialGateway.
    On Node 6, I use the command: send(msg.setDestination(7).set(value==HIGH)

    It all works fine.... but if I turn off Node7, then the SerialGateway, is restarting/resetting each time it tryes to reach Node7 (!TSF:MSG:SEND,6.0.7.7,s=3,c=1,t=16.pt=1,1=1,sg=0,ft=0,st=NACK:1)

    How can I prevent the SerialGateway, from doing a reset, when it can't reach a Node, that it is trying to relay to ?

    Btw: I'm using the last 2.0.1-beta develop build, from last night.



  • Hmm. I can see, it at general problem, when sending a message from one Node to another Node (that is turned OFF), via a SerialGateway, that the SerialGateway is making a Reset/reinitialyzation (Gateway startup complete), upone tryning to relay/delivery the message to the Node, that now is turned OFF.

    Node(ID 6) -> SerialGateway -> Node(ID 7 and turned OFF).

    Using setDestination(7) on Node(ID 6).

    Error on the SerialGateway, just before it restarts (!TSF:MSG:SEND,6.0.7.7,s=3,c=1,t=16.pt=1,1=1,sg=0,ft=0,st=NACK:1)


  • Admin

    Do you have any capacitor mounted on the gateway radio?

    The radio will send a burst of messages (when no ack is received) which could result in power drop (resetting the arduino) if the radio isn't decoupled correctly.



  • @hek
    Yes. 100uF and a 10nF (parallel) on all Radio's.
    I see no problem, when I send from Node(ID 6) to the SerialGateway.
    And I see no problem when I send from Node(ID 6) via the SerialGateway to Node(ID 7).

    The SerialGateway reboot's, if I turn OFF Node(ID 7) and the SerialGateway can't send to it.


  • Admin

    @delinend Can you provide a full debug log of all involved nodes for both scenarios? This would help to investigate the issue further. Also, please indicate AVR board def version.



  • @tekka
    Sure.. AVR Boards version 1.6.14

    Here the SerialGateway:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.0.1-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.0.1-beta
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    0;255;3;0;9;TSF:MSG:READ,6-6-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=6
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:PINGED,ID=6,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    0;255;3;0;9;TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.0.1-beta
    6;255;0;0;17;2.0.1-beta
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    6;255;3;0;6;0
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=11,pt=0,l=13,sg=0:Binary Sensor
    6;255;3;0;11;Binary Sensor
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    6;255;3;0;12;1.0
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=3,c=0,t=0,pt=0,l=0,sg=0:
    6;3;0;0;0;
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=3,c=1,t=16,pt=1,l=1,sg=0:1
    6;3;1;0;16;1
    0;255;3;0;9;TSF:MSG:READ,6-6-7,s=3,c=1,t=16,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:REL MSG
    0;255;3;0;9;!TSF:MSG:SEND,6-0-7-7,s=3,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=NACK:1
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.0.1-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.0.1-beta
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    

    Here Node(ID 6) that sends data to the SerialGateway, and Node(ID 7). The Node(ID 7) is turned OFF.:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.0.1-beta
    4 TSM:INIT
    10 TSM:INIT:TSP OK
    12 TSM:INIT:STATID=6
    14 TSF:SID:OK,ID=6
    16 TSM:FPAR
    53 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    137 TSF:MSG:READ,0-0-6,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    143 TSF:MSG:FPAR OK,ID=0,D=1
    2062 TSM:FPAR:OK
    2062 TSM:ID
    2064 TSM:ID:OK
    2066 TSM:UPL
    2070 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2088 TSF:MSG:READ,0-0-6,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2095 TSF:MSG:PONG RECV,HP=1
    2099 TSM:UPL:OK
    2101 TSM:READY
    2103 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2113 TSF:MSG:SEND,6-6-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    2123 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    2131 TSF:MSG:READ,0-0-6,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    4134 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=OK:Binary Sensor
    4145 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    4153 TSF:MSG:SEND,6-6-0-0,s=3,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    4161 MCO:REG:REQ
    4165 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4175 TSF:MSG:READ,0-0-6,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4182 MCO:PIM:NODE REG=1
    4184 MCO:BGN:STP
    4186 MCO:BGN:INIT OK,ID=6,PAR=0,DIS=1,REG=1
    4190 MCO:SLP:MS=5,SMS=0,I1=255,M1=255,I2=255,M2=255
    4196 MCO:SLP:TPD
    4198 MCO:SLP:WUP=-1
    4202 TSF:MSG:SEND,6-6-0-0,s=3,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
    4210 TSF:MSG:SEND,6-6-0-7,s=3,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
    4218 MCO:SLP:MS=0,SMS=0,I1=0,M1=1,I2=255,M2=255
    4222 MCO:SLP:TPD
    

    Btw. I have tryed to set all radio's to MIN power. But same result. If I turn ON Node(ID 7), everything works fine.


  • Admin

    @delinend Ok, could you also enable MY_DEBUG_VERBOSE_RF24 in your GW, I need to see how far the message goes in the RF24 driver - I suspect a power issue.



  • @tekka
    Hmm.. That is ode..
    If I enable the MY_DEBUG_VERBOSE_RF24, the SerialGateway is NOT rebooting ?!?!

    Here a snip from the LOG:

    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=16
    0;255;3;0;9;RF24:read message, len=8
    0;255;3;0;9;RF24:write register, reg=7, value=64
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=3,c=1,t=16,pt=1,l=1,sg=0:1
    6;3;1;0;16;1
    0;255;3;0;9;RF24:read register, reg=23, value=16
    0;255;3;0;9;RF24:read message, len=8
    0;255;3;0;9;RF24:write register, reg=7, value=64
    0;255;3;0;9;TSF:MSG:READ,6-6-7,s=3,c=1,t=16,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:REL MSG
    0;255;3;0;9;RF24:stop listening
    0;255;3;0;9;RF24:write register, reg=0, value=14
    0;255;3;0;9;RF24:open writing pipe, recipient=7
    0;255;3;0;9;RF24:write register, reg=10, value=7
    0;255;3;0;9;RF24:write register, reg=16, value=7
    0;255;3;0;9;RF24:send message to 7, len=8
    0;255;3;0;9;RF24:flushTX
    0;255;3;0;9;RF24:write register, reg=7, value=48
    0;255;3;0;9;RF24:MAX_RT
    0;255;3;0;9;RF24:flushTX
    0;255;3;0;9;RF24:start listening
    0;255;3;0;9;RF24:write register, reg=0, value=15
    0;255;3;0;9;RF24:write register, reg=10, value=0
    0;255;3;0;9;!TSF:MSG:SEND,6-0-7-7,s=3,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=NACK:1
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17
    0;255;3;0;9;RF24:read register, reg=23, value=17```

  • Admin

    @delinend weird indeed. If you disable all debugs, how does it behave then?



  • @tekka
    Her my codes...

    Node(ID 6):

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    #define MY_NODE_ID 6
    //#define MY_DEFAULT_ERR_LED_PIN 4
    #define MY_RF24_CHANNEL 101
    #define MY_RF24_DATARATE RF24_250KBPS
    #define MY_RF24_PA_LEVEL RF24_PA_MIN
    
    //#define MY_PARENT_NODE_ID 0
    //#define MY_TRANSPORT_DONT_CARE_MODE
    
    #include <MySensors.h>
    
    #define SKETCH_NAME "Binary Sensor"
    #define SKETCH_MAJOR_VER "1"
    #define SKETCH_MINOR_VER "0"
    
    #define PRIMARY_CHILD_ID 3
    
    
    #define PRIMARY_BUTTON_PIN 2   // Arduino Digital I/O pin for button/reed switch
    
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED);
    
    
    void setup()
    {
      // Setup the buttons
      pinMode(PRIMARY_BUTTON_PIN, INPUT);
    
    }
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER "." SKETCH_MINOR_VER);
    
      // Register binary input sensor to sensor_node (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.
      present(PRIMARY_CHILD_ID, S_DOOR);
    
    }
    
    // Loop will iterate on changes on the BUTTON_PINs
    void loop()
    {
      uint8_t value;
      static uint8_t sentValue=2;
      //static uint8_t sentValue2=2;
    
      // Short delay to allow buttons to properly settle
      sleep(5);
    
      value = digitalRead(PRIMARY_BUTTON_PIN);
    
      if (value != sentValue) {
         // Value has changed from last transmission, send the updated value
         send(msg.setDestination(0).set(value==HIGH));
         send(msg.setDestination(7).set(value==HIGH));
         
         sentValue = value;
      }
    
    
    
      // Sleep until something happens with the sensor
      sleep(PRIMARY_BUTTON_PIN-2, CHANGE, 0);
    }
    

    Here the SerialGateway code:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    //#define MY_DEBUG_VERBOSE_RF24
    
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    #define MY_RF24_CHANNEL 101
    #define MY_RF24_DATARATE RF24_250KBPS
    #define MY_RF24_PA_LEVEL RF24_PA_MIN
    
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    //#define MY_BAUD_RATE 38400
    #endif
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    
    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
    
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
    
    #include <MySensors.h>
    
    void setup() {
      // Setup locally attached sensors
    }
    
    void presentation() {
     // Present locally attached sensors
     
    }
    
    void loop() {
      delay(1);
    }
    
    void receive(const MyMessage &message) {
    }
    
    


  • @tekka
    And yes... If I remove the MY_DEBUG, it do NOT reboot !?!

    So the SerialGateway reboot only, when I use the #define MY_DEBUG

    Strange 😞


  • Admin

    @delinend Yeah, and I assume if you downgrade your AVR board defs to 1.6.11 or .12, everything is fine?



  • @tekka
    Hmmm Strange. It work fine with 1.6.11 ?!?

    Why is there errors with 1.6.14 - 1.6.13 and 1.6.12 ?


 

514
Online

7.9k
Users

8.8k
Topics

94.2k
Posts