| 1 | == Crossbow Telos - an IEEE 802.15.4 compliant open-source experimenting platform == |
| 2 | This 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 === |
| 10 | To get started, please follow the instructions for creating a |
| 11 | reservation 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 | |
| 13 | Before 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 | {{{ |
| 15 | root@node1-1:~# dmesg | grep -i Crossbow |
| 16 | [ 1.931956] usb 3-10: Product: Crossbow Telos Rev.B |
| 17 | |
| 18 | |
| 19 | root@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 | |
| 31 | Install all the dependencies for the ContikiOS-3.0 |
| 32 | {{{ |
| 33 | root@node1-1:~# apt-get update |
| 34 | root@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 | |
| 37 | Download ContikiOS-3.0 from github. [http://anrg.usc.edu/contiki/index.php/Installation Further details can be found here.] |
| 38 | {{{ |
| 39 | root@node1-1:~# wget https://github.com/contiki-os/contiki/archive/3.0.zip |
| 40 | root@node1-1:~# unzip 3.0.zip |
| 41 | root@node1-1:~# mv contiki-3.0 contiki |
| 42 | }}} |
| 43 | |
| 44 | === Compile, load and run the ContikiOS-3.0 example === |
| 45 | Patch the ''serialdump-linux'' tool with a newer version. This tool is also appended in the attachment as well. |
| 46 | {{{ |
| 47 | root@node1-1:~# cd contiki/tools/sky |
| 48 | root@node1-1:~# mv serialdump-linux serialdump-linux.bak |
| 49 | root@node1-1:~# wget https://github.com/cmorty/contiki/raw/pull/serialdump/tools/sky/serialdump-linux |
| 50 | root@node1-1:~# chmod 775 serialdump-linux |
| 51 | }}} |
| 52 | |
| 53 | Compile 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 | {{{ |
| 55 | root@node1-1:~# cd |
| 56 | root@node1-1:~# cd contiki/examples/hello-world/ |
| 57 | root@node1-1:~# make TARGET=sky MOTES=/dev/ttyUSB2 hello-world.upload login |
| 58 | : |
| 59 | : |
| 60 | : |
| 61 | ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2 |
| 62 | connecting to /dev/ttyUSB2 (115200) [OK] |
| 63 | Rime started with address 0.18.116.0.13.104.74.236 |
| 64 | MAC 00:12:74:00:0d:68:4a:ec Contiki 3.0 started. Node id is not set. |
| 65 | nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26, |
| 66 | CCA threshold -45 |
| 67 | Tentative link-local IPv6 address |
| 68 | fe80:0000:0000:0000:0212:7400:0d68:4aec |
| 69 | Starting 'Hello world process' |
| 70 | Hello, world |
| 71 | }}} |
| 72 | |
| 73 | To 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 | |
| 75 | Run 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 | {{{ |
| 79 | root@node1-2:~# cd contiki/examples/rime |
| 80 | root@node1-2:~# make TARGET=sky example-broadcast.upload login |
| 81 | : |
| 82 | : |
| 83 | ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2 |
| 84 | connecting to /dev/ttyUSB2 (115200) [OK] |
| 85 | Rime started with address 113.97 |
| 86 | MAC 71:61:00:00:00:00:00:00 Contiki 3.0 started. Node id is not set. |
| 87 | nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26 |
| 88 | Starting 'Broadcast example' |
| 89 | broadcast message sent |
| 90 | broadcast message received from 236.74: 'Hello from node1-1' |
| 91 | broadcast message sent |
| 92 | broadcast message received from 236.74: 'Hello from node1-1' |
| 93 | broadcast message sent |
| 94 | broadcast message received from 236.74: 'Hello from node1-1' |
| 95 | broadcast message sent |
| 96 | broadcast message received from 236.74: 'Hello from node1-1' |
| 97 | broadcast message sent |
| 98 | broadcast message received from 236.74: 'Hello from node1-1' |
| 99 | broadcast message sent |
| 100 | broadcast message received from 236.74: 'Hello from node1-1' |
| 101 | broadcast message sent |
| 102 | }}} |