Skip to content

How to View Data

Claude Pageau edited this page Jun 30, 2017 · 21 revisions

View Console Verbose Logging

Edit/Review config.py using nano or menubox.sh to verify the following variable settings (defaults)

vervose = True
gui_window_on = False

then start speed-cam.py

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

When motion is being tracked the detailed logging information will be displayed.

View OpenCV Video Window

The opencv video window needs to run from the Raspberry Pi GUI Desktop. This can be done from an attached monitor or using a remote VNC session from another computer on the network.

Edit/Review config.py using nano or menubox.sh to verify the following variable settings (defaults)

gui_window_on = True    
show_thresh_on = True    
show_crop_on = False    (This is a color motion crop area and is optional)    

From the Raspberry Pi desktop open a terminal session. In the terminal session run speed-cam.py per the following

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

The opencv video windows should open and display the camera view with the motion area displayed in a stationary line box. When motion is being tracked it will be highlighted with a moving box (default) or center circle. See config.py motion settings for other variables to control text size etc.

When done reviewing camera video highlight the main video window and press q or press ctrl-c in the terminal window

It is recommended GUI desktop method be used for trouble shooting only since it will slow performance especially when using a VNC remote session.

View Using Web Browser

You can view data on another computer connected to the same local area network (LAN) as the RPI running speed-cam.py or from the RPI running speed-cam.py via the RPI desktop web browser. The easiest way to view data via a web browser is to use menubox.sh

  • Open SSH or desktop terminal session.

  • Start menubox.sh

    cd ~/rpi-speed-camera
    ./menubox.sh

^ Check settings to make sure variable log_data_to_file = True (default)

  • From the menu Start speed-cam.py and capture speed data. A PID will be indicate process is running.
  • Run the View CSV menu pick to review contents of the speed-cam.csv file
  • You must have a least 3 csv entries but more is better
  • Once there is csv and associated images run the Web Pages Menu Pick. This will generate html pages in the html folder.
  • Select and run Start webserver menu pick. On startup it will display a message showing the IP:port required to access the speed-cam,py data. Write this down.
  • From a computer web browser on the same local area network type the IP:port Eg 192.168.1.121:8080 or http://192.168.1.121:8080 in the URL box. If successful you will see the web pages for the speed camera. Selecting a right pane page link will display data in Left iframe pane. Click on image to view full size image in new browser tab.
  • You can bookmark the speed camera web link for easier future access (assuming the RPI IP address does not change)
  • To update the display rerun the menubox.sh Web Pages Menu Pick again. This will update the web pages with any new data and images.
  • You can modify the speed-cam webserver.py settings using the menubox.sh settings menu or by manually editing config.py using nano. webserver variable settings will be near the bottom of the config.py file.
  • When done you can stop the webserver.py and/or speed-cam.py from menubox.sh or exit and log out and the speed camera will continue to collect data after logging out of the ssh or terminal session since menubox.sh will start these processes in the background.
  • If you want to periodically update the html pages you will need to add a crontab entry to periodically run makehtml.py

How to Start on Boot