Moving My Garden Webcam

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.

Fixed the Garden Webcam Connection

My NSLU2 garden webcam setup is working now with the original USB cable on the camera soldered together with an extra 3 m (10 ft) long USB extension cable. Now the link is stable and the data output is consistent:

$ v4l-info 

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
    name                    : "OV511 USB Camera"
    type                    : 0x201 [CAPTURE,SUBCAPTURE]
    channels                : 1
    audios                  : 0
    maxwidth                : 640
    maxheight               : 480
    minwidth                : 64
    minheight               : 48

channels
    VIDIOCGCHAN(0)
    channel                 : 0
    name                    : "Camera"
    tuners                  : 0
    flags                   : 0x0 []
    type                    : CAMERA
    norm                    : 0

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
ioctl VIDIOCGAUDIO: Invalid argument

picture
    VIDIOCGPICT
    brightness              : 0
    hue                     : 30464
    colour                  : 40960
    contrast                : 0
    whiteness               : 26880
    depth                   : 12
    palette                 : YUV420

buffer
    VIDIOCGFBUF
    base                    : (nil)
    height                  : 0
    width                   : 0
    depth                   : 0
    bytesperline            : 0

window
    VIDIOCGWIN
    x                       : 0
    y                       : 0
    width                   : 640
    height                  : 480
    chromakey               : 0
    flags                   : 30

But I lost 3 m (10 ft) of length on the cable so I’ll have to move the garden webcam closer to the house to be able to reach the NSLU2.

Debugging My NSLU2 Webcam Setup

In order to get pictures from my garden webcam onto my NSLU2 computer I installed a program called motion, which is supposed to be able grab pictures from the webcam. I tried several times to get a picture but I got lots of strange errors, so I installed the package v4l-conf to get access to v4l-info. This program is for debugging drivers, but it also produced strange errors. Sometimes the webcam was even gone:

$ v4l-info
open /dev/video0: No such file or directory

Sometimes the webcam would show up but only partial information would be available:

$ v4l-info

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
	name                    : "OV511 USB Camera"
	type                    : 0x201 [CAPTURE,SUBCAPTURE]
	channels                : 1
	audios                  : 0
	maxwidth                : 640
	maxheight               : 480
	minwidth                : 64
	minheight               : 48

channels
ioctl VIDIOCGCHAN: Input/output error

tuner
ioctl VIDIOCGTUNER: Input/output error

audio
ioctl VIDIOCGAUDIO: Input/output error

picture
ioctl VIDIOCGPICT: Input/output error

buffer
ioctl VIDIOCGFBUF: Input/output error

window
ioctl VIDIOCGWIN: Input/output error

Sometimes the missing information would be available but not the previous information:

$ v4l-info

...

channels
    VIDIOCGCHAN(0)
    channel                 : 0
    name                    : "Camera"
    tuners                  : 0
    flags                   : 0x0 []
    type                    : CAMERA
    norm                    : 0

...

This smells like a hardware fault, and I don’t think I have to look further than my crappy duct tape USB extension cable.

The strange thing is that the USB cable and webcam works on my laptop, although there’s a lot of noise in the picture.

Below is what you can expect, so be warned once I get this thing up and running -

The Tomato Thief Strikes Again :D :

“But I’m only trying to provide food for my family, he told the police.