This program allows you to turn on/off a relay connected to a Raspberry Pi by a gpio port. To configure and communicate with the service and use the relays, it is necessary a client program. Here is a list of clients.
- Raspberry Pi or compatible
- A Gnu/Linux system installed (LibreELEC OS
recommended, if you want to install this in a
different OS, please check the Gpio path in the notes)
- Python 3.x
- Systemd
Just download the ZIP, and run /install.sh as superuser:
su
bash install.sh
# or
sudo bash install.sh
This will create a daemon in the system that is listening for new connections on the port 10000.
cd /usr/lib/gcr-server
sudo bash uninstall.sh
To start the service manually
sudo systemctl start gcr-server.service
To stop the service
sudo systemctl stop gcr-server.service
To restart the service
sudo systemctl restart gcr-server.service
It is necessary a client to add relays and configure their gpio ports.
GCR Android client (this is not a release version) More clients are incoming ;)
Used by the socket for the communication with the app.
By default: 10000
You can change it from SOCKET_PORT in /service.py
It depends on the system, it has the LibreELEC path by default.
By default: /sys/class/gpio
You can change it from GPIO_DIRECTORY_NAME in /lib/repository/gpio.py
This is an example about how to connect a relay to a Raspberry Pi.
In this example the relay is connected on port Gpio 7. Now, from the client application, it is necessary to configure (only once, the first time), a relay connected on port 7.