arek125 / remote-GPIO-control-server

Control GPIO ports via Android client or www app
MIT License
6 stars 3 forks source link

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:

Android client preview ![](androidpreview.gif)

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