← index #17300Issue #16713
Off-topic · high · value 0.920
QUERY · ISSUE

Ping responce stops working after several hours

openby bty-1opened 2025-05-14updated 2025-05-31
bugport-rp2

Port, board and/or hardware

Raspberry Pi Pico W with RP2040; Raspberry Pi Pico 2 W with RP2350

MicroPython version

MicroPython v1.24.0; MicroPython v1.25.0;

Reproduction

  1. Install RPI_PICO2_W-20250415-v1.25.0.uf2 on Raspberry Pi Pico 2 W.
  2. Create main.py with script below on device.
  3. Power on device with USB or batery.
  4. Wait 10 hours. Do not access the device over the network.
  5. On PC (in my case Windows 10) run command "ping 192.168.10.241 -t".
# main.py
import network
from time import sleep
from machine import Timer, Pin

led = machine.Pin("LED", machine.Pin.OUT);
wfssid = "xxxxxxxxxx"
wfpass = "xxxxxxxxxx"
wlan = network.WLAN(network.STA_IF);
wlan.active(True);
print(f'Connecting to "{wfssid}" AP. ', end="")
wlan.connect(wfssid, wfpass);
while wlan.isconnected() == False:
    sleep(1.0);
    print('.', end="");
print(' Done !');
print(wlan.ifconfig())

def cb1sec(timer):
    # To be sure that the device is working
    led.on()
    sleep(0.001);
    led.off()

timer1sec = Timer(period=1000, mode=Timer.PERIODIC, callback=cb1sec)

while True:
    sleep(10.0);

Expected behaviour

Starts respond on pings immidiately.

Observed behaviour

Starts to respond after 10...60 unsuccessful pings.

Additional Information

The device stops responding to ping after a few hours of operation.
Powered by USB or battery, no USB connection (with USB connection it also sometimes "hangs")
The device "hangs" after 1...10 hours.
During this time, do not access the device over the network!

During "hanging":

  1. Unable to connect to FTP server on device.
  2. Ping from device continues to work!

When device is "frozen", you can "wake it up" using command:
ping 192.168.10.241 -t
Initially, the device does not respond to pings, but after 10...60 unsuccessful pings, device starts responding and normal operation of network interface is restored.

See:
Raspberry Pi Pico W network becomes inaccessible when not used for some time #9455
With network.PPP device hangs after several hours of operation #16340
#9455 and #16340 probably have the same root cause.

Not Reproducing on:
MicroPython v1.25.0 on 2025-04-15; ESP module with ESP8266. (ESP8266 Wemos D1 mini)

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

Serial com and external power supply

openby eleroyopened 2025-02-06updated 2025-02-23
bug

Port, board and/or hardware

rp2, raspberry pico

MicroPython version

MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico with RP2040

Reproduction

  1. Start a code with serial printing such as:
import time

while True:
    print(time.time())
    time.sleep(0.1)    
  1. Connect external power supply (+5V or 3V3)
  2. Disconnect usb
  3. Wait ~4 s
  4. Reconnect usb

Expected behaviour

When you reconnect USB, the board should be normally detected as CDC Serial device and printing.

Observed behaviour

When you reconnect USB the board is not detected anymore and it seems the program has been interrupted.

Additional Information

I suspect something like a buffer overflow on the serial output hardware is happening.

If the usb is reconnected quickly (in 1 second or so), the board is well detected.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied