Open thermophilus opened 1 year ago
Hey @thermophilus thanks for the bug report and sorry for the very late answer.
I don't have any PicoW (yet) to try to reproduce your first described issue sadly. I will keep your ticket open in case I (or others!) have the opportunity to work on it.
Regarding the second problem with the REPL, I am afraid I don't have any lead on how to mitigate the issue sadly. It may be inherent to dormancy, "disconnecting" the pico from the REPL.
The pico W wakes up from dormancy upon PIR trigger on GPIO 0. However, when this code is preceded by a network connection wlan.connect(ssid, password), the pico W does not wake-up anymore:
program detects time difference between PIR signals on GPIO 0 from pico W. If difference becomes too long (>20, line 50) program goes into dormancy. Wake-up is by PIR on GPIO 0.
activity is monitored by flashing of the PICO LED
problem 1: if preceded by a network connection (uncomment wlan.connect line 27), dormancy is initiated but now PIR signal on GPIO 0 does not wake-up the pico W.
problem 2: after dormancy, print commands to the REPL do not work anymore
from machine import Pin import time import network import lowpower
def detect_motion(pin): global Motion Motion=True
pin = Pin(0, Pin.IN, Pin.PULL_DOWN) led = Pin("LED", Pin.OUT) Motion=False; led.off() pin.irq(trigger=Pin.IRQ_RISING, handler=detect_motion) DORMANT_PIN = 0 # 0 ook voor Motion
wlan = network.WLAN(network.STA_IF) wlan.active(True) ssid = 'ssid' password = 'password' ###########################
wlan.connect(ssid, password)
###########################
while True: