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



  • 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()
    


  • 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.



  • i corrected the code example
    thx for the hint :)



  • @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.



  • This post is deleted!

Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.