Node wake up from sleep too early



  • Hi,
    I'm on my 16th node with mysensors (2.2.0) library and first time with this kind of issue. I have a sensor on Arduino Nano and in order to save battery, as usual, I use the sleep function:

    sleep(sleep_seconds_between_measures);
    

    the variable value is 900000. The problem is, the node wake ups too early, the debug is:

    Sleep for seconds: 900000
    1116278 MCO:SLP:MS=900000,SMS=0,I1=255,M1=255,I2=255,M2=255
    1116288 TSF:TDI:TSL
    1116399 MCO:SLP:WUP=-1
    1116401 TSF:TRI:TSB
    

    so according to the log parser, values are correct and the node wakes up by the timer interrupt (1116399 MCO:SLP:WUP=-1), but it happens straight away after the sleep command.

    Any clue? Can be any flag that should be reset used by the timer?

    Thank you for your help.


    Log in to reply
     


  • @mortommy

    1. What type of unit is "sleep_seconds_between_measures"?
    2. Post the full code!
    3. Did you select the right type and clock speed when flashing the nano?
    4. 2.2.0 is an older version, current is 2.3.2, I suggest upgrade of all nodes and gateways to this latest standard.

Log in to reply
 

1 out of 2

Suggested Topics


  • Announcements   24 Mar 2014, 20:12

    3

  • Troubleshooting   3 Sept 2024, 08:58

    2
  • 2

  • Troubleshooting   24 days ago

    12

  • Troubleshooting   26 Feb 2025, 06:22

    3

  • Troubleshooting   3 Mar 2025, 01:00

    13

0
Online

11.5k
Users

11.1k
Topics

112.8k
Posts