Replies: 6 comments 25 replies
-
I see something similar while I test the new alternative WiFi driver, which is integrated as the wired network interfaces are. (the cw34 on Pico W has a different integration). |
Beta Was this translation helpful? Give feedback.
-
Very odd. The implementation of wired Ethernet here uses the same The internal LWIP and WiFiUDP/WiFiClient stuff is absolutely identical and doesn't have any idea where the packets come from or go out to. Do you have a way of reproducing this w/o your whole app? Maybe something w/ You can check a few things simply, assuming you have a Picoprobe:
|
Beta Was this translation helpful? Give feedback.
-
a Wireshark session of the crash with W5500: It crashes the same way with the ESPHost WiFi, but it doesn't crash with Pico W |
Beta Was this translation helpful? Give feedback.
-
OK @earlephilhower got a little MCVE for ya. While making it I discovered, I think, that keeping MDNS & httpServer open (no connections though - unless Windows 10 is randomly doing some query) seems to drastically speed up the lwip crash. Maybe it's MDNS sending out packets here and there that's breaking it, not sure. (mDNS without HTTP didn't seem to do anything different though). So I kept that in. Experiment with polling rate, SPI rate, MDNS/http on/off, but as-is how I'm sending it, it crashes for me pretty consistently in under 20 seconds. Without MDNS/HTTP on it takes longer, but still crashes. Serial (USB) prints some basic info; if we are getting full packets or not. When it switches from "Got valid packet of size 638" to "No packets received in a while" (and the python script is still running) is when it breaks. pinouts should be the same as w5100s/w5500 EVP pico board, I'm using w5500 official "w5500-io" chip soldered to a PCB with matching pinouts for reference. platformio.ini:
Python code - should work on linux or windows, just fine, I did it from WSL2. needs python3 package I'm connected directly between my laptop and pico with a cable, static IP on both sides, but going thru a switch, laptop on wifi, dhcp, etc does not matter. You can change line 79 in the pico code to change IP. Thanks soo much for your help!! let me know if there's any questions or issues getting it running :) |
Beta Was this translation helpful? Give feedback.
-
I test with the new release with an enc28j60. handlePackets stops for extended time and that causes problems.
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I have some code that uses W5500 ethernet, and listens for UDP packets with the E1.31 protocol.
The W5500 is wired identical to the EVB-W5500-pico board, so SPI wired in, as well as the interrupt pin, and is setup with
The packet sizes max out at around 640 bytes. The system is getting these UDP packets 30+ times per second, and calls
udp.parsePacket();
andudp.readBytes(pwbuff->raw, size);
pretty darn often - more often than we are getting a packet I'm pretty sure. (I did not write this part of the code - it's part of a library).But after some amount of time, sometimes it's 30 minutes, sometimes it's 30 seconds, it seems the entire network stack has crashed (?). No more UDP packets get past udp.parsePacket(), no longer responds to pings, no response on HTTP server (not related to crash btw, i can hit http as much as I want without issue until UDP breaks everything), etc. Both pico cores keep running just fine, but I don't get any packets - they are still hitting the W5500 i think, because it knows there's a packet to look for, the status LED changes, but udp.parsePacket() returns 0. Using picoprobe, I can see that the code that returns zero is
in https://github.com/earlephilhower/arduino-pico/blob/master/libraries/WiFi/src/include/UdpContext.h#L241
AKA there is no _rx_buf after some period of time anymore(?)
So my questions are;
does this mean the w5500 / lwip / something ran out of buffers for rx?
and if so is there a way to increase the number of, or size of buffers;
or do I need to process packets faster before they fill up?
or am I looking in the wrong place and this is not the issue? could it be the W5500 resetting or something unrelated?
basically, any ideas how can I prevent this from happening, or how to debug it further / better? It is okay if I have to drop a packet in order to get the latest one or whatnot; I'd rather that happen than networking completely dying.
Much appreciated,
Cole
Beta Was this translation helpful? Give feedback.
All reactions