Configuring Software for My NSLU2 Webcam

The pictures are coming in from my webcam now and I’m using a program called motion. It’s capable of storing pictures when a movement is detected in front of the webcam, but I have disabled this feature and configured it to take a picture every 60 seconds instead. motion has a small internal web server that can be accessed from the local intranet or from Internet. I’m planning on letting the NSLU2 upload the pictures to instead, but the local web server is a cool way to test if the camera is running. Here’s a print of my configuration file for motion:

$ cat motion.conf

# The program is run with motion motion.conf &
daemon off

# No debug messages
quiet on

# Path to webcam
videodevice /dev/video0

# Disable motion detection
output_all on

# Seconds between saving a picture
minimum_frame_time 60

# Picture details
width 640
height 480
quality 100

# Picture filename
jpeg_filename webcam

# The pictures are stored here
target_dir /home/thomas/motion/snapshots

# Local web server settings. Replace XXXX with desired port number.
webcam_port XXXX
webcam_localhost off
webcam_quality 50

This is the command I use for running motion:

$ motion motion.conf &
[1] 2147
[0] Processing thread 0 - config file motion.conf
[0] Motion 3.2.9 Started
[0] Thread 1 is from motion.conf
[1] Thread 1 started
[1] Not a V4L2 device?
[1] Using VIDEO_PALETTE_YUV420P palette
[1] Using V4L1
[1] Started stream webcam server in port XXXX
[1] File of type 1 saved to: /home/thomas/motion/snapshots/webcam.jpg

The picture is stored on the USB flash disk connected to the NSLU2.

The previous snapshot is overwritten when this particular configuration file is used, but it’s possible to add a time and date stamp to the filename and make a time lapse series of growing plants. I think it’s even possible for motion to collect the snapshot into a movie file. What a cool program 😀

Now I just need a way to get the picture uploaded to so you’ll be able to watch me goof around in my garden and throw leeks at the camera 😉

Leave a Reply

Your email address will not be published. Required fields are marked *