8000 Raspberry Pi Pico W network becomes inaccessible when not used for some time · Issue #6958 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Raspberry Pi Pico W network becomes inaccessible when not used for some time #6958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anecdata opened this issue Sep 28, 2022 · 2 comments · Fixed by #6976
Closed

Raspberry Pi Pico W network becomes inaccessible when not used for some time #6958

anecdata opened this issue Sep 28, 2022 · 2 comments · Fixed by #6976
Labels
bug network rp2040 Raspberry Pi RP2040
Milestone

Comments

@anecdata
Copy link
Member
anecdata commented Sep 28, 2022

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-65-g5781bd318 on 2022-09-22; Raspberry Pi Pico W with rp2040

Code/REPL

import time
import supervisor
import microcontroller
import wifi
import socketpool
import adafruit_requests
from secrets import secrets

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"

pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool)

while not wifi.radio.ipv4_address or "0.0.0.0" in repr(wifi.radio.ipv4_address):
    print(f"Connected?")
    wifi.radio.connect(secrets["ssid"], secrets["password"])
print(f"{wifi.radio.ipv4_address}")

# increase delay between requests each time
interval_sec = 0
increment_sec = 60
timer_sec = time.time() - interval_sec
while True:
    if time.time() - timer_sec > interval_sec:
        try:
            r = requests.get(TEXT_URL)
            print(f"{interval_sec:>5} {r.status_code} {r.reason.decode()} {r.content}")
            r.close()
            interval_sec += increment_sec
        except OSError as e:
            print(e)
            # supervisor.reload()  # not enough, must reset
            microcontroller.reset()
        timer_sec= time.time()

Behavior

Documented here:
#6933 (review)

Possibly related to power-saving mode described in section 3.6.3 here.

Same behavior in MicroPython, issue link will be posted here:
micropython#9455

Description

No response

Additional information

No response

@anecdata
Copy link
Member Author
anecdata commented Sep 29, 2022

Pinging the device periodically from an external source also seems to extend accessibility of the network. Toggling the LED (which exercises the wifi module) gave mixed results... several runs with 5 minute intervals, one run with 6-7 minute interval.

Perhaps it is intentional in MicroPython. With Power-Saving mode off, much longer intervals are possible. If it is intentional, we may need a way to re-awaken the network without the failure that requires restart.

@dhalbert dhalbert added this to the 8.x.x milestone Sep 30, 2022
@anecdata
Copy link
Member Author

I'll test CircuitPython with artifacts after 84c7ac4, with power-save on and off, and try to confirm the hypothesis that power-save mode 0 (no power save) fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug network rp2040 Raspberry Pi RP2040
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0