Infinite loop



  • Hello,
    I implemented a node with Arduino pro mini 3.3v with a RFM95w module. I used Mysensors PASSIVE node exemple.

    My problem is i have an infinite loop/reboot in my serial log. Do you have an idea why i'm having this issue ?

    __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.2
    
    16 MCO:BGN:INIT NODE,CP=RLNPA---,FQ=8,REL=255,VER=2.3.2
    28 TSM:INIT
    28 TSF:WUR:MS=0
    30 RFM95:INIT
    32 RFM95:INIT:PIN,CS=10,IQP=2,IQN=0
    47 RFM95:PTX:LEVEL=13
    49 TSM:INIT:TSP OK
    51 TSM:INIT:TSP PSM
    53 TSM:INIT:STATID=100
    55 TSF:SID:OK,ID=100
    57 TSM:FPAR
    59 TSM:FPAR:STATP=255
    61 TSM:ID
    61 TSM:ID:OK
    63 TSM:UPL:DISABLED
    65 TSM:READY:ID=100,PAR=255,DIS=1
    69 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0
    
    __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.2
    
    16 MCO:BGN:INIT NODE,CP=RLNPA---,FQ=8,REL=255,VER=2.3.2
    28 TSM:INIT
    28 TSF:WUR:MS=0
    30 RFM95:INIT
    32 RFM95:INIT:PIN,CS=10,IQP=2,IQN=0
    47 RFM95:PTX:LEVEL=13
    49 TSM:INIT:TSP OK
    51 TSM:INIT:TSP PSM
    53 TSM:INIT:STATID=100
    55 TSF:SID:OK,ID=100
    57 TSM:FPAR
    59 TSM:FPAR:STATP=255
    61 TSM:ID
    61 TSM:ID:OK
    63 TSM:UPL:DISABLED
    65 TSM:READY:ID=100,PAR=255,DIS=1
    69 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0
    
    __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.2
    
    16 MCO:BGN:INIT NODE,CP=RLNPA---,FQ=8,REL=255,VER=2.3.2
    28 TSM:INIT
    28 TSF:WUR:MS=0
    30 RFM95:INIT
    32 RFM95:INIT:PIN,CS=10,IQP=2,IQN=0
    47 RFM95:PTX:LEVEL=13
    49 TSM:INIT:TSP OK
    51 TSM:INIT:TSP PSM
    53 TSM:INIT:STATID=100
    55 TSF:SID:OK,ID=100
    57 TSM:FPAR
    59 TSM:FPAR:STATP=255
    61 TSM:ID
    61 TSM:ID:OK
    63 TSM:UPL:DISABLED
    65 TSM:READY:ID=100,PAR=255,DIS=1
    69 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0
    
    /*
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2019 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - tekka
     *
     * DESCRIPTION
     * Passive node example: This is a passive & independent reporting node
     *
     */
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable passive mode
    #define MY_PASSIVE_NODE
    
    // Passive mode requires static node ID
    #define MY_NODE_ID 100
    
    // Enable and select radio type attached
    //#define MY_RADIO_RF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    #define MY_RADIO_RFM95
    
    #define   MY_DEBUG_VERBOSE_RFM95
    #define MY_RFM95_FREQUENCY  (RFM95_868MHZ)
    
    #include <MySensors.h>
    
    #define CHILD_ID 0   // Id of the sensor child
    
    // Initialize general message
    MyMessage msg(CHILD_ID, V_TEMP);
    
    void setup()
    {
    }
    
    void presentation()
    {
    	// Send the sketch version information to the gateway and controller
    	sendSketchInfo("Passive node", "1.0");
    
    	// Register all sensors to gw (they will be created as child devices)
    	present(CHILD_ID, S_TEMP);
    }
    
    void loop()
    {
    	// generate some random data
    	send(msg.set(25.0+random(0,30)/10.0,2));
    	sleep(2000);
    }
    

  • Mod

    @Fumée-Bleue could very well be a power issue, because as soon as you try to send the node seems to restart. How do you power everything?



  • @Yveaux. good idea, yes the power supply is a bit special. It's une AC power 6v limited at 130mW. I used a Graetz rectifier and LDO 3,3v regulator. In fact, i have a similar project with NRF24L01 without issue. I think rfm95w consumes more energy than nrf241L01.
    2.png
    For you, what is the best way to solve my problem ? Perhaps a super capacitor ?


  • Mod

    @Fumée-Bleue I would start by running your exact same software powered by a different power supply, preferably a lab supply supplying suffient current (look up the power requirements of RFM95 in Tx mode). That way you can rule out software.
    Next, just adding a large capacitor to your current supply might suffice, when you only incidentally send using the RFM95. A super cap can also work, but requires more components/is more expensive. Either do the calculation (always better), or experiment with some caps.



  • @Yveaux, I tried with an laboratoy power supply with the RMF95w and NRF24L01, and the same code.

    Test with RMF95w :

    • laboratery power supply : OK
    • 130mW power supply : KO

    Test with NRF24L01+ :

    • laboratery power supply : OK
    • 130mW power supply : OK

    The consumption is the same in the two tests : 38mA max, 10mA mean, 4mA min.
    In fact I would like to understand why the arduino restarts, is there a watchdog in the Mysensors library to monitor the supply voltage?

    PS : I also tried with a larger capacitor without success.


  • Mod

    @Fumée-Bleue there is no watchdag. Giving the components power outside the specifications will result in undefined behavior for that component. Underined can in some cases mean restart. In some cases we've seen continuous radio brodcast (blocking all other nodes). Undefined means anything can happen.


  • Mod

    @Fumée-Bleue likely the brown-out detector from the atmega detects a low voltage. This mechanism protects the atmega from undefined behavior by resetting it.



  • thank you for this additional information.

    Tristan


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 2
  • 6

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts