Using UV4L For Video Boardcasting and Flask.py For Web GPIO Contorl
- Please Install All Requriment Package above
- Copy /html/SimpleWebRTC.html to /usr/share/uv4l/www/SimpleWebRTC.html
- Copy /flask_GPIO to /home/pi/Documents/python/
sudo nano /etc/uv4l/uv4l-raspicam.conf
--------------another line-------------
server-option = --port=8080
---------------another line-----------
server-option = --enable-www-server=yes
# server-option = --www-root-path=/usr/share/uv4l/www/
server-option = --www-index-file=SimpleWebRTC.html
server-option = --www-port=80
- cd init.d
cd /etc/init.d
sudo -E vim flask.sh
- Edit flask.sh
#!/bin/sh
# /etc/init.d/flask.sh
case "$1" in
start)
echo "StartFlask"
nohup python /home/pi/Documents/python/flask_GPIO/flask-gpio.py &
;;
stop)
echo "StopFlask"
killall python
;;
*)
echo "Usage /etc/init.d/flask.sh{start|stop}"
exit 1
;;
esac
exit 0
- Setting Autoexecute
sudo chmod +x flask.sh
sudo update-rc.d flask.sh defaults