Contents
Use Zolertia Firefly nodes
Level: Easy
Duration: 20 minutes
Prerequisites: Configure SSH Access, Experiment CLI client, Node CLI client
Description: This document shows how to use the Experiment CLI Tool utility from the SSH frontend to interact with the Zolertia Firefly nodes available on IoT-LAB. You will learn how to list available Fireflies, start an experiment, and interact with the nodes. This tutorial uses the Firefly nodes available on the Lille site.
Initialize your environment
Connect to the SSH frontend and get some help :
my_computer$ ssh <login>@lille.iot-lab.info
If you have not authenticated yet using iotlab-auth, do it now:
<login>@lille:~$ iotlab-auth -u <login>
List available custom nodes
Available Zolertia Firefly nodes can be listed using the iotlab-experiment
command with the archi and site option
<login>@<site>:~$ iotlab-experiment info -l --archi firefly --site lille { "items": [ [...] { "archi": "firefly", "mobile": 0, "mobility_type": " ", "network_address": "firefly-2.lille.iot-lab.info", "site": "lille", "state": "Alive", "uid": "uuuu", "x": "14.89", "y": "26.835", "z": "2.6" }, [...] ] } [...]
The firmwares are based on Contiki, you can get them here:
Compiling the firmwares for the Firefly
<login>@lille:~$ git clone https://github.com/contiki-os/contiki.git
The Zolertia Firefly is supported through BOARD=firefly and TARGET=zoul.
Build the firmwares
<login>@lille:~$ make BOARD=firefly TARGET=zoul -C contiki/examples/rime example-broadcast <login>@lille:~$ cp contiki/examples/rime/example-broadcast.elf firefly.elf <login>@lille:~$ make BOARD=firefly TARGET=zoul -C contiki/examples/zolertia/zoul/cc1200-demo <login>@lille:~$ cp contiki/examples/zolertia/zoul/cc1200-demo/cc1200-demo.elf firefly-long-range.elf
Submit an experiment on Firefly nodes
From the information about the Firefly nodes, we can see that firefly-1 and firefly-2 are about 26m apart, through some walls, offices, etc.One can submit an experiment on Lille site nodes listed above.
To reserve the Firefly nodes, use iotlab-experiment
:
- Using the nodes id list, here it’s
firefly,1-2
:<login>@lille:~$ iotlab-experiment submit -d 60 -l lille,firefly,1-2,firefly.elf { "id": 109649 }
- Now wait until the experiment is ready, e.g nodes are reserved and flashed with the given firmware.
<login>@lille:~$ iotlab-experiment wait Waiting that experiment 109649 gets in state Running "Running"
Interact with the Firefly nodes
Similarly to the IoT-LAB M3 nodes, use nc
on port 20000 to interact with any reserved node:
You should see broadcast messages sent by the nodes:
<login>@lille:~$ nc firefly-1.lille.iot-lab.info 20000
broadcast message sent broadcast message sent broadcast message sent
<login>@lille:~$ nc firefly-2.lille.iot-lab.info 20000
broadcast message sent broadcast message sent
The firefly.elf firmware uses the 802.15.4 2.4GHz radio, and the two nodes don’t receive each other broadcast messages.
Update the firmware with the long-range communication using the sub-1GHz transceiver :
<login>@lille:~$ iotlab-node --update firefly-long-range -e lille,firefly,1-2
Then query the serial port of a reserved node:
<login>@lille:~<login>@lille:~$ nc firefly-2 20000 Broadcast --> 32 *** Received 2 bytes from 77:153: '0x0032' -76 - 3 Broadcast --> 33 *** Received 2 bytes from 77:153: '0x0033' -76 - 3 Broadcast --> 34 *** Received 2 bytes from 77:153: '0x0034' -76 - 4 Broadcast --> 35 *** Received 2 bytes from 77:153: '0x0035' -75 - 4
This time, the broadcasts are received by the other node.