Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/redduckbot/raspberrypi-led-web-app
- Owner: RedDuckBot
- Created: 2024-07-21T23:39:25.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T21:21:26.000Z (5 months ago)
- Last Synced: 2024-12-06T00:13:16.394Z (17 days ago)
- Topics: inter-process-communication, opencv, python-flask, raspberry-pi, tcp-client, tcp-server, udp-client, udp-server, web-application
- Language: Python
- Homepage:
- Size: 94.2 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 ---> GPIO17Install 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.