Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4794

MicroPython • Re: How to receive large (>1024 byte) UDP datagram packets?

$
0
0
I guess that was down to running older MicroPython firmware.
Why that? I used the latest firmware available then.
I thought you had been using older firmware from saying "I only got 1024 in my original test was because I was using the default micropython image which has a hard-coded 1024 limit in the lwipopts" as that isn't the case for latest MicroPython firmware.

It wasn't clear what you had loaded because "default" could be anything. I would expect "v1.23.0 (2024-06-02)" for most people, which MicroPython also calls "latest", though the actual latest is currently "v1.24.0-preview.149 (2024-07-29)" aka "v1.23.0-149".

If you were using one of those later releases, and they don't have a 1024 cap, then why was it capped for you but not me ?

Though I don't think the reason really matters much.
Also, I believe you had the same issues first, not getting more than 1033 bytes initially with my code? Only your rewritten code eventually worked better
Not quite. I tested with 1033 bytes because that was larger than 1024 and that worked for me. So my conclusion was that I could receive more than 1024 bytes, could receive 1033 bytes, but I hadn't at that point tested exactly how much I could receive.

so I guess that would be the "solved" reply (viewtopic.php?p=2240923#p2238492) for micropython, and https://github.com/tempelmann/picow-udp-example for using C. Agreed?
Yes it seems one can receive more than 1024 bytes whether using MicroPython or C.

For MicroPython I could receive up to 1,650 byte without any packets being dropped, up to 7,380 bytes with packets dropped, whereafter it hung the Pico W.

Using C based on the linked example it seems I get a callback with all payload present up to 1,472 bytes. I can send multiple packets of 2K, 4K and 8K and see the first 1,472, but it then stops reporting packets received after some time. When I send packets of increasing size, the C code doesn't report any packets received after reaching 1,022 bytes. Not sure if that's the same 'stops working after some time' issue or something else.

So I'm not sure how to categorise the C code; can receive more than 1024 bytes but might not ?

My feeling remains that there's something not quite right with networking on a Pico W and trying to characterise it beyond that isn't really possible.

Statistics: Posted by hippy — Tue Jul 30, 2024 3:14 pm



Viewing all articles
Browse latest Browse all 4794

Trending Articles