Submit an experiment with M3 nodes using the CLI tools
Difficulty: Easy
Duration: 20 minutes
Prerequisites: Configure SSH Access
Description: The aim of this first tutorial is to discover the IoT-LAB testbed tools by creating and submitting your first experiment, and then interact with running nodes. You will book onto the ssh frontend with CLI tools two M3 nodes on the Grenoble site, set them up with a sample firmware file, and deploy it on them. Once deployed, you will interact with the firmware running on the nodes, read sensor values and send radio packets through a terminal.
- Connect to the host of the site where you wish to run your experiment. In the example below, the Grenoble site is used.
my_computer$ ssh <login>@grenoble.iot-lab.info
- Download the M3 firmware that we use in this tutorial. (Or make your own)
<login>@grenoble:~$ wget https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/tutorial_m3.elf -O tutorial_m3.elf --2017-06-30 16:03:17-- https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/tutorial_m3.elf Résolution de raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.120.133 Connexion à raw.githubusercontent.com (raw.githubusercontent.com)|151.101.120.133|:443… connecté. requête HTTP transmise, en attente de la réponse… 200 OK Taille : 141626 (138K) [application/octet-stream] Sauvegarde en : « tutorial_m3.elf » tutorial_m3.elf 100%[===============================>] 138,31K --.-KB/s ds 0,03s 2017-06-30 16:03:17 (4,55 MB/s) — « tutorial_m3.elf » sauvegardé [141626/141626]
- Start an experiment with 2 M3 nodes. First authenticate then submit your experiment. In the example below, you submit an experiment called “m3_exp” (-n m3_exp) for a duration of 60minutes (-d 60) on 2 nodes with architecture M3 on Grenoble site. The command returns the experiment Id. Remember it. It will be used in the commands shown below,
<exp_id>
.<login>@grenoble:~$ iotlab-auth -u <login> <login>@grenoble:~$ iotlab-experiment submit -n m3_exp -d 60 -l 2,archi=m3:at86rf231+site=grenoble
Wait a moment until the experiment is launched (state is Running) and get the nodes list.
-
<login>@grenoble:~$ iotlab-experiment get -i <exp_id> -s <login>@grenoble:~$ iotlab-experiment get -i <exp_id> -r <login>@grenoble:~$ iotlab-experiment wait <login>@grenoble:~$ iotlab-node --update tutorial_m3.elf
- Interact with your M3 node. Provided firmwares offer an interaction menu via the serial port of the device. The serial port is available from the ssh frontend through a TCP socket on port 20000. You can use netcat for example, with
nc <device hostname> 20000
.<login>@grenoble:~$ nc m3-<id> 20000 IoT-LAB Simple Demo program Type command h: print this help t: temperature measure l: luminosity measure p: pressure measure u: print node uid d: read current date using control_node s: send a radio packet b: send a big radio packet e: toggle leds blinking Type Enter to stop printing this help cmd >
- Test some commands to get sensors measures (t, l, p)
cmd > l Luminosity measure: 7.324219E-1 lux
- Test packet sending
- Open a second terminal to connect to the serial port of another node
- Make one of the nodes send a radio packet:
<login>@grenoble:~$ nc m3-<id1> 20000 cmd > s cmd > radio > Packet sent
- Check that the other node has received the radio packet:
<login>@grenoble:~$ nc m3-<id2> 20000 cmd > radio > Got packet from A569. Len: 16 Rssi: -66: 'Hello World!: 0'
Go further
- Follow the Nodes Serial Link Aggregation tutorial to see how to interact easily with all your nodes
- Follow the command-line Experiment CLI client and Node CLI client tutorials
Practical Tips
- Get M3 UID(s) for Grenoble site
- See documentation here
- Access M3 serial port directly from your computer
- Open a SSH tunnel between your computer and the M3 node
ssh -L 20000:m3-<id>:20000 <login>@grenoble.iot-lab.info
- In another terminal, run
nc
locally as if you were on the ssh frontend.nc localhost 20000
- Open a SSH tunnel between your computer and the M3 node