Skip to content

arek125/remote-GPIO-control-server

Repository files navigation

Remote GPIO control server

Application allows you to control GPIO port on Pi devices via android application client or build in www client.

Main features:

  • Control the states of output pins
  • Read the states of input pins
  • Control software PWM output pins
  • Link multiple pi devices
  • Create sequential execution chains through all linked pi devices
  • Define and run custom shell commands
  • Read/store data from sensors
  • Transmit or recive radio frequency codes with generic low-cost GPIO RF modules
  • Create automated actions to change output/pwm, execude chain sequence, transmit RF or run custom command, such actions can have multiple triggers through all linked pi devices with custom conjunction
  • Create android desktop widget for fast output change, read sensors value or execude chain sequence
  • Setup android notification base on output/input status or sensor value
Web client preview

Android client preview

Installation

Download and unpack last release

wget -O rgc-install.tar.gz https://github.com/arek125/remote-GPIO-control-server/releases/latest/download/rgc-install.tar.gz
tar -zxvf rgc-install.tar.gz
cd rgc

Install necessary packages

sudo apt-get update
sudo apt-get install python-dev python-crypto python-systemd python-pip postgresql libpq-dev postgresql-client 
sudo pip install psycopg2 psutil

Create postgresql user and database

sudo su postgres
createuser pi -P --interactive # set super user to yes
psql
CREATE DATABASE db_rgc;
#Ctrl+D 
#Ctrl+D 

Create systemd service

sudo chmod 644 rgc-setup.sh
sudo bash rgc-setup.sh

Configure server config

sudo nano rgc-config.ini # configure sql connection there and any other parameters as neded

Every time when above config is changed run:

sudo systemctl restart rgc.service

Keep time on server and client synchronized (diffrent timezones are supported).

Server control

Use commands to control server app:

sudo systemctl start rgc.service
sudo systemctl stop rgc.service
sudo systemctl restart rgc.service
sudo systemctl status rgc.service
journalctl -u rgc.service # to see logs in case of problems

Update

cd /home/pi # or go to rgc main folder destination
wget -O rgc-update.tar.gz https://github.com/arek125/remote-GPIO-control-server/releases/latest/download/rgc-update.tar.gz
tar -zxvf rgc-update.tar.gz
sudo systemctl restart rgc.service

Support

Tested and working on Raspberry Pi devices with Raspiain OS.

Tested and working with Banana Pi devices with this library.

Tested and working with Orange Pi Zero devices with this library. (Import replacement from "import RPi.GPIO as GPIO" to "import OPi.GPIO as GPIO" in file rgc-server.py is necessary)

Should work on similar devices/OS's but it requires a library RPi.GPIO (Raspbian OS already has it) or another based on it.

License

Remote GPIO control server is available under the MIT license.

Donation

If you like this project please consider a donation:

paypal