ESP-IDF UDP
ESP-IDF UDP
I was looking to use UDP for communication between multiple ESP32 chips. The only example I could find was the lwip/sockets one, which seems like a lot of overhead/resources for some very small/simple UDP packets. Is there any lower level/simpler API that could be used instead?
Re: ESP-IDF UDP
Whats not to love about:
?
What else do you have going on that would stop you using Berkley sockets?
Socket storage is not huge. Buffer allocation may be an issue though.
re: Resource utilisation: You used to be able to change the Ethernet RX/TX buffers in 3.x. Not found/confirmed that option in 4.x.
You can change Wifi buffers in 3.x and 4.x. I know that Ethernet buffers changes wear well (for my application which has multiple sockets), not so sure about wifi.
It does depend what you are doing but are you really resource constrained?
EDIT: To be clear, you do get a big RAM hit when you first use the lwip stack on Ethernet. This includes some large static stuctures and larger dynamic buffers, the latter you can control through menuconfig (3.x). Wifi uses even more memory for Wifi functions and also dynamic wifi buffers. It is Wifi's nature (regardless of processor) I am afraid to trash your memory.
Code: Select all
socket(AF_INET, SOCK_DGRAM, 0);
What else do you have going on that would stop you using Berkley sockets?
Socket storage is not huge. Buffer allocation may be an issue though.
re: Resource utilisation: You used to be able to change the Ethernet RX/TX buffers in 3.x. Not found/confirmed that option in 4.x.
You can change Wifi buffers in 3.x and 4.x. I know that Ethernet buffers changes wear well (for my application which has multiple sockets), not so sure about wifi.
It does depend what you are doing but are you really resource constrained?
EDIT: To be clear, you do get a big RAM hit when you first use the lwip stack on Ethernet. This includes some large static stuctures and larger dynamic buffers, the latter you can control through menuconfig (3.x). Wifi uses even more memory for Wifi functions and also dynamic wifi buffers. It is Wifi's nature (regardless of processor) I am afraid to trash your memory.
& I also believe that IDF CAN should be fixed.
Re: ESP-IDF UDP
I just don't like sockets or LWIP. I've used both before, they often have hard to find errors and quirks and the spaghetti code mess that is their implementation makes it near impossible to debug.
I'd prefer to manage my own buffers.
Sadly it seems that it is not supported
I'd prefer to manage my own buffers.
Sadly it seems that it is not supported
Re: ESP-IDF UDP
Well, that is a point of view I guess.
I am guessing however that n thousand people using, testing and perhaps contributing to lwip would produce a better result than you or I.
The raw emac & phy interfaces are open to all '/components/ethernet' and so you can bypass lwip & sockets should you wish.
I am guessing however that n thousand people using, testing and perhaps contributing to lwip would produce a better result than you or I.
The raw emac & phy interfaces are open to all '/components/ethernet' and so you can bypass lwip & sockets should you wish.
& I also believe that IDF CAN should be fixed.
Who is online
Users browsing this forum: axellin and 72 guests