Skip to content

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

Closed
@anecdata

Description

@anecdata

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy