Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    is it a good idea to repeatedly go deepsleep then wake up ?

    Scheduled Pinned Locked Moved Discussion
    3 Posts 2 Posters 255 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      soibac35
      last edited by soibac35

      My project is simple enough, read something, then stop, then read again after a while.

      I tried put machine.deepsleep(180000) after i read something in a loop. It worked but after a few hours, the Lopy 4 board seem to stay in deep sleep and never awake again. If i hit power reset on the board, it return to normal.

      So my question is, is it a good practice to do that ? Is is there a way to prevent this problem (doesnt wake up on its own) from happening ?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @soibac35
        last edited by

        @soibac35 You don't even need a loop. When the LoPy returns from deep sleep, it acts like a reboot, starting from the top of your script. But that's indeed the whole goal of deep sleep: constantly sleeping, waking up to do a bit of work, and going back to sleep, again and again.

        There have been reports of devices getting "stuck". It seems that in most cases it's not so much they don't get out of sleep but more often don't actually enter sleep, though the causes for this are unclear (I think I2C issues have been pointed to as a possible culprit).

        If you can monitor power usage over time, that's usually the best way to check the actual state of the LoPy. You can also set the LED to various colours while you are awake to see where it stops.

        One option if it does not indeed go to sleep is to use the watchdog timer (WDT) to ensure that if the LoPy does not actually enter sleep, it reboots so it can do its work again and re-attempt sleep.

        1 Reply Last reply Reply Quote 2
        • S Offline
          soibac35
          last edited by

          Thanks for replying.

          I just do some testing and it is true that in some random time, the device didnt go to deepsleep but rather skip that step entirely.

          What i did to test this is running script where it report will to server within 1 second non stop unless it go to machine.deepsleep step. Base on report, it skip deepsleep stage twice in the last few hours.

          Do you know or anyone know where i can find more about this problem ? I have been looking in the forum but not much

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom