Hello,
Thank you for pointing that out.
I changed the pins to G30 (sleep) and G13 (wakeup) and now the system works fine.
So, the new code is:
from machine import Pin, Timer
from deepsleep import DeepSleep
import deepsleep
def handler(button):
ds.enable_pullups('G31') # can also do ds.enable_pullups(['P17', 'P18'])
ds.enable_wake_on_fall('G31') # can also do ds.enable_wake_on_fall(['P17', 'P18'])
print("Button pushed")
ds.go_to_sleep(20)
ds = DeepSleep()
# get the wake reason and the value of the pins during wake up
wake_s = ds.get_wake_status()
print(wake_s)
if wake_s['wake'] == deepsleep.PIN_WAKE:
print("Pin wake up")
elif wake_s['wake'] == deepsleep.TIMER_WAKE:
print("Timer wake up")
else: # deepsleep.POWER_ON_WAKE:
print("Power ON reset")
button=Pin("G30",Pin.IN, pull=Pin.PULL_UP)
irq=button.callback(trigger=button.IRQ_FALLING, handler=handler)
print('booted---')