Testing the BSP
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.
Pre-compiled Binary Images
Testing the UART serial 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.
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:~$ cd ~ user@rennes:~$ git clone https://github.com/openwsn-berkeley/openwsn-fw.git
Run the parser script 01bsp_radio_rx.py
"moteID
" must be the number of the mote running 01bsp_radio_rx_prog.ihex
user@rennes:~$ cd openwsn-fw/projects/common/01bsp_radio_rx/ user@rennes:~/openwsn-fw/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 ...
Testing the EUI64 unique identifier
C:\Users\Thomas\Desktop\openwsn-fw>scons board=wsn430v14 toolchain=mspgcc bsp_eui64 scons: Reading SConscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... Compiling projects\common\01bsp_eui64\01bsp_eui64.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\board.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\bsp_timer.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\debugpins.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\eui64.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\leds.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\radiotimer.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\spi.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\uart.o Compiling build\wsn430v14_mspgcc\bsp\boards\wsn430v14\cc2420\radio.o Archiving build\wsn430v14_mspgcc\bsp\boards\wsn430v14\libbsp.a Indexing build\wsn430v14_mspgcc\bsp\boards\wsn430v14\libbsp.a Linking projects\common\01bsp_eui64_prog.exe msp430-size projects\common\01bsp_eui64_prog.exe text data bss dec hex filename 3610 16 74 3700 e74 projects\common\01bsp_eui64_prog.exe msp430-objcopy --output-target=ihex projects\common\01bsp_eui64_prog.exe projects\common\01bsp_eui64_prog.ihex msp430-objcopy --output-target=binary projects\common\01bsp_eui64_prog.exe projects\common\01bsp_eui64_prog.bin scons: done building targets.
name | EUI64 |
---|---|
wsn430-1 | 14-15-92-00-12-91-ca-f5 |
wsn430-2 | 14-15-92-00-12-91-ca-73 |
wsn430-3 | 14-15-92-00-12-91-c8-8c |
wsn430-25 | 14-15-92-00-12-91-b4-bc |
wsn430-27 | 14-15-92-00-12-91-c8-9a |
wsn430-49 |
|
wsn430-50 | 14-15-92-00-12-91-cf-06 |
wsn430-51 | 14-15-92-00-12-91-b1-b6
|