Some of this was previously discussed in Sending LAN packet using Arduino, but was never really answered, so here goes:
Node ESP32 development board, running standard Arduino libs
One trigger event performs an action on multiple lights (ie: a group) instantly. If any action fails, it needs to be retried.
Using UDP, requiring a response (or an ack) introduces a noticeable delay in the subsequent requests as each request waits for a response before timeout.
Not requiring a response can end up with lights in the wrong state due to a dropped packet.
My current thoughts on options are:
- Never require a response, but use a GETSTATE call after the fact to ensure the change has taken place
- Refactor the code handling the response to make it non-blocking
- Investigate Async UDP calls
NB: Currently I’m not worrying about the lights’ IPs and just sending broadcasts using the header.target to match the correct mac address. Is there any foreseeable problem with this approach? Would specifying an IP result in a reduced delay, or greater chance of success?