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

    Does deepsleep work at all

    Scheduled Pinned Locked Moved Discussion
    deepsleep
    83 Posts 20 Posters 50.1k Views 23 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.
    • A Offline
      adam_IoTK
      last edited by

      I am working with the SiPy board with extension board. A very simple setup - boot without any wifi commands (seems to boot wifi anyway?)
      read sensor values using uart commands
      use s.send(xxx) to send via sigfox
      deep.sleep (600000) = 10 min.
      It is powered through USB.
      Has any one any succes with deepsleep? I know about the power issues - but I am currently more concerned about the stability of the function. For me it wakes up and runs boot.py - and not as stated in the "getting started" - in the main script. This runs around 5-8 times and then stops. It might be in the main.py - but surely a lot of wifi stuff is going on every time it wakes up.

      Anyone had succes with deepsleep? Just a simple setup.

      Best regards, Adam

      R 1 Reply Last reply Reply Quote 0
      • B Offline
        bucknall
        last edited by

        Hi @adam_IoTK,

        Please see this forum post for more information on this matter.

        https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current

        Thanks,

        Alex

        Developer Evangelist - Pycom

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          adam_IoTK @bucknall
          last edited by

          @bucknall I have read the post. What I did'nt understood was the point that the deepsleep function had two problems - the power consumption and the functionality as well. Can I expect the deepsleep function to wake up in the "program line" where I called deepsleep - or will It reset the board totally - when the deepsleep-quick-fix board arrives?

          Sorry for not understanding the very detailed description in the "deepsleep post".
          Adam

          B A 2 Replies Last reply Reply Quote 0
          • B Offline
            bucknall @adam_IoTK
            last edited by

            Apologies @adam_IoTK, misread your original question! Yes the stability issues are part of the coming firmware fix - they should help to resolve the waking up issues.

            Thanks,

            Alex

            Developer Evangelist - Pycom

            A 1 Reply Last reply Reply Quote 0
            • A Offline
              adam_IoTK @adam_IoTK
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • A Offline
                adam_IoTK @bucknall
                last edited by

                @bucknall Found it in https://forum.pycom.io/topic/929/deepsleep-stops-execution-of-main

                Sorry for the confusion, and thanks for your patience.

                adam

                1 Reply Last reply Reply Quote 0
                • D Offline
                  daniel
                  last edited by

                  @adam_IoTK waking from deepsleep starts execution from the same point as when you power up the board. There are a few patches coming soon that will allow to:

                  1. Detect the reset reason, so you can know if you come from a power-on reset or deepsleep, then act accordingly.

                  2. Do not start-up WiFi by default on boot. This will speed up boot times dramatically and reduce power consumption.

                  3. Keep the RTC running during deepsleep.

                  1 Reply Last reply Reply Quote 0
                  • RobTuDelftR Offline
                    RobTuDelft
                    last edited by

                    Is it currently possible to wake from deepsleep, e.g. on sensor reading?

                    Without data you're just another person with an opinion.
                    Hackster | About me

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

                      @RobTuDelft it is, but not yet. The ULP coprocessor from the ESP32 has to be used for that, but we haven't enabled support for it yet.

                      C 1 Reply Last reply Reply Quote 0
                      • J Offline
                        jmarcelino @RobTuDelft
                        last edited by

                        @RobTuDelft
                        Some sensors have an "alarm" pin when values go below/over some threshold, with the deep sleep shield you could (in theory, I don't have it yet) connect those to either P17 or P18 and enable_wake_on_fall (or rise).

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          chumelnicu @daniel
                          last edited by

                          @daniel Do deepsleep working ? I try to put my lopy after s.send(data) in lorawan config and after wake up 2 time from deepsleep the program is stop execution.

                          Any solutions for that ?

                          BTW ....I did try deepsleep from machine and alsi try with deepsleep board and DeepSleep from deepsleep.py library, same result

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            daniel
                            last edited by

                            @chumelnicu deep sleep works... Can you be more specific around the way your program stops execution? A code example and the REPL output would help us understand your issue. Thanks.

                            C C 2 Replies Last reply Reply Quote 0
                            • C Offline
                              chumelnicu @daniel
                              last edited by

                              @daniel Thx
                              Was about reading HR-04 Ultrasonic Sensor and send data over lorawan.
                              First i did connect Echo to Pin11 and Trigger to Pin12

                              I just move it to Pin21 and Pin22 and seems all is ok

                              Solved ! Thx Daniel

                              1 Reply Last reply Reply Quote 0
                              • C Offline
                                Camot @daniel
                                last edited by

                                @daniel said in Does deepsleep work at all:

                                @chumelnicu deep sleep works...

                                Sure? Libs and Lopy updated today. Lopy attached to the DeepSleep board. Not even the first line of the example from Github or documentation works without an error

                                >>> os.chdir('lib')                                                                                                     
                                >>> os.listdir()                                                                                                        
                                ['LIS2HH12.py', 'LTR329ALS01.py', 'MPL3115A2.py', 'pysense.py', 'SI7006A20.py', 'dth.py', 'bme280.py', 'deepsleep.py']  
                                >>>                                                                                                                     
                                >>> from deepsleep import DeepSleep                                                                                     
                                Traceback (most recent call last):                                                                                      
                                  File "<stdin>", line 1, in <module>                                                                                   
                                ImportError: cannot import name DeepSleep                                                                               
                                >>> os.uname()                                                                                                          
                                (sysname='LoPy', nodename='LoPy', release='1.7.8.b1', version='v1.8.6-724-g2b9ed601 on 2017-07-28', machine='LoPy with E
                                SP32', lorawan='1.0.0')
                                
                                J 1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jmarcelino @Camot
                                  last edited by

                                  @Camot said in Does deepsleep work at all:

                                  ImportError: cannot import name DeepSleep

                                  Do you happen to have another file named deepsleep.py in your LoPy root folder by any chance?

                                  C 1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    Camot @jmarcelino
                                    last edited by Camot

                                    @jmarcelino said in Does deepsleep work at all:

                                    @Camot said in Does deepsleep work at all:

                                    ImportError: cannot import name DeepSleep

                                    Do you happen to have another file named deepsleep.py in your LoPy root folder by any chance?

                                    oops, thank you! How embarrassing :/ . It was still there from my pysense experiments. Anyway, still not working

                                    Traceback (most recent call last):                                                                                      
                                      File "<stdin>", line 7, in <module>                                                                                   
                                      File "/flash/lib/deepsleep.py", line 145, in get_wake_status                                                          
                                      File "/flash/lib/deepsleep.py", line 76, in peek                                                                      
                                    IndexError: bytes index out of range                                                                                    
                                    >                                                                                                                       
                                    MicroPython v1.8.6-724-g2b9ed601 on 2017-07-28; LoPy with ESP32                                                         
                                    Type "help()" for more information. 
                                    
                                    J 1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      jmarcelino @Camot
                                      last edited by jmarcelino

                                      @Camot
                                      Setting aside the get_wake_status() example for now does a straight up

                                      from deepsleep import DeepSleep
                                      ds = DeepSleep()
                                      ds.go_to_sleep(30)
                                      

                                      put the board into deep sleep for 30 seconds?

                                      C 1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        daniel
                                        last edited by

                                        @Camot do you have anything connected to P10? That's the pin used between the LoPy and the deepsleep shield for communication...

                                        1 Reply Last reply Reply Quote 0
                                        • C Offline
                                          Camot @jmarcelino
                                          last edited by Camot

                                          @jmarcelino said in Does deepsleep work at all:

                                          @Camot
                                          Setting aside the get_wake_status() example for now does a straight up

                                          from deepsleep import DeepSleep
                                          ds = DeepSleep()
                                          ds.go_to_sleep(30)
                                          

                                          put the board into deep sleep for 30 seconds?

                                          don't think so, the board become unresponsive for 50 seconds but heartbeat continues and then it reports

                                          >>> ds.go_to_sleep(30)                                                                                                  
                                          Traceback (most recent call last):                                                                                      
                                            File "<stdin>", line 1, in <module>                                                                                   
                                            File "/flash/lib/deepsleep.py", line 156, in go_to_sleep                                                              
                                            File "/flash/lib/deepsleep.py", line 105, in calibrate                                                                
                                          IndexError: list index out of range 
                                          

                                          Repeated it 3 times with ds.go_to_sleep(30), alway 50 seconds unresponsive :/

                                          @daniel
                                          no, only the Lopy, the deepsleep shield, the antenna and power with a 3.3V Step-Up/Down Regulator on the Lopy 3.3V pin.

                                          J 1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            jmarcelino @Camot
                                            last edited by

                                            @Camot said in Does deepsleep work at all:

                                            no, only the Lopy, the deepsleep shield, the antenna and power with a 3.3V Step-Up/Down Regulator on the Lopy 3.3V pin.

                                            That's the problem then, the deep sleep shield only controls - and is powered by - the Vin (labelled 5V) pin not the 3.3V.

                                            Try applying your 3.3V to the Vin pin instead, the LoPy regulator should enter bypass mode and hopefully the PIC10 and extra circuitry shouldn't be affected too much.

                                            C 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
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 1 / 5
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom