ChumbyCam

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…

Back on the paper trail

May 7th, 2008

I was horrified to see how long it’s been since I’ve released an update to Papercut. I do have some lame excuses like “work has been keeping me busy” but it’s time to get back on the paper trail. I was in the middle of fixing image rotation, which would allow photo-dodecahedra to be more meaningful.

Chumbotics - part 1

May 6th, 2008

A recent project I’ve had a lot of fun with involves using off-the-shelf components and some good old-fashioned software development.

It started out with my work at Chumby.com on the Flash Lite player. I needed to explore using a Flash movie for robotic control via RS-232. The outcome is what I have here.

Ingredients:

  1. Chumby. Cost: $180, shipping included. Available from chumby.com (I work for chumby.com btw)
  2. iRobot Create. Cost: $130 plus shipping from irobot.com, includes the serial cable. You’ll also need a rechargeable battery ($59) and charger (either $69 for the home base charger or $35 for the 12-hour brick charger). You can shell out $230 for the create, command and charge package, which will also include the ATMel-based command module (which you don’t need for this project but can be used for other robot projects). Total cost will be $230 minimum.
  3. USB serial cable. Cost: $15-20 from Fry’s. The Q-stor adapter is one of the cheaper ones they stock and is $20 - there used to be a $15 GQ USB serial cable that also works. Any USB serial adapter that uses the pl2303 driver in linux will work.
  4. 9.6v rechargeable battery for the Chumby. You can get a 1200mah Ni-cad battery pack from Fry’s used for R/C cars for about $15 (with charger, $17). You’ll need to connect it to the 9V battery connector on the Chumby, which is accessible through the velcro opening on the bottom of the chumby. You’ll need to do a little cut and crimp to splice a 9V battery connector onto the battery pack. Remember that the final result needs to have the same polarity as a battery, which means the color-coded red and black wires may be opposite from the wires on the 9.6v battery pack. Check the polarity of the final result to make sure it comes out the same as a regular 9V battery:

    Correct polarity of 9V battery connector

That’s it for the hardware components. The iRobot Create has a DB-25 connector in the cargo bay with a lot of potential for expansion. The next post will cover putting it together and doing some basic tests.