Skip to content

How to Run

Claude Pageau edited this page Jan 20, 2018 · 29 revisions

Admin with menubox.sh

If you do not wish to see speed camera verbose tracking data you can run menubox.sh

cd ~/speed-camera
./menubox.sh

How to Run and view verbose log messages

Edit config.py and verify variable verbose = True

cd ~/speed-camera
./speed-cam.py

How to Run

To run speed-cam.py as a background task or on boot from /etc/rc.local then

cd ~/speed-camera
./speed-cam.sh start

or to run on boot edit /etc/rc.local file using nano editor per command below

sudo nano /etc/rc.local

Then add line below before the exit line then ctrl-x y to save and reboot to test

/home/pi/speed-camera/speed-cam.sh start
exit 0    

Edit the speed-cam.sh script to suit your needs per comments.
Note you may need to change the sleep delay time if rc.local does not run script successfully at boot, since services may need more time to start.

To Run using python3 perform the following (Note you must have opencv setup for python3) NOTE: IMHO operation under python3 is not faster compared to python2. I recommend you run under python2

sudo apt-get install -y python3-pip  
sudo pip-3.2 install -y Pillow
python3 ./speed-cam.py

if you get opengl error then install support library per following command then reboot.

sudo apt-get install libgl1-mesa-dri  

also on raspberry pi 3's activate opengl support using

sudo raspi-config,

From 9 Advanced Options select AA GL Driver then enable driver and reboot

You can also use git clone to copy the files to your RPI.

cd ~
git clone https://github.com/pageauc/rpi-speed-camera.git

The speed-cam files will be in the /home/pi/rpi-speed-camera folder. You can then move them to another location if you wish.

Note A default images folder will be created to store jpg speed photos. There is an image_path variable in the config.py file. Use nano editor to change path and/or other variables as desired.

Use the calibrate option and follow instructions below to calculate an accurate value for IMAGE_VIEW_FT variable in the speed_settings.py

How to Change Settings