Recovering from #58 by calling wifi.radio.stop_scanning_networks() hung the board hard.
Observed
Board associated, web workflow serving, radio stuck in the #58 state. Ran:
import wifi
r = wifi.radio
r.stop_scanning_networks()
After that:
- no serial output at all on the console UART
- web workflow gone,
curl http://<ip>/cp/version.json returns nothing (curl exit 000)
- the J-Link still enumerates and
commander adapter list still reports the board
Only commander device reset recovered it, about 19 seconds to come back.
Note
common_hal_wifi_radio_stop_scanning_networks() already carries this comment at Radio.c:272:
// Return early if self->current_scan is NULL to avoid hang
if (self->current_scan == NULL) {
return;
}
So a hang in this function is already known, and the existing guard only covers the NULL case. Here current_scan was non-NULL but pointed at a scan that had been abandoned, and wifi_scannednetworks_deinit() was reached with the msgq, fifo and k_poll state left mid-scan.
I have not isolated which part of wifi_scannednetworks_deinit() blocks. Worth checking whether it waits on channel_done or drains the fifo without a timeout when no further scan results will ever arrive.
This matters more than the scan duplication in #57: it takes the whole board down, including the network stack, from ordinary Python.
Related: #58, #57.
Recovering from #58 by calling
wifi.radio.stop_scanning_networks()hung the board hard.Observed
Board associated, web workflow serving, radio stuck in the #58 state. Ran:
After that:
curl http://<ip>/cp/version.jsonreturns nothing (curl exit 000)commander adapter liststill reports the boardOnly
commander device resetrecovered it, about 19 seconds to come back.Note
common_hal_wifi_radio_stop_scanning_networks()already carries this comment atRadio.c:272:So a hang in this function is already known, and the existing guard only covers the NULL case. Here
current_scanwas non-NULL but pointed at a scan that had been abandoned, andwifi_scannednetworks_deinit()was reached with the msgq, fifo andk_pollstate left mid-scan.I have not isolated which part of
wifi_scannednetworks_deinit()blocks. Worth checking whether it waits onchannel_doneor drains the fifo without a timeout when no further scan results will ever arrive.This matters more than the scan duplication in #57: it takes the whole board down, including the network stack, from ordinary Python.
Related: #58, #57.