Happy Farming . com
How to Grow Your Own Food
-
Oct 21 2010
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 happyfarming.com 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] ffmpeg LIBAVCODEC_BUILD 3355136 LIBAVFORMAT_BUILD 3409664 [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 happyfarming.com so you’ll be able to watch me goof around in my garden and throw leeks at the camera
If you enjoyed this post, make sure you subscribe to my RSS feed!
Related posts:
One Response to “Configuring Software for My NSLU2 Webcam”
-
I’d need to check with you here. Which is not something I generally do! I get pleasure from reading a post which will make people today believe. Also, thanks for permitting me to comment!
Leave a Reply
-
-
Oct 20 2010
I had to shorten the USB cable to make my webcam work properly or I would get lots of errors when I tried to grab images. With a shorter cable I had to move the webcam closer to the window and place it on the roof instead:

Here’s the webcam looking down on the garden. The USB cable is going in through the window but it’s still possible to close the window locking the cable into position:

If you look closely you can find the camera on top of the small roof to the left of the house:

There’s not many vegetables left in my garden at this moment although the following plants are still going strong despite the decreasing temperature: Green manure, leeks, parsnips, strawberries and sunflowers.
I tried to get the first picture from the webcam with my NSLU2 computer and installed a recorder program called streamer:
apt-get install streamer
This is the command I used:
$ streamer -c /dev/video0 -b 16 -o webcamfile.jpg
and got this picture:

I have to go work on the brightness setting
On my laptop there’s a calibration going on automatically but I guess I have to adjust the settings manually on my NSLU2.
Subscribe in RSS reader
Subscribe to email newsletter
About
-
Are you ready to grow your own food? Take a tour through my archives and learn how I did it!

Recent Articles
- Six Reasons to Harvest Rainwater
- Are Your Tomato Plant Leaves Showing These Symptoms?
- Natural Bean Plant Trellis for Runner Beans
- Aquaponic Tomato Plants
- Aquaponics Tanks
- Raised Bed Designs
- Potato Containers and a Simple Potato Salad
- Aquaponics Plant Germination and Algae Eating Fish
- Guy Clark – Homegrown Tomatoes
- Bamboo Sticks for Tomato Plants