Submit an experiment with A8 nodes using the CLI tools

 

Difficulty: Medium

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 two A8 nodes on the Grenoble site and deploy it on them. Once deployed, you will hop onto the ssh frontend, ssh connect to them, set up their M3 node with a sample firmware file, and interact with the firmware running on the A8-M3 node and send radio packets.

tuto_a8_clitools_exp

  1. Connect to Saclay site host:
    my_computer$ ssh <login>@saclay.iot-lab.info
    
  2. Start an experiment with 2 A8 nodes
    <login>@saclay:~$ iotlab-auth -u <login> 
    <login>@saclay:~$ iotlab-experiment submit -n a8_exp -d 60 -l 2,archi=a8:at86rf231+site=saclay

    Remember the experiment identifier returned by the last command. It’ll be used in the commands shown below, <exp_id>. The requested experiment duration is 60 minutes.

  3. Wait a moment until the experiment is launched (state is Running) and get the nodes list. For the remainder of this tutorial, we suppose that you obtained a8-1.saclay.iot-lab.info and a8-2.saclay.iot-lab.info nodes.
    <login>@saclay:~$ iotlab-experiment get -i <exp_id> -s
    <login>@saclay:~$ iotlab-experiment get -i <exp_id> -r
    <login>@saclay:~$ iotlab-experiment wait
  4. Download the M3 firmware that we use in this tutorial to send radio packets between two A8 nodes through their M3 radio subsystem. This firmware must be placed in the A8 directory of your home directory (~/A8/)on the IoT-LAB frontend, this directory is automatically accessible from all the A8 nodes of your experiment.
    <login>@saclay:~$ cd A8
    <login>@saclay:~/A8$ wget https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/tutorial_a8_m3.elf -O tutorial_a8_m3.elf
    --2015-10-19 19:08:20--  https://raw.githubusercontent.com/wiki/iot-lab/iot-lab/firmwares/tutorial_a8_m3.elf
    Resolving raw.githubusercontent.com... 185.31.17.133
    Connecting to raw.githubusercontent.com|185.31.17.133|:443... connected.
    WARNING: certificate common name “www.github.com” doesn’t match requested host name “raw.githubusercontent.com”.
    HTTP request sent, awaiting response... 200 OK
    Length: 139259 (136K) [application/octet-stream]
    Saving to: “tutorial_a8_m3.elf”
    100%[=====================================================================================================================================================================================================>] 139,259     --.-K/s   in 0.09s   
    2015-10-19 19:08:21 (1.48 MB/s) - “tutorial_a8_m3.elf” saved [139259/139259]
  5. Note: When your experiment is “Started”, A8 nodes still need some time to boot, it may take from 1 to 5 minutes depending on the platform activity. So be patient. Nodes can also fail to boot… You can also view an experiment log file for each node.
    <login>@saclay:~$ ssh root@node-a8-1.saclay.iot-lab.info
    ssh: connect to host node-a8-1.saclay.iot-lab.info port 22: No route to host
    <login>@saclay:~$ ssh root@node-a8-2.saclay.iot-lab.info
    ssh: connect to host node-a8-2.saclay.iot-lab.info port 22: Connection refused
    <login>@saclay:~$ cat .iot-lab/last/log/a8-1.log 
    2017-06-28 10:13:00,895 :: INFO :: Start experiment: <login>-<exp_id>
    2017-06-28 10:13:00,907 :: INFO :: Control node : Starting of control node serial interface
    2017-06-28 10:13:00,918 :: INFO :: Control node : reset
    2017-06-28 10:13:00,928 :: INFO :: Reset Control Node
    2017-06-28 10:13:04,141 :: INFO :: Control node : start power of open node
    2017-06-28 10:13:04,197 :: INFO :: Node A8 : setup of a8 node
    2017-06-28 10:13:05,035 :: INFO :: Control node : Start experiment
    2017-06-28 10:13:05,067 :: INFO :: Control Node set time delay: 2930 us
    2017-06-28 10:13:05,089 :: INFO :: Control node : profile configuration
    2017-06-28 10:13:05,093 :: INFO :: Configure profile on Control Node
    2017-06-28 10:13:05,135 :: INFO :: Start experiment succeeded
    2017-06-28 10:13:42,302 :: INFO :: Boot A8 succeeded in time: 35s
  6. SSH connect as root to one of your A8 boards, the url is ‘node-a8-<num>.<site>.iot-lab.info
    <login>@saclay:~$ ssh root@node-a8-1.saclay.iot-lab.info
    The authenticity of host 'node-a8-1.saclay.iot-lab.info (10.0.44.1)' can't be established.
    RSA key fingerprint is 2b:a9:fc:bc:d5:77:27:24:06:fc:46:a2:87:17:e9:b0.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'node-a8-1.saclay.iot-lab.info,10.0.44.1' (RSA) to the list of known hosts.
    root@node-a8-1:~#
  7. You can check that the firmware is indeed present in the A8 folder.
    root@node-a8-9:~# ls A8
    tutorial_a8_m3.elf
  8. A8 nodes are running a minimal embedded linux system, most unix commands and python language are supported. You can test the ethernet connectivity between from your two nodes.
    root@node-a8-1:~# ping node-a8-2
    PING node-a8-2 (10.0.44.2): 56 data bytes
    64 bytes from 10.0.44.2: seq=0 ttl=64 time=5.616 ms
    64 bytes from 10.0.44.2: seq=1 ttl=64 time=1.038 ms
    64 bytes from 10.0.44.2: seq=2 ttl=64 time=0.977 ms
  9. In this tutorial, we will use the M3 subsystem of the A8 in order to use their 802.15.4 connectivity. When your experiment starts, the M3 subsystem of your A8 node doesn’t run any firmware, so we need to flash them with a basic provided firmware.
    root@node-a8-1:~# flash_a8_m3 A8/tutorial_a8_m3.elf 
    Open On-Chip Debugger 0.7.0 (2014-10-16-11:55)
    Licensed under GNU GPL v2
    For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
    adapter speed: 1000 kHz
    Info : only one transport option; autoselect 'jtag'
    DEPRECATED! use 'adapter_nsrst_delay' not 'jtag_nsrst_delay'
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
    adapter speed: 1000 kHz
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    cortex_m3 reset_config sysresetreq
    Info : max TCK change to: 30000 kHz
    Info : clock speed 1000 kHz
    Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
    Warn : Block read error address 0xe000ed00
    Error: stm32f1x.cpu -- clearing lockup after double fault
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 100ms
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 300ms
        TargetName         Type       Endian TapName            State       
    --  ------------------ ---------- ------ ------------------ ------------
     0* stm32f1x.cpu       cortex_m   little stm32f1x.cpu       unknown
    Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
    target state: halted
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x08002784 msp: 0x20010000
    Polling target stm32f1x.cpu succeeded again
    Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
    target state: halted
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x08002784 msp: 0x20010000
    auto erase enabled
    Info : device id = 0x10016414
    Info : flash size = 512kbytes
    wrote 28672 bytes from file A8/tutorial_a8_m3.elf in 1.634979s (17.126 KiB/s)
    verified 28512 bytes in 0.740173s (37.618 KiB/s)
    Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
    Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
    shutdown command invoked
    Return Value: 0
    root@node-a8-1:~#
  10. Each A8 communicates with its M3 subsystem through a serial link named /dev/ttyA8_M3 (speed 500 kB/s). The firmware we flashed on the M3 in the previous step is interactive : it waits for a character on its serial line and sends a packet. One way of interacting with the M3 from the A8 is to use the miniterm.py tool
    root@node-a8-1:~/A8# miniterm.py --echo /dev/ttyA8_M3 500000
    --- Miniterm on /dev/ttyA8_M3: 500000,8,N,1. ---
    --- Quit: Ctrl+]
    IoT-LAB Simple Demo program
    Type command
        h:    print this help
        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 >
    
    IoT-LAB Simple Demo program
    Type command
        h:    print this help
        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
    
    cmd >
  11. Now, connect, flash and start miniterm for the other A8 node.
    my_computer$ ssh <login>@saclay.iot-lab.info
    <login>@grenoble:~$ ssh root@node-a8-2
    root@node-a8-2:~# flash_a8_m3 A8/tutorial_a8_m3.elf
    root@node-a8-2:~/A8# miniterm.py --echo /dev/ttyA8_M3 500000
    --- Miniterm on /dev/ttyA8_M3: 500000,8,N,1. ---
    --- Quit: Ctrl+]
    IoT-LAB Simple Demo program
    Type command
        h:    print this help
        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 >
  12. Now we will make the two nodes communicate using the radio
    • On the first terminal, Type ‘s’ and ‘b’ to send packets to your other node
      cmd > s
      radio > Packet sent
      cmd> b
      radio > Big packet sent
    • On the second node, you should see the received message
      cmd > 
      radio > Got packet from 9651 (a8-1). Len: 16 Rssi: -49: 'Hello World!: 1'
      
      cmd > 
      radio > Got packet from 9651 (a8-1). Len: 60 Rssi: -49: 'Big Hello World!: 1 012345678901234567890123456789012345678'

 

Congratulations, you completed  the first A8 nodes tutorial !

Go further