Raspberry Pi Robot that can be controlled via a website with a live streaming webcam using Flask
Adapted from James Poole's and Pablo Rogina's projects with changes as follows:
-
CamJam EduKit 3 instead of LD293 IC + proto-board. Controlled by gpiozero using CamJamKitRobot API
-
MJPG-streamer streaming application instead of motion. Since it's less resource intensive, video responsiveness and quality improved noticeably
-
Updated index.html page from Pablo Rogina's
-
Added automatic running and killing of MJPG-streamer using subprocess.Popen
-
Add catching of Ctrl-C using python signals with help from "Stack Overflow How do I capture SIGINT in Python?". Stops MJPG-streamer using Popen.terminate
Developed using VS Code with Visual Studio Code Remote - SSH extension, Python extension and Code Spell Checker extension.
VS Code can remotely develop on the Pi, but it doesn't work on the Pi Zero. Setup by:
- Install VS Code on the remote PC from Visual Studio Code
- Install Visual Studio Code Remote - SSH extension
- To do finish
https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md 'raspistill --help' todo finish
Based on Michel Deslierres' instructions and mjpg-streamer:
sudo apt-get install cmake libjpeg8-dev
sudo apt-get install gcc g++
cd
git clone [email protected]:jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental/
make
sudo make install
Get help with the Raspberry Pi input plug in: ` Test with:
mjpg_streamer -i "input_raspicam.so -hf -vf -fps 10" -o "output_http.so -w /usr/local/share/mjpg-streamer/www/" &
- http:\\<pi address>:8080/?action=stream
kill %1
Get input & output option help:
mjpg_streamer -i "input_raspicam.so --help"
mjpg_streamer -0 "output_http.so --help"
Important raspicam input parameters:
- [-fps | --framerate]...: set video framerate, default 5 frame/sec
From https://github.com/LegoChicken/WebControlledRobot:
cd
git clone [email protected]:LegoChicken/WebControlledRobot.git
cd WebControlledRobot
chmod a+rx app.py
# Make executable
./app.py
- Give a fixed size to the web stream.
- Improve LEGO strength
- Document camera above