I am implementing a simple project with several Raspberry Pi 3s' connected to my home network. I hosted a web server using PHP on lighttpd server on one pi that I am calling my "central node".
I have a python script on that central node that reads some sensor information through the GPIO pins. Now, what I want to accomplish, is to obtain the sensor data from the other nodes on my network ( the other Pi 3s' apart from the central one ).
I thought about SSH remote execution from the central Pi to the other Pis' to run the script and get back the data. But that would be a problem since my router uses DHCP and the Pis' get assigned different IP Addresses each time. So there isn't a way to differentiate between them as such. Another way would be to SSH the Pi using their MAC addresses, but it being a Layer 2 protocol, wouldn't be usable outside the same network.
So what should I do in this scenario ? The data feed needs to be realtime to the central node. If necessary, I can host the webserver on a separate machine and use the Pis' only for data retrieval as well.