Skip to content
Tim Cope edited this page Jul 10, 2020 · 4 revisions

Welcome to the python-flask-rpgpio wiki!

Prerequisites

If you have installed Raspbian Stretch with desktop and recommended software, then you have what you need already installed; Git, RPi.GPIO and Python.

Installation

Clone this repo using git, or by downloading and extracting the zip file.

Starting the Web App

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.

Basics

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 OutputDevices, 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.

Clone this wiki locally