OTA FW on Repeater Nodes???


  • Hero Member

    Hello everyone,

    I recently enabled repeater function in one of my nodes, and now when I try to update its firmware OTA with MYSController, instead the regular FW update messages, I get thousands of this:

    Captura de tela 2015-10-27 14.02.02.png

    Captura de tela 2015-10-27 14.05.58.png

    The GW is on latest 1.5 master branch version.

    The repeater node is also on 1.5, but a bit lower (I installed it ~4 month ago I think)
    Captura de tela 2015-10-27 14.07.14.png

    I'm using latest 0.1.2.282 MYSController.

    Any ideia about what can be wrong? I rebooted the node after 20k+ messages, it started normally and is responding fine, tough it still not up-to-date.

    I'm sure I was able to OTA-update it before switching repeater ON...

    Help!



  • Hm... can you paste the relevant parts from your sketch?
    And probably the messages send from MYSController right before the messages would help.


  • Hero Member

    @Oitzu , sure,

    It started like that:

    10/27/2015 14:31:18 INFO FW "myMultiSensor" assigned to node 9
    10/27/2015 14:31:21 TX 9;0;3;0;13;0
    10/27/2015 14:31:21 RX 0;0;3;0;9;send: 0-0-9-9 s=0,c=3,t=13,pt=0,l=1,sg=0,st=ok:0
    10/27/2015 14:31:21 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:21 CHILD New child discovered, node id=9, child id=internal

    ... and then gets into the endless loop:

    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY

    And here's my sketch (the one current in node is a bit different, but not significant):

    #include <MySensor.h>
    #include <SPI.h>
    #include <DHT.h>
    #include <IRLib.h>
     
    //  IO PINS
    #define MOTION 4  // The digital input you attached your motion sensor. 
    #define IR_LED 3  // Infrared LED output 
    #define DHT11  2  // Temp/Hum sensor 
    #define LDR    A0 // LDR (Light sensor) - Pull-down of 10K to GND
    
    //  Interval between reads (Temp/Hum/Light) 
    #define INTERVAL  720000  // 720s = 12min 
    
    MySensor gw;
    DHT dht ;
    IRsend ir;
    
    // Initialize messages
    MyMessage msg_motion( 1, V_TRIPPED );
    MyMessage msg_Hum( 2, V_HUM );
    MyMessage msg_Temp( 3, V_TEMP) ;
    MyMessage msg_light( 5, V_LIGHT_LEVEL ); 
     
    boolean metric = true;
    boolean lastMotion = false;
    float   temp , hum ; 
    int     lightLevel ; 
    
    unsigned long lastRun ; 
    
    void setup()
    {
      Serial.begin(115200);
      Serial.println("Device Init..."); 
      
      // Init sensors  
      pinMode( MOTION , INPUT );
      dht.setup( DHT11 ); 
    
      // Init mySensors
      Serial.println("mySensor start..."); 
      gw.begin( incomingMessage );  //  , AUTO , true );  // Repeater mode  
      
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("myMultiSensor", "1.2");
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present( 1 , S_MOTION ); 
      gw.present( 2 , S_HUM );
      gw.present( 3 , S_TEMP );
      gw.present( 4 , S_SCENE_CONTROLLER ); 
      gw.present( 5 , S_LIGHT_LEVEL ); 
    
      metric = gw.getConfig().isMetric;
      lastRun = 0;
      
    }
    
    void loop()
    {
    
      // mySensors Radio handling
      gw.process(); 
      
      // Temp/Hum
      if ( lastRun == 0 || ( millis() - lastRun ) > INTERVAL )  { 
    
        ////// Check Temperature
        delay(dht.getMinimumSamplingPeriod());
    
        temp = dht.getTemperature();
        
        if (!metric) temp = dht.toFahrenheit(temp);
        
        gw.send(msg_Temp.set( temp , 0 ) , true );
        Serial.print("T: ");
        Serial.println( temp , 0 );
        
        ////// Check Humidty 
        delay(dht.getMinimumSamplingPeriod());
    
        hum  = dht.getHumidity();
        
        gw.send(msg_Hum.set( hum , 0 ) , true );
        Serial.print("H: ");
        Serial.println( hum , 1 );
      
        if (isnan( temp ) || isnan( hum ) ) 
        {
           Serial.println("Failed to read from DHT");
        } 
    
        ////// Check Light Level 
        lightLevel = map( analogRead( LDR ) , 0 , 1023 , 0, 100 ) ; 
        gw.send( msg_light.set( lightLevel ) , true ); 
        Serial.print("L: "); 
        Serial.println( lightLevel ); 
        
        lastRun = millis();
    
      }
    
      /////     Motion
      if ( digitalRead( MOTION ) != lastMotion ) { 
        gw.send(msg_motion.set( lastMotion? "0" : "1" ) , true ); // Send tripped value to gw
        Serial.print("M: "); 
        Serial.println( lastMotion? "0" : "1" );  
        lastMotion = !lastMotion; 
      } 
    
    
    }
    
    ///////////// Scene controller (IR) 
    void incomingMessage( const MyMessage &message) {
      
      // SCENE ON   (Note: SCENE OFF is not supported by compactwall) 
      if ( message.type == V_SCENE_ON ) {
        
        //  Retrieve the scene number
        int scene = atoi( message.data );  
     
        Serial.print( "Scene " );
        Serial.print( scene ); 
        Serial.println( " ON" ) ; 
        
        // Send comand to scenario compactwall module via Infrared LED
        long ir_command = 0x1380 + scene; 
        ir.send( RC5 , ir_command , 32 );
     
        }
        
        
    }
    
    

    Thanks a lot!



  • I really can not see why the node keeps rebooting over and over.
    Maybe enable Serial debug directly on the node?


  • Hero Member

    @Oitzu said:

    I really can not see why the node keeps rebooting over and over.
    Maybe enable Serial debug directly on the node?

    That will be my last try, after I return from a trip (in two weeks). Thanks anyway!



  • After reading the code i maybe have an theorie about your issue.
    The reboot is done with a watchdog timer. The watchdog timer will not unset itself, but is unset after the reboot.
    Using OTA and Relay will probably that much startup time that the watchdog timer will trigger again before it is unset.



  • If you still have access to the node you could try to add wdt_reset(); in the beginning of the setup function.


  • Hero Member

    @Oitzu , sure I will try it, but only in two weeks. Thanks for the hint!


  • Admin

    @rvendrame said:

    Hello everyone,

    I recently enabled repeater function in one of my nodes, and now when I try to update its firmware OTA with MYSController, instead the regular FW update messages, I get thousands of this:

    Which board / bootloader? Sensebender or regular Arduino with MYSBootloader?


  • Hero Member

    @tekka , regular Arduino (pro-mini clone) with MYSBootloader.


  • Admin

    @rvendrame can you upload the MYSController log?


  • Hero Member

    @tekka , the begin of log is like that:

    10/27/2015 14:31:18 INFO FW "myMultiSensor" assigned to node 9
    10/27/2015 14:31:21 TX 9;0;3;0;13;0
    10/27/2015 14:31:21 RX 0;0;3;0;9;send: 0-0-9-9 s=0,c=3,t=13,pt=0,l=1,sg=0,st=ok:0
    10/27/2015 14:31:21 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:21 CHILD New child discovered, node id=9, child id=internal
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5

    ... and from here on, thousands of repetitions of same messages. It only stops by turning off the power of the node.

    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:18 INFO FW "myMultiSensor" assigned to node 9
    10/27/2015 14:31:21 TX 9;0;3;0;13;0
    10/27/2015 14:31:21 RX 0;0;3;0;9;send: 0-0-9-9 s=0,c=3,t=13,pt=0,l=1,sg=0,st=ok:0
    10/27/2015 14:31:21 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:21 CHILD New child discovered, node id=9, child id=internal
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY
    10/27/2015 14:31:22 RX 9;255;0;0;18;1.5
    10/27/2015 14:31:22 RX 0;0;3;0;9;read: 9-9-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
    10/27/2015 14:31:22 DEBUG Update child id=255, type=ARDUINO_RELAY


  • Admin

    @rvendrame the node does not seem to reboot upon initiation of the OTA update (bootloader signal is missing). Can you post the rx log when you power-cycle the node?


  • Hero Member

    @tekka , I'm currently traveling so only in two weeks from now. I posted the 'Info' from the node at first post, maybe it helps some how? Bootloader is 'N/A' there, could be something in there?

    Captura de tela 2015-10-27 14.07.14.png


  • Admin

    @rvendrame ok, let's wait until your return.


  • Hero Member

    @tekka , @Oitzu , I finally managed to have some time for this.

    This is the serial monitor output from the node, as soon as I request the FW update via MYSController (it is a endless loop):

    read: 0-0-9 s=0,c=3,t=13,pt=0,l=1,sg=0:0
    Device Init...
    ��Sensor start...
    send: 9-9-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5
    Device Init...
    ��Sensor start...
    send: 9-9-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5
    Device Init...
    

    And I tried to upload the new FW via FTDI adapter (in order to test with the repeater function off), however I got an error from avrdude (maybe my pro mini is broken somehow?)

    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/i007897/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
             Using Port                    : /dev/cu.usbserial-A50285BI
             Using Programmer              : arduino
             Overriding Baud Rate          : 57600
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xbe
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xbe
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xf2
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe6
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x52
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x9f
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe5
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xd2
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x43
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xd7
    
    avrdude done.  Thank you.
    

    Thanks!



  • @rvendrame the mysbootloader doesn't support serial upload.
    Use an ISP to upload a new sketch.


  • Admin

    @rvendrame This issue does not seem to be related to MYSBootloader since the log does not show bootloader messages. However, your node seems re-initializing (but not rebooting) over and over. Try changing the hardware (MCU & nRF) and update to the latest (non-dev branch) framework for further testing.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.