Skip to content

Admin and Settings

Claude Pageau edited this page Sep 6, 2019 · 47 revisions

menubox.sh is a whiptail menuing system that makes configuration and administration easier

Manage Settings using menubox.sh

You can use menubox.sh to manage most aspects of running speed-cam.py and webserver.py. To run menubox.sh from logged in SSH or RPI desktop terminal session perform the following commands

cd ~/speed-camera
./menubox.sh

NOTE: If you do not get menu box lines displayed in a putty SSH session. Open the top left putty window icon and select, Change Settings, Window, Translation, UTF-8 from pull down menu, then apply. To make this the default putty, prior to apply select session, default then apply.

Navigate menu using keyboard up/down arrow keys or press menu option letter to highlight menu item, then press Enter key to select option. Alternatively you can highlight menu item then press tab highlight selection, then press Enter key.

Screen shot of speed-cam main menu menubox main menu

Configuration Settings

speed-cam.py and webserver.py variable values are stored in the config.py file and are imported when speed-cam.py or webserver.py is run. If plugins are enabled in the config.py file then the appropriate plugin file will be loaded and the specified plugin settings will override the matching config.py variable setting. Use menubox.sh or nano editor to modify the config.py and/or plugin settings per the comments.
To edit config.py using nano editor perform the following from SSH or console session.

cd ~/speed-camera
nano config.py

Most settings will be OK and should not need to be changed. Others may need to be fine tuned. The openCV settings most likely won't need to be changed unless you are familiar with them.

NOTE: if log_data_to_CSV is set, it will save tracking data to a speed-cam.csv file in the same folder as speed-cam.py eg speed-cam.csv This file is used for generating web pages using the makehtml.py script.

How to Manage Plugins

To accommodate different speed camera requirements there are plugin files. The default setting uses the picam480.py

  • picam240 - This takes 240p SD standard definition video stream and 320x240 speed images that is best choice for single core RPI (Use this with 320x240 resolution web cam's). Files are stored in media/images in subfolders by max files.
  • picam480 and webcam480 default - This takes 480p SD standard definition video stream and 640x480 speed images that is best with a single core RPI (Use this with 640x480 resolution web cam's) Files are stored in media/images in subfolders by max files.
  • picam720 and webcam720 - This takes a 720p HD high definition video stream and 1280x720 speed images that works best with a quad core RPI
  • picam1080 Experimental - This takes a 1080p HD video stream and 1920x1080 speed images that works best with a quad core RPI. Note performance will not be the best. Files are stored in media/images in subfolders by max files.
  • secpicam480 and secwebcam480 - Security Camera Plugins This takes 480p SD standard definition video stream and 640x480 speed images designed for security camera usage that is best with a single core RPI (Use this with 640x480 resolution web cam's). This puts files in media/security and recent in media/recent/security with No Sub Folders. There is an rclone-security-sync-recent.sh that will sync files to a remote storage drive. NOTE: No Calibration is required since this feature is using motion tracking and not utilizing speed data.

To change or disable a plugin edit config.py using menubox.sh SETTINGS menu or nano file directly to change settings below as required.

# Plugins overlay the config.py variable settings
# -----------------------------------------------
pluginEnable = True
pluginName = "picam480"   # Specify filename in plugins subfolder without .py extension per below
                          # picam240, picam480, picam720, picam1080, webcam480, webcam720
                          # secpicam480, secwebcam480

If a plugin file does not have a variable you want to manage for the plugin, then copy the appropriate variable from config.py and paste it into the desired plugin. Change the variable setting and it will override the config.py value if pluginEnable = True and pluginName = the plugin name you want to use.

You can create your own plugin or edit an existing one.
IMPORTANT: Do NOT delete the init.py file since it is required for plugins to be imported.

How to Calibrate