Last year I installed a device at our cabin in the Norwegian mountains that allows me to send an SMS to the device and read the outside/inside temperatures and turn on a kerosene heater. This makes it possible for us to come up on Friday evening to a warm cabin. It makes a big difference to the comfort of weekend visits.
My father and I have also dreamed about a webcam that makes it possible to see how much snow is up there. The cabin sometimes gets almost completely covered in snow.
Surfing the internet I came across the Gumstix computer (www.gumstix.com), which is a really tiny computer the size of a gum pack (20x80mm). Gumstix lets you run Linux and has a PXA270 CPU which is also used in lots of PDAs and cellphones. Importantly, it doesn’t use much power. You can run it with a current of less than 0.1A, which is essential when running it from a solar cell powered battery. It also supports USB and would let me connect standard webcams to it.
Cool… I ordered one immediately. This was what I ordered:
- Verdex Motherboard
- Console-VX Expansion board
- Null modem serial cable
- 5V power adapter
This is what I should have ordered in addition:
- USB Gender Changer (turned out to be more difficult to find than I thought)
- Screws and connection kit (turned out to be much more expensive locally)
And this is what I wanted to order, but wasn’t available:
- GSM expansion card (in this project, I ended up using an old phone I had)
- LCD Display
The shipment was with UPS and arrived in Norway within 5-6 days. The price for what I ordered was not too bad, around $200.
My first thought when I opened up the box was surprise. The motherboard was so much smaller than I had thought. It’s really tiny. The box I had already bought to put the board in turned out to be much too big. On the picture, the motherboard (the computer itself) is placed on top the console-vx card which is used to connect to USB and serial. As you can see, the board on top is very small. The board on the bottom is a bit larger.
The motherboard has 3 connectors and I didn’t venture into connecting directly with these. I’m sure there are lots of exciting projects that could be implemented.
I connected it up, and basic linux worked out of the box. But I had to do a few things to get my project finished:
- Install a new uBoot (the boot manager)
- Compile and install a new Kernel (activating the video for linux drivers, webcam drivers, some other USB drivers and possibility to turn down the frequency of the board)
- Compile and install a new file system with more applications. Mainly these could be selected from the SDK that is provided by Gumstix. Some had to be installed from third party download sites. I removed some of the programsI didn’t need and added some that I did need. I can’t remember the exact list, but I at least added crond (part of the busybox configuration, which I didn’t find how to edit in the main menuconfig application).
- Set up crond in the startup script and make it read from /etc/crontab.d/ instead of the /var/spool directory which gets wiped every boot.
- Add some more applications not available in the Gumstix buildroot:
- ‘motion’ to capture images and
- ‘curl’ to upload pictures to a website. I also tried scp to copy which also worked.
- SMS Tools for receiving SMS. Didn’t actually use this in the end.
- Had to do the above a few times to get the exact package right.
- Tried to install Java (jamvm and classpath), but it seemed to have a network problem when running the application. Found the problem with a possible fix described on the internet. Plan was to use it for transfering images, but I used curl for that in the end instead.
- Mount it in a box. That was not easy, but second time around I guess it would have been. I ended up drilling holes in the box and putting the screws through that. There are probably better ways. The screws are sooooo thin! I think 1.4mm diameter fits, but I bought 1mm ones that turned out to be obscenely expensive.
- Connect a webcam (Logitech QuickCam Pro 4000 Webcam) and a SonyEricsson W800i mobile, both through USB. I used an external USB Hub that was powered through the USB port from the Verdex board.
- Set up the Verdex to run at 100MHz instead of the standard 400MHz. Fast enough for this application, and uses less power. (I ran the following:
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 99533 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq )
- Made a cron script that does the following regularly:
- pppd call gprs (calls internet)
- motion & (starts image capture)
- killall motion (kills motion again)
- copies the file to my webserver using curl and a php script on the web server
- disconnects pppd
I bought a 12V to 4.5V switching regulator (meant to be run in a car cigarette lighter) for powering the computer at the cabin. The cabin does not have normal 220V electricity up there, only solar cell, so using little power is critical.
The unit uses 0.35A when all devices are connected. That’s a bit too much. I disconnected the USB devices, and the power consumption was down to something like 0.1-0.03A. Turns out the webcam uses more than 0.2A.
That would be a problem, but then I realized that the device I installed last year (for turning on the heater via GSM) has a timer function and a relay that can turn a device on and off during the day. So I’m planning to use that external device to let my new linux based computer run for only one hour every day, so this power consumption won’t be a problem. If I didn’t have this opportunity, the solution would probably have been to make a relay that’s controlled by the CPU GPIO outputs and turns off the USB power when those devices are not needed. Could be a cool future extension.
The webcam computer is standing there now taking lots of webcam pictures
Here’s a picture of it next to the w800i and an N95 for size comparison.
Thanks to Gumstix for a really cool product and to the mailing list for good support. There seem to be plenty of other fun projects people are using the same device for, and hopefully I’ll come up with something new I can use this device for later. Maybe a ‘geek phone’? [After testing the iPhone, I lost some of the inspiration to do this, as it's really difficult to make something better. I'll see if I'll pick that up later orsomething else. ]
The webcam is up and running and works well. Here’s an example picture, which probably doesn’t mean that much to you, but the picture will show how much snow there is + shows a bit of the sky.