Hi all, I'm driving a smart bulb with an ESP32.
The ESP is configured as a sta_softap (no bluetooth stack) and everything is fine : the ESP is connected through STA and the bulb is connected to the AP side.
Then, to have a separation of concerns I create 3 sockets (alongside 3 struct sockaddr_in)
- broadcast_socket
- listener_socket
- sender_socket
Only listener_socket is binded (to the AP side)
What I get
- I can send control messages to the bulb, for hours, controlling the colors without a glitch
- But when I send broadcast messages, I only have the bulb to responds around 2/3 times then stay silent forever. Broadcast messages are sent every 5 seconds, so no network flooding can occur
I dunno if it's a bulb's problem or an UDP broadcast problem.
I connected my Mac to the AP, and with Wireshark I can see the broadcast messages being sent. But, of course, I don't see the bulb->listener_socket traffic because it's not propagated.
At least I know that the broadcast messages are sent.
I'm aware that some traffic loss can occur with UDP broadcast, but 100% seems strange
So, my question is :
- Did some of you had problem with UDP broadcast messages on STA_softAP mode ?
- Is there any settings in VS Code ESP IDF I should try to change ?
Side note : I tried two different bulbs that "may" have different firmwares (I didn't checked for now) :behaviour is the same
STA_softAP + UDP broadcast on softAP side problem
Re: STA_softAP + UDP broadcast on softAP side problem
My bad : when using a static struct to build a packet ALWAYS initialize it with 0s before doing anything else !
Of course, not doing so, the packet will have some wrongly initialized values (from the previous one)
Of course, not doing so, the packet will have some wrongly initialized values (from the previous one)
Who is online
Users browsing this forum: Baidu [Spider] and 62 guests