Changes between Initial Version and Version 1 of Tutorials/e0BTZG/Tutorial02


Ignore:
Timestamp:
Feb 23, 2018, 2:58:40 PM (7 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/e0BTZG/Tutorial02

    v1 v1  
     1== Crossbow Telos - an IEEE 802.15.4 compliant open-source experimenting platform ==
     2This tutorial shows an example of working with the Crossbow Telos device in the orbit environment.
     3
     4=== Hardware / Software Utilized ===
     5 * Orbit nodes with the Crossbow Telos platform. We'll use node1-1 and noe1-2 on sandbox5.
     6 * Node image with ubuntu 64-bit version 16.04 or greater.
     7 * Contiki-OS - an operating system for the Internet of Things. [http://www.contiki-os.org/index.html Complete details are here.]
     8
     9=== Set up ===
     10To get started, please follow the instructions for creating a
     11reservation and loading images on orbit-lab nodes under [wiki:Tutorials/a0Basic/Tutorial1 ORBIT Tutorial -> Basic Tutorials -> testbed operations] and use the [https://www.orbit-lab.org/cPanel/status/template/index.html Inventory/Status page] to find nodes with IoT IEEE 802.15.4 devices. For this example we'll use node1-1 and node1-2 on sandbox5 imaged with ''ubuntu-16-04-64bit-rzraven.ndz''.
     12
     13Before installing the ContikiOS, verify the device is detect by the linux kernel and assigned a device path. We'll parse thru the dmesg output for ''Crossbow'' and find the associated Bus / Port #. Then parse the dmesg output again for the Bus / Port # to find the device path. In this example the Crossbow device is assigned to /dev/ttyUSB2.
     14{{{
     15root@node1-1:~#  dmesg | grep -i Crossbow
     16[    1.931956] usb 3-10: Product: Crossbow Telos Rev.B
     17
     18
     19root@node1-1:~# dmesg | grep -i "usb 3-10"
     20[    1.798466] usb 3-10: new full-speed USB device number 5 using xhci_hcd
     21[    1.931954] usb 3-10: New USB device found, idVendor=0403, idProduct=6001
     22[    1.931955] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
     23[    1.931956] usb 3-10: Product: Crossbow Telos Rev.B
     24[    1.931956] usb 3-10: Manufacturer: XBOW
     25[    1.931957] usb 3-10: SerialNumber: XBOL88EP
     26[    8.322005] usb 3-10: Detected FT232BM
     27[    8.322133] usb 3-10: FTDI USB Serial Device converter now attached to ttyUSB2
     28
     29}}}
     30
     31Install all the dependencies for the ContikiOS-3.0
     32{{{
     33root@node1-1:~# apt-get update
     34root@node1-1:~# apt-get install build-essential binutils-msp430 gcc-msp430 msp430-libc msp430mcu mspdebug gcc-arm-none-eabi gdb-arm-none-eabi openjdk-8-jdk openjdk-8-jre ant libncurses5-dev lib32ncurses5 make python
     35}}}
     36
     37Download ContikiOS-3.0 from github. [http://anrg.usc.edu/contiki/index.php/Installation Further details can be found here.]
     38{{{
     39root@node1-1:~# wget https://github.com/contiki-os/contiki/archive/3.0.zip
     40root@node1-1:~# unzip 3.0.zip
     41root@node1-1:~# mv contiki-3.0 contiki
     42}}}
     43
     44=== Compile, load and run the ContikiOS-3.0 example ===
     45Patch the ''serialdump-linux'' tool with a newer version. This tool is also appended in the attachment as well.
     46{{{
     47root@node1-1:~# cd contiki/tools/sky
     48root@node1-1:~# mv serialdump-linux serialdump-linux.bak
     49root@node1-1:~# wget https://github.com/cmorty/contiki/raw/pull/serialdump/tools/sky/serialdump-linux
     50root@node1-1:~# chmod 775 serialdump-linux
     51}}}
     52
     53Compile and execute the simple hello world example on the Crossbow specifying the appropriate device path. Just like most Hello World examples, this one only prints ''Hello World'' when successfully executed.
     54{{{
     55root@node1-1:~# cd
     56root@node1-1:~# cd contiki/examples/hello-world/
     57root@node1-1:~# make TARGET=sky MOTES=/dev/ttyUSB2 hello-world.upload login
     58:
     59:
     60:
     61../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2
     62connecting to /dev/ttyUSB2 (115200) [OK]
     63Rime started with address 0.18.116.0.13.104.74.236
     64MAC 00:12:74:00:0d:68:4a:ec Contiki 3.0 started. Node id is not set.
     65nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26,
     66 CCA threshold -45
     67Tentative link-local IPv6 address
     68 fe80:0000:0000:0000:0212:7400:0d68:4aec
     69Starting 'Hello world process'
     70Hello, world
     71}}}
     72
     73To exit out of the application, press Ctrl-C. Now save this image and load it on node1-2 as well to run the broadcast communication example, otherwise just follow the setup steps outlined above on node1-2.
     74
     75Run the broadcast example on both node1-1 and node1-2. Each node will send it's hello message and receive from the other. [http://anrg.usc.edu/contiki/index.php/Broadcast_Example Check here on how to change the hello message packet.]
     76
     77
     78{{{
     79root@node1-2:~# cd contiki/examples/rime
     80root@node1-2:~# make TARGET=sky example-broadcast.upload login
     81:
     82:
     83../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2
     84connecting to /dev/ttyUSB2 (115200) [OK]
     85Rime started with address 113.97
     86MAC 71:61:00:00:00:00:00:00 Contiki 3.0 started. Node id is not set.
     87nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26
     88Starting 'Broadcast example'
     89broadcast message sent
     90broadcast message received from 236.74: 'Hello from node1-1'
     91broadcast message sent
     92broadcast message received from 236.74: 'Hello from node1-1'
     93broadcast message sent
     94broadcast message received from 236.74: 'Hello from node1-1'
     95broadcast message sent
     96broadcast message received from 236.74: 'Hello from node1-1'
     97broadcast message sent
     98broadcast message received from 236.74: 'Hello from node1-1'
     99broadcast message sent
     100broadcast message received from 236.74: 'Hello from node1-1'
     101broadcast message sent
     102}}}