IoT-LAB is a open Internet of Things testbed deployed in six sites throughout France. Its goal is to serve as a testbed for experiments and applications related to the future Internet of Things. There are three types of boards in IoT-LAB. One of them is the WSN430, with two versions: WSN430-v13b and WSN430-v14, differing the radio chip.
In order to make OpenWSN run on IoT-LAB (WSN430 nodes), the WSN430 Board Support Package (BSP) - hardware-dependent source code that controls the board components (e.g. UART, radio, spi, timers) - must work perfectly. Once they are working, the Protocol Stack (which is hardware-independent) runs above it.
This demo assumes the OpenWSN repositories are cloned and updated in your environment, and that the software required by OpenWSN is already installed. If this is not the case, follow the instructions in Download OpenWSN
Info
This guide was prepared using
- Ubuntu 13.10, 64-bit
- MSPGCC
- Part of this demo runs on IoT-LAB web interface, so it's supported by other operating systems.
- If you don't like MSPGCC, you can use IAR Embedded Workbench
In the following lines, a demo will be presented in order to test the WSN430v14 UART and radio drivers, for the implementation of OpenWSN on IoT-LAB.
Testing UART interface
Build the bsp_uart
Firmware
user@pc:~/Desktop/openwsn/openwsn-fw$ sudo scons board=wsn430v14 toolchain=mspgcc bsp_uart [sudo] password: scons: Reading SConscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... Compiling firmware/openos/projects/common/01bsp_uart/01bsp_uart.o Linking firmware/openos/projects/common/01bsp_uart_prog msp430-size firmware/openos/projects/common/01bsp_uart_prog text data bss dec hex filename 3026 16 42 3084 c0c firmware/openos/projects/common/01bsp_uart_prog msp430-objcopy --output-target=ihex firmware/openos/projects/common/01bsp_uart_prog firmware/openos/projects/common/01bsp_uart_prog.ihex msp430-objcopy --output-target=binary firmware/openos/projects/common/01bsp_uart_prog firmware/openos/projects/common/01bsp_uart_prog.bin scons: done building targets.
IoT-LAB architecture
- IoT-LAB permits you access its large sensor network remotely, enabling your computer to be anywhere in the world. The site-servers are deployed in each of the six sites. Their function is to receive requests of experiments thru the web interface, as well as enable the communication between your computer and the motes, thru TCP forwarding.
- To access the site-server remotely, IoT-LAB uses SSH. Because of this, it's required that you configure your SSH access.
- More information about IoT-LAB architecture:
Configure your SSH access
Following the instructions at https://www.iot-lab.info/tutorials/configure-your-ssh-access/.
Create a new experiment
On the IoT-LAB web interface, go to "Testbed", and click "New Experiment":
- Give your experiment a name, for example "
bsp_uart_v14"
Click "Rennes Map" to open the map representation of the motes in the Rennes site
There are motes in each of the 6 sites IoT-LAB is deployed in. We choose Rennes in this tutorial, feel free to pick another one. The only constraint is that they have to be WSN430v14 motes.
- On the man, select an unused node and click "Save"
- Click "Next"
Now that you have selected a mote, you need to upload the binary image you want the IoT-LAB to load on it.
- Select the mote
- Create a profile (don't need to change any settings)
- Use the "Choose Files" button to browse your local file system and select the
01bsp_uartprog.ihex
file you have built in the step above. It is located atopenwsn/openwsn-fw/firmware/openos/projects/common/01bsp_uart_prog.ihex
Click the "Add Association" button to associate the firmware to your mote
You'll see later on that you can associate different firmware images to different motes.
- Click "Submit".
You are now presented with the details of your experiment.
You might need to refresh the page for "Success" to appear in the "Deployment" column. "Success" indicates your firmware image was successfully loaded, and is now running somewhere in Rennes, France!
Access the site server
user@pc:~$ ssh user@rennes.iot-lab.info Linux rennes 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 Welcome FIT IoT-LAB users Charter: * FIT IoT-LAB is shared among several users, so do a reasonable use of the platform * Quote FIT IoT-LAB in your scientific papers Post your issues on: * the user mailing-list: users@iot-lab.info * or the bug-tracker: https://github.com/iot-lab/iot-lab/issues Last login: Wed Aug 6 21:51:17 2014 from 213-245-14-123.rev.numericable.fr user@rennes:~$
Access the chosen mote
- "Hello, World!" should be printed in your terminal periodically.
- Whenever you enter a character, the board echoes it back
user@rennes:~$ nc wsn430-<moteID> 20000 Hello, World! openwsn openwsn Hello, World! Hello, World! c c Hello, World! Hello, World! Hello, World! iotlab iotlab
Testing the Radio
In this application, we will use two motes. One of them will run the TX, and the other will run the RX. Each 500ms, the TX sends a packet in the air. The RX listens to these packets and write in its serial interface the length, number, RSSI, LQI and CRC of each packet.
Build the firmware
user@pc:~$ cd Desktop/openwsn/openwsn-fw user@pc:~/Desktop/openwsn/openwsn-fw$ sudo scons board=wsn430v14 toolchain=mspgcc bsp_radio_rx [sudo] password for user: scons: Reading SConscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... msp430-size firmware/openos/projects/common/01bsp_radio_rx_prog text data bss dec hex filename 3198 0 186 3384 d38 firmware/openos/projects/common/01bsp_radio_rx_prog scons: done building targets. user@pc:~/Desktop/openwsn/openwsn-fw$ sudo scons board=wsn430v14 toolchain=mspgcc bsp_radio_tx scons: Reading SConscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... msp430-size firmware/openos/projects/common/01bsp_radio_tx_prog text data bss dec hex filename 3078 0 172 3250 cb2 firmware/openos/projects/common/01bsp_radio_tx_prog scons: done building targets.
For debugging:
Create a New Experiment
Load 01bsp_radio_rx_prog.ihex
in a mote and 01bsp_radio_tx_prog.ihex
in the other
- After the firmware is selected for each mote, click "Submit"
- After "Submit", your screen should be like this:
Access the Rennes server
user@pc:~$ ssh user@rennes.iot-lab.info Linux rennes 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 Welcome FIT IoT-LAB users Charter: * FIT IoT-LAB is shared among several users, so do a reasonable use of the platform * Quote FIT IoT-LAB in your scientific papers Post your issues on: * the user mailing-list: users@iot-lab.info * or the bug-tracker: https://github.com/iot-lab/iot-lab/issues Last login: Wed Aug 6 21:51:17 2014 from 213-245-14-123.rev.numericable.fr user@rennes:~$
Download openwsn-fw on server
The parser script's goal is to parse the packets and show them in a way humans can read. TX transmits arbitrary bytes thru the air, and not all of them have a corresponding character in ASCII table. Without it, the printed line in the terminal cannot be read. It is located at openwsn-fw GitHub repository, so we need to clone it in the server.
user@rennes:~$ mkdir openwsn user@rennes:~$ cd openwsn user@rennes:~/openwsn$ git clone https://github.com/openwsn-berkeley/openwsn-fw.git ... user@rennes:~/openwsn$
Compile and run the parser script 01bsp_radio_rx.py
Navigate into the directory
- Compile the script
- Answer "
y
" - Input the mote ID
- Receive information from RX mote
"moteID
" must be the number of the mote running 01bsp_radio_rx_prog.ihex
user@rennes:~/openwsn$ cd openwsn-fw/firmware/openos/projects/common/01bsp_radio_rx user@rennes:~/openwsn/openwsn-fw/firmware/openos/projects/common/01bsp_radio_rx$ python 01bsp_radio_rx.py ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org running IoT-lAB? (Y|N): Y motename? (e.g. wsn430-35): wsn430-<moteID> len=127 num=0 rssi=-56 lqi=107 crc=1 len=127 num=1 rssi=-56 lqi=105 crc=1 len=127 num=2 rssi=-56 lqi=106 crc=1 len=127 num=3 rssi=-56 lqi=107 crc=1 len=127 num=4 rssi=-56 lqi=108 crc=1 len=127 num=5 rssi=-56 lqi=107 crc=1 len=127 num=6 rssi=-56 lqi=107 crc=1 len=127 num=7 rssi=-56 lqi=106 crc=1 len=127 num=8 rssi=-56 lqi=108 crc=1 len=127 num=9 rssi=-56 lqi=107 crc=1 ...