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

    Deep Sleep Shield with LoPy wake timing is inconsistent

    Scheduled Pinned Locked Moved Issues & Bugs
    deepsleepdeep sleeplopypower savingsleep
    7 Posts 2 Posters 1.9k 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
      shivams
      last edited by

      I am using deep sleep shield to put my LoPy in deep sleep mode with current consumption of 500 uA.

      Everything is working fine, however the wake timing is not consistent. E.g. my nodes are set to sleep for every 15 minutes and then wake for 10 seconds and then go back to sleep. However, sometimes the nodes wake up early, e.g. 10 minutes or 8 minutes. And there is no pattern to this inconsistency.

      What could be the reason? Has anybody else encountered this issue?

      1 Reply Last reply Reply Quote 0
      • S Offline
        shivams
        last edited by shivams

        I think I am closing in on the issue, with some good leads. If someone can help me towards a solution using these clues, it would be great.

        I tried 6 LoPy with deep sleep shields running the same program for sleep interval of 15 minutes.

        3 of them were powered using DC power supply with constant 4.5V. The other 3 were powered using 3 "1.5V" Alkaline batteries in series (hence producing 4.5V).

        The modules powered from DC power supply were very consistent in their sleep cycle. They'd wake up exactly after 15 minutes most of the time. Their average sleep time came out to be 14.5 minutes over a period of 2 days.

        The modules powered from batteries were very inconsistent. They'd wake up early quite often. Their average sleep time came out to be 7-8 minutes over the same period.

        This is strange. Could someone guide me as to what could be the issue?

        1 Reply Last reply Reply Quote 0
        • S Offline
          shivams
          last edited by

          Similar issue has been reported for SiPy here: https://forum.pycom.io/topic/2270/deepsleep-still-randomly-ending/6. The OP says that he's solved it by doing the following:

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

          However, this doesn't solve the issue for LoPy.

          Admins please respond to this issue. This issue has rendered our lot of 100 LoPy devices useless and an utter waste of money.

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

            The following info might be useful to try to pinpoint the source of the issue:

            • how are you connecting your power source to the deep sleep shield? Directly to VDD, or going through some other circuit?
            • are there any other circuits connected (sensors...)?
            • what's the actual measured voltage? 3 x 1.5 V batteries can deliver anywhere from 1.8 V to 5 V.
            • what wake-up sources do you configure/use?
            • is there anything connected to the wake-up pins?
            • what is the reported wake-up reason?
            • can you share the relevant parts of your code?
            S 2 Replies Last reply Reply Quote 0
            • S Offline
              shivams @jcaron
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • S Offline
                shivams @jcaron
                last edited by

                @jcaron Thanks for replying. Here are the answers to your queries:

                how are you connecting your power source to the deep sleep shield? Directly to VDD, or going through some other circuit?

                Directly to VDD.

                are there any other circuits connected (sensors...)?

                No sensors or additional circuits connected.

                what's the actual measured voltage? 3 x 1.5 V batteries can deliver anywhere from 1.8 V to 5 V.

                Around 4.3 to 4.6V.

                what wake-up sources do you configure/use?

                No external wake-up source configured. The internal timer wakes it up.

                is there anything connected to the wake-up pins?

                No.

                what is the reported wake-up reason?

                How do I know this? Kindly give me the command/code for this.

                can you share the relevant parts of your code?

                Sure. Here's the main.py:

                from network import LoRa
                import socket
                import binascii
                import struct
                import time
                import config
                from machine import Pin
                from machine import UART
                from network import WLAN
                from deepsleep import DeepSleep
                import gc
                
                ds = DeepSleep()
                
                # initialize LoRa in LORAWAN mode.
                    #LoRa initialization code was here
                
                # create a LoRa socket
                s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
                
                # set the LoRaWAN data rate
                s.setsockopt(socket.SOL_LORA, socket.SO_DR, config.LORA_NODE_DR)
                
                # make the socket blocking
                s.setblocking(False)
                
                while 1:
                    temp = "somestring"
                    s.send(temp)
                    print("Gonna sleep for a while")
                    time.sleep(6)
                
                    print("Gonna go into deep sleep")
                    print(time.mktime(time.gmtime())) #Printing epoch seconds
                    ds.go_to_sleep(900)
                    print("Back from deep sleep")
                
                1 Reply Last reply Reply Quote 0
                • J Offline
                  jcaron
                  last edited by

                  You can get the wake reason using ds.get_wake_status().

                  I think the default is that there are no other wake-up sources configured, but you may try to disable_wake_on_fall(['P10','P17', 'P18']) and disable_wake_on_raise(['P10','P17', 'P18']) just to be sure.

                  Full details here: https://docs.pycom.io/chapter/datasheets/boards/deepsleep/api.html

                  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