Debugging Pico W DHCP problems #11938
Replies: 3 comments 2 replies
-
it's a long shot, but: is your network.country() set appropriately? |
Beta Was this translation helpful? Give feedback.
-
EDIT: I thought adding the country code had fixed it for a while, but it seems to just be going in waves. It worked 20+ times in a row, and now has failed more than a dozen times in a row. I still could really use any advice on getting more debug information. There's just nothing observable from the Wifi Access Point, the problem is all on I guess the receive side of the Pico W wifi chip/stack. I've tried three different boards as well, no improvement. |
Beta Was this translation helpful? Give feedback.
-
For reference, I'm running this snippet:
I've also tried having the wlan.connect call just once before the loop, that seems to be much less reliable. When it works I usually see this:
Sometimes there is a single error status like -2 first. But often I just get stuck in status 2 forever even with the country code:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm curious if there's a way to get any extra debug info out of the CYW43 drivers. I've tried both the stable 1.20 and the latest nightly, and my Pico W's routinely get stuck in WLAN.status() == 2, which is CYW43_LINK_NOIP. Grabbing packet dumps off the router shows nothing unusual, the DHCP request comes in and the offer goes out to the Pico W, but the status just doesn't progress to LINK_UP (3). Sometimes it's stuck for a while, sometimes it's stuck indefinitely, sometimes it goes straight to state 3. When it gets stuck for more than 10-15 seconds it never progresses, even though it keeps sending DHCP requests forever. The only solution is to completely power down the Pico W and hope it works on the next try. I'd say the wifi is able to connect and get an IP about 20-30% of the time, though sometimes I've gone hours without being able to get an IP.
I found that even though the wifi chip can be power cycled using GPIO23, you can't actually do that without locking things up next time you try to talk to the chip, even just to toggle the LED that is connected via the wifi chip. My only guess now would be to power off the wifi, trigger the watchdog, and hope that things come up in a working state after the power cycle.
So just curious if there's any way to enable any of the LWIP library diagnostic stuff, I see the rp2 port just #defines LWIP_PLATFORM_DIAG(x) to empty string, for example. Not sure if there's any hope of getting that output through the REPL terminal, and then if I could define LWIP_DEBUG somehow in the build, I could maybe get some idea of what is happening.
Beta Was this translation helpful? Give feedback.
All reactions