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

    Interrupt wakeup from deepsleep

    Scheduled Pinned Locked Moved Getting Started
    pytrackpysensedeepsleepdeep sleepwakeup
    9 Posts 6 Posters 3.8k Views 6 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.
    • C Offline
      cfaessler
      last edited by cfaessler

      Hi everyone,

      As I understand it to put my lopy to deepsleep with the pysense/pytrack boards, I have to use the respective board libraries. For example: pytrack.setup_sleep() and pytrack.go_to_sleep() and not machine.deepsleep(). But opposed to the machine.deepsleep() I cant find any way to wakup from deepsleep with a hardware interrupt yet. I need to wakeup my devices with a raising edge from an input pin. Has anyone done this? Or is this something that is still missing in the current releases?

      Best,
      Chris

      L 1 Reply Last reply Reply Quote 1
      • L Offline
        livius @cfaessler
        last edited by

        @cfaessler
        look at:
        https://docs.pycom.io/pycom_esp32/library/machine.html?highlight=deepsleep#machine.pin_deepsleep_wakeup

        think about people first, then computers

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          cfaessler @livius
          last edited by

          @livius thank you. But does this also work when i use the pysense board librarie's deepsleep mode and not the machine.deepsleep mode?

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @cfaessler
            last edited by

            @cfaessler
            I didn't tried wake up by pins yet. Then the best is trying it self. I am interested about results :)

            think about people first, then computers

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              dbrgn @livius
              last edited by dbrgn

              @livius said in Interrupt wakeup from deepsleep:

              @cfaessler
              I didn't tried wake up by pins yet. Then the best is trying it self. I am interested about results :)

              Alright. With this code:

              import pycom
              import utime
              import machine
              from lib.pysense import Pysense
              
              py = Pysense()
              
              pycom.rgbled(0xff00ff)  # pink
              utime.sleep_ms(1000)
              
              machine.pin_deepsleep_wakeup(['P10'], mode=machine.WAKEUP_ANY_HIGH, enable_pull=True)
              py.setup_sleep(10)
              
              pycom.rgbled(0xff0000)  # red
              utime.sleep_ms(2000)
              
              py.go_to_sleep()
              

              ...the board should sleep for 10 seconds, with a way to wake it up with 3.3V on the P10 pin. I just tried it and it doesn't work. (Makes sense, since the pysense library probably controls different hardware than the machine module.)

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @dbrgn
                last edited by

                @dbrgn
                what if you add first

                p_in = Pin('P10', mode=Pin.IN, pull=Pin.PULL_DOWN)
                

                think about people first, then computers

                1 Reply Last reply Reply Quote 0
                • T Offline
                  this.wiederkehr
                  last edited by this.wiederkehr

                  @livius said in Interrupt wakeup from deepsleep:

                  Pin('P10', mode=Pin.IN, pull=Pin.PULL_DOWN)

                  I also wondered how deep sleep with pysens and pytrack works, so I tested this myself:

                  During deep_sleep the pyboard is not power at all! So basically the PIC of the pysens or pytrack does disconnect the supply voltage from the pyboard! The only thing which ever is able to wake the pyboard is the PIC. I guess the intention of pycom here is to provide a "software" solution which will make the PIC aware of selected interrupts. Of course this is limited to the interrupts which are physically routed to the PIC.
                  So you likely have to wait for pycom to come up with their software solution till this is going to work ...

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

                    Has there been any updates on how to wake up a Pycom device from deep sleep with an interrupt?

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

                      @chrisi if you are using the Deep Sleep shield, then you have the relevant functions in the library that goes with it.

                      If you are using a Pysense (and I believe the same applies to the Pytrack), then it's a lot more complex. There's only one usable pin on the I/O header, you need to patch the Pysense firmware, isolate a pin between the module and the Pysense, and change a few things in the sleep process. But it does work.

                      Refer to https://forum.pycom.io/topic/1673/pysense-pinout-wake-on-pin/16 for details.

                      1 Reply Last reply Reply Quote 1

                      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