Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 1.4 KB

File metadata and controls

69 lines (55 loc) · 1.4 KB

PiWebRobot

Using UV4L For Video Boardcasting and Flask.py For Web GPIO Contorl

Requirements

Install

  1. Please Install All Requriment Package above
  2. Copy /html/SimpleWebRTC.html to /usr/share/uv4l/www/SimpleWebRTC.html
  3. Copy /flask_GPIO to /home/pi/Documents/python/

Change UV4L Setting

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

Making flask_GPIO to Autoexecute On Boot

  1. cd init.d
cd /etc/init.d
sudo -E vim flask.sh
  1. 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
  1. Setting Autoexecute
sudo chmod +x flask.sh
sudo update-rc.d flask.sh defaults