While doing research for possible master thesis topics, I’m looking into the idea of wireless sensor network. At KULeuven the DISTRINET research group is spending quiet some effort into this and I want to make sure that I fully understand it before I decide to move in this direction or not.
So I bought a Raven developer evaluation kit to see what it’s all about.
Step 1: Hello World
The developer evaluation kit basically comes with two Raven Wireless Sensor Nodes - let’s also call them motes, we need to talk the lingo now ;-) - and one USB stick to also allow a computer to join the network.
It seems that the RZUSBSTICK is recognized when I plug it into one of my Mac’s USB ports.
Now can I do anything with it? Turning on the Raven shows it’s not able to join any network. So I’ll need to do something more ;-)
I found http://code.rancidbacon.com/LearningAboutAtmelRZRAVEN which included some Python code that should be able to setup the stick and connect to the mote.
I had to install libusb using MacPorts and use python also from MacPorts to get the script up and running:
Commenting out the line that sets the configuration, allows the script to continue, but it fails again a bit later:
Now, when I turn on a mote, it does connect to the network, so it seems that the partially working script initializes network on the stick.
After a bad night’s sleep, I started looking at the code again and compared it to http://pyusb.sourceforge.net/docs/1.0/tutorial.html. I’m not entirely sure, but I think the code was written in a pre-1.0 era, so I tried to convert it to the new coding style.
After learning a lot about Python, unicode, USB,… I managed to get the thing running. Most of the black-magic hexadecimal constants are still a mistery, but it works.
The code is @ https://github.com/christophevg/raven and it basically looks like this:
Messages received by the mote are displayed … I need a shorter name ;-)
After only running a few tests, the pre-installed batteries are almost drained, so I’ll need to hook up some external power supply.
Step 2: Replace the existing code with something else
Before I acutally wipe the Raven, I want to know the basics and be able to replace the pre-installed code with a simple Hello World of my own.
Step 3: Install Contiki and Looci
The real goal is to install Contiki and Looci and start playing with that.
sudo port install libusb
system_profiler SPUSBDataType | grep -A10 USBSTICK