NOTE DISCLAIMER: this is a "proof of concept" with no support, requiring some expertise.
Ingredients
You'll need the following:
- An NSLU2, which is one of the least expensive ARM-processor appliances with a 10/100 Ethernet port, two USB 2.0 ports, a 133 MHz processor, 32MB RAM, and 8MB flash memory used to store the operating system. It draws about 500-700 milliWatts, has no moving parts or fans, and has ample computing power for basestation needs. The USB ports have the potential to attach Telosb. Pictures of the unit (external and internal) appear below.
- However, the NSLU2 doesn't come "out of the box" ready to be a basestation. You'll need to install a new operating system (a version of Linux) and some supporting tools. Please consult the web site http://www.nslu2-linux.org to learn more about this.
- You'll need a Linux (or perhaps a BSD, Mac, or other Unix) workstation, such as a laptop, to install and manage the NSLU2. You should have about two gigabytes available if you want to build everything, but it's OK to skip that initially and just try my basic system, in which case you'd need under 10MB to install.
- A TinyOS installation (I used Tinyos 2.x).
- A pair of Telosb motes for testing.
- An Ethernet hub and some Ethernet cables; or, you can do what I did, and use an Ethernet cross-over cable.
Recipe
- Read the instructions at http://www.nslu2-linux.org, and download some version of "upslug2", which is a utility to reprogram an NSLU2.
The usual recipe for installing Unslung consists of (1) rewriting the program flash memory of the NSLU2, and then (2) moving the root file system from flash memory to a hard drive (attached via USB to the NSLU2) or to a USB flash disk. But remember, I'm trying to keep costs down (so you don't need to occupy another USB slot for a flash disk); also, inserting a flash disk in one USB slot and a mote in the other USB slot is a tight fit and may limit your options for future USB needs).The version of Linux used for this version of TOSBaser is called SlugOS/BE. The root file system has been modified so that a serial forwarder, expecting a Telosb mote running the BaseStation application, is attached to a USB, when the NSLU2 boots. Automatically, the serial forwarder starts and waits on port 9001 for a connection.
- To install the new NSLU2 software, here are the steps:
- On your laptop or workstation, enable a subnet for the NSLU2: its default IP address is 192.168.1.77, and I found the following command does the trick (as root, of course):
That gives eth0 an alternate IP number (in addition to whatever other IP number it already has for DHCP or whatever).ifconfig eth0:1 192.168.1.12
- Connect the NSLU2 and your workstation via a hub or a crossover cable. The NSLU2 should be powered off at this point.
- Put a toothpick into the back of the NSLU2 (the reset button), then power the NSLU2 on, keeping the reset button pressed, and watch until the Ready/Status light turns red -- then take out the toothpick. The Ready/Status light will alternate between red and green, meaning that the NSLU2 awaits a new flash image.
- Executed as root, the command
should list all NSLU2's waiting to be flashed (of course, you only have one, so it should be listed)../upslug2
- Executed again as root, the command
The upslug2 program has a nice visual display of its progress as it rewrites the flash. When it finishes, the NSLU2 reboots../upslug2 --image=TOSBaser.bin
- After the NSLU2 reboots, wait for the beep signalling it is ready. Then try the command ssh root@192.168.1.77 and log in. If you hear some beeping, it is the script running the serial forwarder complaining that it can't find a mote. The password for logging in is "opeNSLUg" (but without the quotes). When you're logged in, look at what's in /root to see the scripts.
- To follow the recipe for installing a new flash image onto the NSLU2, you'll need to download the TOSBaser image, which is just a small modification to SlugOS/BE. Download it here (right-click, save as). To get the user and password for this download, you'll have to convince me that you won't sue me if you break your NSLU2.
- Program your two telos motes, one with RadioCountToLeds, and the other with BaseStation. For instance,
(I assume you already know how to work with TinyOS and change the above as appropriate).cd $TOSROOT/apps/BaseStation make telosb install.0
- Install TOSBaser.bin onto the NSLU2. As it reboots, insert the BaseStation mote into the "Disk 1" USB port.
- Turn on the RadioCountToLeds mote, and you should see the LED blinking on the BaseStation mote.
- After the NSLU2 finishes rebooting, ssh to the NSLU2. If you execute the ps command, you should see the serialforwarder program running (called sf here). Then, try
and you should see lots of packets being dumped (Cntl-C to quit).sflisten localhost 9001
- To prove this was no miracle, log out of the NSLU2 and then, on your laptop, run
and you should see the same thing as you did as root running on the NSLU2. Note: sflisten is found in $TOSROOT/support/sdk/c/sf along with other handy non-bloatware.sflisten 192.168.1.77 9001