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

    WiPy 2.0 workin machine.deepsleep() example with IRQ-usage

    Scheduled Pinned Locked Moved WiPy 2&3
    5 Posts 2 Posters 2.5k Views 3 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.
    • D Offline
      dan1824
      last edited by daniel

      I have the following issues:

      a)

      1. after machine.deepsleep() the interrupt handler seems not to be called, why is the WiPy 2.0 not waking on interrupt?
      2. without machine.deepsleep() this is working as expected

      b) why is the WiPy 2.0 not reacting to the interrupt BUT still reacting on pinging its IP address and still accepting ftp-connections?

      Can someone enlighten me. I would appreciate any help ;)

      Thank you all :)


      import pycom
      import machine
      from machine import Pin
      
      dowz = False
      
      def cb(p):
          global dowz
          dowz = True
      
      p_in10 = Pin('P10', mode=Pin.IN, pull=Pin.PULL_UP)
      p_in10.irq(trigger=Pin.IRQ_FALLING, handler=cb)
      
      
      while(True):
          if dowz:
              pycom.rgbled(0x00ff00)
              machine.deepsleep()
      
      D 1 Reply Last reply Reply Quote 0
      • D Offline
        dan1824 @dan1824
        last edited by

        This post is deleted!
        L 1 Reply Last reply Reply Quote 0
        • L Offline
          LoneTech @dan1824
          last edited by

          @dan1824 You can fix the formatting in the post by putting triple backticks ``` before and after the code. Single backticks for snippets (like the one I just used), or four spaces extra indentation also works to make code blocks. Pycom really should've put a button for code block in the editor; much more helpful than strikethrough. Anyway, it's basically markdown formatting.

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

            i corrected the code example
            thx for the hint :)

            1 Reply Last reply Reply Quote 0
            • L Offline
              LoneTech
              last edited by LoneTech

              Deep sleep is a somewhat nebulous chapter; for one thing, the ESP32 manual doesn't have the power management chapter yet. Similarly, sleep mode is not yet implemented in Pycom's ESP32 port of MicroPython. I believe, when deep sleep actually does work, it cuts power to the RAM so a wakeup is a boot with the deep sleep reset cause, and the pins that can cause it to wake may be only the RTC ones. Most of that's guessing and conjecture.

              PS. Well, considering that was your thread, I'm not sure why it was expected to work? I vaguely recall somewhere else mentioning sleep will be in place for 1.0, which was planned for sometime in December, but there's a lot of work still to do.

              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