I have Two or more RPIs where one is places in a different building with a few buttons. The other has to get the value from the first and play a sound if one of the buttons is pushed on the first.

How do I get value that a button is pushed from the first RPI on the Second RPI? I'm new here.

Currently using Python. They are connected to my local Network and plaining to have more RPIs connected in different buildings.

  • Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. Related (but imo not a dupe as other solutions might apply): raspberrypi.stackexchange.com/q/29784/19949
    – Ghanima
    Oct 17, 2019 at 19:15
  • 1
    You should look at publishing the button status from the first RPi on an MQTT topic that the second RPi can subscribe to. One RPi will need to run a broker like Mosquitto, RabbitMQ or HiveMQ. hivemq.com/blog/how-to-get-started-with-mqtt
    – Dougie
    Oct 17, 2019 at 19:49
  • 1
    @David Jr Wollmann, Ah, let me see. Your following comment is a bit too vague: "multiple Rpis on multple buildings LAN". Is you LAN Wifi or Cat5? If Wifi, are they 500m+ apart? Your question starts with buttons. Will the buttons become text messages, and streaming audios and video? If you start with python, then you can consider python modules http, ftp, tcp, utp, mqtt, ... If you are new to GPIO, I would suggest to start newbie exercises on UART to warm up, such as this: (1) Open two serial ports, Port 1, using on Rpi board serial TxD, RxD pins. Port 2 using USB to serial, / to continue,
    – tlfong01
    Oct 18, 2019 at 1:31
  • 1
    @David Jr Wollmann, I start with the stupid, point to point, non many to many wired, short distance (100m) network. But once you have gained some newbie knowledge nad skills, you can "easily" upgrade your stupid wire serial network to a humble Bluetooth wireless point to point, but at least one to many network (ok still 10m PAN). But you only need one cheapy (US$1 or 2) "Bluetooth serial module" to enable your Rpi to talk to an Android smart phone (with Bluetooh serial app) to transfer text messages at low speed. Of course you can always upgrade, and 5G is coming to (my) town 2020Q2, ...
    – tlfong01
    Oct 18, 2019 at 1:42
  • I'm using Enet Cat6 through a switch with router, I can get the button to work on one RPI, now I need to send that value to the Main RPI. Will include multiple RPI's sending button clicks to the Main RPI. Oct 18, 2019 at 18:40

2 Answers 2


Use a RF422MHz module or NRF Module with both pi. Use the HT12D and HT12E as decoder encoder for networking. This is how you can do this.


The pigpio Python module allows you to control and monitor the GPIO of multiple Pis over a network.

Each networked Pi must be running the pigpio daemon.

You can use raspi-config on Raspbian to enable the pigpio daemon (Interfacing Options -> Remote GPIO Enable/Disable remote access to GPIO pins).

The controlling Python script can be running on a Windows, Mac, or Linux machine, actually any machine which supports Python.

The same functionality is available from the Raspberry Pi Foundation's gpiozero Python module. See the chapters on Remote GPIO.

All the tools are pre-installed on full Raspbian builds. For Raspbian Lite you would need to download pigpio using the following commands.

sudo apt install pigpio python-pigpio python3-pigpio

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.