DeepSleep Still Randomly Ending

  • Re: Deepsleep randomly ends

    Ok, so I posted this abound 2 weeks ago and am getting no where - it occurs across 4 SiPys I have. I really hope someone can help. But I do have a few more details.

    Basically I have the latest version of SiPy firmware installed and Deepsleep shields connected to a expansion board. Its not an issue on the expansion board because I have my own developed circuit board/breadboard and its doing the same thing on that too. I am using the latest release of the module as well.

    I have the code delivering a Sigfox message every 30mins. I am getting the following delivery times (these align with reboot timing of the device):

    2017-12-07 16:23:56
    2017-12-07 15:50:11
    2017-12-07 15:45:13
    2017-12-07 15:16:13
    2017-12-07 14:44:26
    2017-12-07 14:12:40
    2017-12-07 13:45:40
    2017-12-07 13:18:38
    2017-12-07 12:58:14
    2017-12-07 12:42:37
    2017-12-07 12:18:22
    2017-12-07 12:15:22
    2017-12-07 11:42:35
    2017-12-07 11:38:19
    2017-12-07 11:14:48
    2017-12-07 10:48:30
    2017-12-07 10:20:52
    2017-12-07 10:01:53

    As you can see, this is wildly out, consistently. Please note, that this ONLY occurs when the expansion board is powered by a LiPo. When the device is powered by USB it works perfectly and the timing is spot on and as expected.

    I cant check the reason because the device (again only on battery) comes up with the following:

    Traceback (most recent call last):
    File "", line 7, in <module>
    File "/flash/lib/", line 143, in get_wake_status
    File "/flash/lib/", line 76, in peek
    IndexError: bytes index out of range

    Again, on USB power, this error never comes up!

    Im at a real loss here, and I have no idea how to resolve. I have done the following to turn off a wake on pins from deepsleep in the hope it helps, but it doesnt:

    ds = DeepSleep()
    ds.enable_pullups(['P17', 'P18'])
    ds.disable_wake_on_fall(['P17', 'P18'])
    ds.disable_wake_on_raise(['P17', 'P18'])

    Any help anyone can give would be really appreciated. Has anyone experienced this before?! The only thing I havent done is downgrade the firmware, but I didnt think I would have to do that?


  • @bradnz Exactly which version of did you use? There are many commits which mention version 1.0.0 for this file.

    I am trying your solution, but it's not working for me on LoPy.

  • For any one interested, or has this issue in the future I have resolved this by doing the following:

    Rolled back firmware to 1.7.9.b3
    Used version 1.0.0 of the file from github.

    Works fine now.

  • @livius Hi. Thanks for your suggestions. To answer your questions:

    1. To confirm I have the right file, I downloaded again and reapplied. Same result, being that the awake from deepsleep is really inconsistent.
    2. Yes this is the firmware version I am using.
    3. I have tried this and it hasnt helped.
    4. I have downloaded to the avaliable versions accessible via pycoms site and this doesnt even send a signal. The devices says its sent it, but its never recieved in the backend of sigfoxs network. I have disengaged the sequence number as I have been shown before if this happens, but this doesnt help unfortunately!

    I have been able to establish that the wake reason is 16, which from what I can tell is a timer wake, so this tells me something isnt right with the timer. If I connect this to the expansion board powered by USB the timer is perfect and it sends at the right time (95% of the time). If I connect via Lipo though, its all out and completely wrong. Im really confused, and need help. If anyone can guide me in the right direction it would be appreciated. This is, unfortunately, blocking y project and I cant progress without resolving this!

    Thanks in advance.

  • @livius Hi, and thanks for your responses.

    I have finally been able to get this to remove the error, and have the following output on a unexpected restart: {'P10': 0, 'wake': 16, 'P18': 1, 'P17': 1}

    Im not sure what the wake reason number 16 is. Do you know?

    I will also try the downgrade if you think this will be helpful, and also swapping those commands.

  • @bradnz

    1. are you sure that you have recent I ask because your error lines point to empty lines in current code
      e.g. line 76 is empty (i suppose that 79 is the line with reall message but if yours is 76 then you have different file).

    2. And by latest firmware do you mean 1.10.2.b1?

    3. And for testing what if you change this to:

    ds = DeepSleep()
    ds.enable_pullups(['P17', 'P18'])
    ds.disable_wake_on_raise(['P17', 'P18'])
    ds.disable_wake_on_fall(['P17', 'P18'])

    Is this still happen?

    1. And for final testing until someone of @administrators bring here some light
      try to downgrade software to e.g. 1.9 or `1.7.2' and see if it make any difference.

Pycom on Twitter