-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the python-flask-rpgpio wiki!
If you have installed Raspbian Stretch with desktop and recommended software, then you have what you need already installed; Git, RPi.GPIO and Python.
Clone this repo using git, or by downloading and extracting the zip file.
Open the file flaskapp.py
using Thorny and click 'Run'. Or, use the command-line if you prefer, python flaskapp.py
. The service will start on http://localhost:5000
.
Note: This will only work on a Raspberry Pi due to a check done by the Rpi.GPIO library.
The API is in the file flaskblueprint.py
.
A web app flaskapp.py
is provided to demonstrate the usage. The buttons on the page are setup as OutputDevice
s, meaning that they can be turned on and off by alternating HIGH
and LOW
signals.
In the Relay
example, the user can toggle on and off the different relays if the wiring and parts diagrams are followed.