UMN CDMS Wiki archive
start › cdms › hardware › webcams

Webcams

There are several webcams in lab that can be used to monitor various things. One way is to plug them into the windows laptop and use the Camera app to take images periodically. Another is to use the webcamAutomater script on a linux machine.

webcamAutomater

To use webcams with the linux machines, you need to be the user logged in on the machine they are connected to.

The most recent version of this code can be found at https://github.com/nick-mast/webcamAutomater. A publicly accessible version is installed at /data/chocula/k100/webcam/webcamAutomater . The usage of this code can be seen by running

python webcamAutomater.py --help

For example, to take a single image using the webcam mounted at /dev/video0 , and save a copy in …/webcamAutomater/images, run the command

python webcamAutomater.py -single -save_image -device /dev/video0

A good way to take images of the main bath level and use them to update the K100 Status Page is to add the following line to the crontab of the user logged into the same machine the cameras are connected to:

*/5 * * * * source /home/mast/.bashrc >/dev/null 2>&1;cd /home/mast/cdms/webcam/; python webcamAutomater.py -single -update_website -device /dev/video0 >/dev/null 2>&1

This will take a single image with the webcam connected at /dev/video0 and post it to the website.

This code can also be used to take and save many images in rapid succession. This is useful when monitoring the recovery meter during a LHe transfer. Such a command would look like:

python webcamAutomater.py -device /dev/video1 -delay_min 0.033 -total_time_hr 2 -save_images

This will save an image every ~2 sec and save it to /data/chocula/k100/webcam/webcamAutomater/images with a date/time filename.

current location

Currently the webcam automater can be found at /data/chocula/k100/webcam