Posts Tagged ‘webcam’

ChumbyCam

Sunday, June 22nd, 2008
Another Chumby firmware validation challenge developed into an interesting project.

The free http://justin.tv service allows you to connect any webcam for broadcast using a Flash 9 widget that takes your mic and webcam input and uploads it for rebroadcast. These are features that aren’t currently supported in Flash Lite, so typically it would be used with a Linux or Windoze desktop machine.

There were some issues to validate with webcam display which turned out to be related to an unrelated problem.

I took it one step further and tried to use Chumby to display the output of an IP webcam. I chose the D-Link? Ethernet-connected DCS-900 model, largely because it was cheap and simple. It’s around $90 USD and offers a built-in http connection. It offers java and activex viewing of the image stream but those didn’t work right out of the box, and I didn’t have 5 minutes to rtfm so I might have missed some vital step. But the jpeg feed works just fine.

And I had a good test opportunity in-house (literally): a 2.5-year-old boy who presents a potty training challenge. An early riser, he gets to watch PBS Sprout for a commercial-free hour or so while squatting on his pot, but likes to get up. This is also my time for getting some work done in the next room, so I wanted to use Chumby as a remote monitor.

Knowing the IP address of the webcam, I could write this script on the Chumby, and start it by stopping flashplayer and running the script:

stop_control_panel
/mnt/usb/bin/showcam >/dev/null 2>&1

Here’s the script. It’s slightly more elaborate than needed since it caches the last 30 images. Since I’m continually invoking wget I don’t need to do anything to avoid caching – wget does not do any persistent caching by default…

#!/bin/sh
CAMIP=192.168.1.127
CAMPORT=80

SERNO=0
SEQ=$(date +'%Y-%m-%d-%H%M')
mkdir /tmp/$SEQ

while :
do
if wget -O /tmp/${SEQ}/img${SERNO}.jpg http://${CAMIP}:${CAMPORT}/IMAGE.JPG
then
imgtool /tmp/${SEQ}/img${SERNO}.jpg
else
echo "Unable to fetch image"
exit 1
fi
SERNO=$(expr ${SERNO} \+ 1)
[ ${SERNO} -gt 30 ] && SERNO=0
done
Oops, gotta run… my little boy just got up and I don’t feel like carpet-cleaning right now…
I’ve also put this on my wiki under Chumby-related…