Install The Software On Raspberry Pi

Setting Up Your Raspberry Pi

1. Run the below terminal commands to install PiRelay on your Raspberry Pi.

You MUST complete this step before the PiRelay App will work with your Raspberry Pi.

NOTE: It is recommended to run each command individually.

Commands to Install: WiringPi, Apache, PHP & Download the GPIO PHP File

sudo apt-get update
sudo apt-get install wiringpi -y
sudo apt-get install wiringpi apache2 libapache2-mod-php -y
sudo wget
sudo mv gpio.dl /var/www/html/gpio.php

Additional Commands for Raspberry Pi 4

NOTE: Raspberry Pi 4 Users will need to run the following commands in addition to the above to update WiringPi before it will work.

cd /tmp
sudo dpkg -i wiringpi-latest.deb

Setting Up Your Android Device

2. Download Pi Relay app from the Play Store here: PiRelay App - Play Store

Make sure your Pi and Android Device are on the same network. Then in the app settings you can define a custom Server URL. This is the network path to your Raspberry Pi. The default path is “http://raspberrypi/”, however you can define an IP address or a custom URL. If you want to use PiRelay over the internet then you will need to configure your own port forwarding on your router (By default PiRelay uses Apache2 on port 80).

That’s it… your Pi is now ready to use with PiRelay App to start switching or pulsing the status of your GPIO pins.