Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/redduckbot/raspberrypi-led-web-app

Locally controlling LED lights from a web browser using Raspberry PI and python Flask.
https://github.com/redduckbot/raspberrypi-led-web-app

inter-process-communication opencv python-flask raspberry-pi tcp-client tcp-server udp-client udp-server web-application

Last synced: 17 days ago
JSON representation

Locally controlling LED lights from a web browser using Raspberry PI and python Flask.

Awesome Lists containing this project

README

        

# Simple LED Web Application

Locally control three LEDs through a web browser, and get a live video stream
of any changes made. The setup involves a web server made using the python
framework Flask, Raspberry PI 3B+, and python OpenCV to operate a USB camera.



## Architecture



The above diagram shows how the project's software components were setup, involving three servers, who are started in "main.py", and a program running on the Raspberry PI, called "control_LEDs.py", containing two threads that are responsible for operating the USB camera and LEDs.

## Running the Application
Before starting the programs, connect the USB camera and LEDs to the Raspberry PI's GPIO pins:
- Red ---> GPIO22
- Yellow ---> GPIO27
- Green ---> GPIO17

Install require python packages:
```
pip install -r ./docs/requirements.txt
```
Next, identify the IP address for your machine that you'll be running the servers on. Then, in the files "main.py", "control_LEDs.py", and "server_LED.py", set the global variable "HOST" to this IP. Now the programs can be started.

Start the servers on the computer hosting them:
```
python main.py
```

Then, start "control_LEDs.py" on the Raspberry PI.

Finally, access a browser from any computer on your local network and enter the
following into the omni box: "[HOST IP address]:9999"

When done with the application, all the running programs can be closed by hitting Ctrl + c.