My project has a server and several client Pis on a local network. The goal is to have the server sends commands to all active/online client Pis.
To facilitate this, my idea is that once a client has booted, it checks in to the server so the server knows it's online and where to find it. I've avoided the nmap solution in this post because I feel there's a more elegant solution since the client Pis can be running any helpful identification service to make this easier.
My current prototype has the server sending UDP broadcast messages. The client Pis run a listening script that, upon receiving the broadcast, send a message back to the ip of the broadcast (the address of the server) with the appropriate info. The server then knows where to send commands to clients once they've checked in. (Weird side note, my Pi client receives/recognizes roughly only 5% of the broadcast messages sent out).
What is the better design decision? This post suggests using UPnP / DLAN, however the only examples I've found are for media streaming devices (which seems to go far beyond the needs / complexity of my project).
The other option I've found is using Bonjour. The server would configure a host name that all clients would know and be able to send messages to (essentially saying they're alive and online). Additionally, the client Pis could setup their own hostnames.
Please let me know if one makes more sense for more application or if there is something else I should research. I appreciate any advice!