77Views4Replies

Author Options:

Control over Multiple Raspberry Pis GPIO with single web-interface, running on a computer Answered

Hi,

I want to control the GPIO 5 Raspberry Pis, using a single website (running locally on the pc). Is it as simple as writing a small script on each pi that waits for incoming commands (via the network)?

Could someone point me in the right direction, possibly to a tutorial where they use a separate webpage (not using the pi as a web server) to control GPIO?

Thanks 

Discussions

0
None
rocketsurgery

2 years ago

There are many ways to implement this. It depends what you are hoping to do with each pi. A simple python script or application in c could poll a controlling webpage/data file (with values or GPIO settings etc) hosted on your pc. Then you simply have a web gui interface to write/display the data file. The script/application could be the same for each pi depending on their configuration. I assume you would also want to have the script/app on each pi update the file regarding sensors/readings etc... again adding this to the script would be trivial. If you are doing more advanced projects have a look at the OpenHAB Project.

0
None
joearkayjoearkay

Answer 2 years ago

Have you seen any good instructables for this? Most just detail OpenHAB ON the RaspberryPi, whereas I want the two separate.

0
None
rocketsurgeryjoearkay

Answer 2 years ago

Not sure what your setup is actually requiring but it sounds like you would like to run OpenHAB on your PC and then have that connected to your raspberry pis using something like the MQTT protocol to communicate. To do this you can install the Mosquitto MQTT Broker on your pis. You will need to install the MQTT binding bundle (an optional download for OpenHAB) but basically this will allow OpenHAB to act as an MQTT client so that openHAB items can send and receive MQTT messages to and from the brokers (your pis).