Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Tip

This page is created and maintained by

User Profile
user557058:6c89f917-698d-4c79-be39-6d35c24db618

...

Info
titleInfo

This guide was prepared using

Tip
  • 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
Info

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.

Table of Contents
excludePedro Issa Helou

Testing UART interface

Image Removed

Build the bsp_uart Firmware

Code Block
languagebash
title01bsp_uart_prog.ihex
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.
Info
titleIoT-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":

 

  1. Give your experiment a name, for example "bsp_uart_v14"
  2. Click "Rennes Map" to open the map representation of the motes in the Rennes site

    Info

    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.

  3. On the man, select an unused node and click "Save"
  4. Click "Next"

Image Removed

Now that you have selected a mote, you need to upload the binary image you want the IoT-LAB to load on it.

  1. Select the mote
  2. Create a profile (don't need to change any settings)
  3. 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 at openwsn/openwsn-fw/firmware/openos/projects/common/01bsp_uart_prog.ihex
  4. Click the "Add Association" button to associate the firmware to your mote

    Tip

    You'll see later on that you can associate different firmware images to different motes.

  5. Click "Submit".

Image Removed

 

You are now presented with the details of your experiment.

Note

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!

 

Image Removed

Access the site server

 

Code Block
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

Info
IoT-LAB uses NetCat to create a TCP tunnel with the motes
  • "Hello, World!" should be printed in your terminal periodically.
  • Whenever you enter a character, the board echoes it back

 

Code Block
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

Image Removed

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 lengthnumber, RSSI, LQI and CRC of each packet.

Build the firmware

Code Block
title01bsp_radio_rx_prog.ihex ; 01bsp_radio_tx_prog.ihex
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:

Attachments

Create a New Experiment

Image Removed

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"

 

Image Removed

  • After "Submit", your screen should be like this:

Image Removed

Access the Rennes server

Code Block
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

Info

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.

Code Block
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
Warning

"moteID" must be the number of the mote running 01bsp_radio_rx_prog.ihex

Code Block
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 ...