Resolving UDP and IGMP issue with ESP8266

One of the next steps I am taking is making the ESP8266 aware of other ESP8266 devices and being able to talk to them.
There is a couple way’s I can do this via UDP either with Broadcast or Multicast and I am still planning to figure out what would work best.
One thing I noticed is that as I enable IGMP I am also unable to continue sending RAW udp packets to the multitask group. Well after about an hour of Diag the issue I found that when my socket recieves a packet it update’s the remote PORT and address to reply back specifically to that client and does not revert the address to continue pointing back at the Multicast group 238.255.255.250 thus net new packets continue to send to the last used address.
I created the following code below to copy the address and restore it after the UDP packet is sent out, resolving the issue.

Leave a comment

Your email address will not be published. Required fields are marked *