Hi,
Looking at the idf docs, it doesn't seem that udp unicast is an available API for the ESP32 boards. Is this true? And why? This seems like an odd thing to not have as it is a standard protocol used everywhere.
If so, how would I use multicast in place of it. As I understand it, there is a different ip address form it uses. I get a warning that my ip address is not a valid multicast address. I'm using the example code available in idf.
I'm using c on a raspberry pi for the server implementation. How do I configure this as well to use multicast as unicast?
Thanks
Unicast / Multicast as Unicast
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Unicast / Multicast as Unicast
You don't specify a protocol, I assume you mean USP uni/multicast? If so, ESP-IDF implements the largest part of the BSD socket specification, and unicast works perfectly through that. Just throw 'C UDP server example' into Google and chances are very high that the code you find works on the ESP32 without change.
Re: Unicast / Multicast as Unicast
He is right that lwip and bsd sockets features are not really part of the docs.
https://github.com/search?q=esp32+udp
https://github.com/search?q=esp32+udp
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Unicast / Multicast as Unicast
Hmm, that is a valid point. Perhaps we should add at least a hint to this to the docs.
Re: Unicast / Multicast as Unicast
I've used unicast with the socket api. It works.
John A
John A
-
- Posts: 2
- Joined: Thu Jul 26, 2018 6:47 pm
Re: Unicast / Multicast as Unicast
That's so odd. I figured multicast would work fine but I ran into an issue as I mentioned where I got a warning that the IP address was not a valid multicast address. I know the server implementation is fine because I was using it for another board.
I'm using the multicast example code and just changed the example configuration in the menuconfig. Was there something else in the code I should have changed too?
I'm using the multicast example code and just changed the example configuration in the menuconfig. Was there something else in the code I should have changed too?
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Unicast / Multicast as Unicast
Probably. Setting up a multicast socket needs some specific calls to the network stack to be done to make sure the network switching fabric routes those multicast packets correctly. If you feed those calls a non-multicast address, they'll complain.
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot], nopnop2002 and 79 guests