Tip | ||||
---|---|---|---|---|
This page is created and maintained by
|
...
Info | ||
---|---|---|
| ||
This guide was prepared using
|
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 | ||
---|---|---|
|
Testing UART interface
Build the bsp_uart
Firmware
Code Block | ||||
---|---|---|---|---|
| ||||
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 | ||
---|---|---|
| ||
|
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
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.
- 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
Tip 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.
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! |
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
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
Code Block | ||
---|---|---|
| ||
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
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
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 |
---|
" |
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
... |