wiki:Tutorials/e0BTZG/Tutorial02

Crossbow Telos - an IEEE 802.15.4 compliant open-source experimenting platform

This tutorial shows an example of working with the Crossbow Telos device in the orbit environment.

Hardware / Software Utilized

  • Orbit nodes with the Crossbow Telos platform. We'll use node1-1 and node1-2 on sandbox5.
  • Node image with ubuntu 64-bit version 16.04 or greater.
  • Contiki-OS - an operating system for the Internet of Things. Complete details are here.

Set up

To get started, please follow the instructions for creating a reservation and loading images on orbit-lab nodes under ORBIT Tutorial -> Basic Tutorials -> testbed operations and use the 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.

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.

root@node1-1:~#  dmesg | grep -i Crossbow
[    1.931956] usb 3-10: Product: Crossbow Telos Rev.B


root@node1-1:~# dmesg | grep -i "usb 3-10"
[    1.798466] usb 3-10: new full-speed USB device number 5 using xhci_hcd
[    1.931954] usb 3-10: New USB device found, idVendor=0403, idProduct=6001
[    1.931955] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.931956] usb 3-10: Product: Crossbow Telos Rev.B
[    1.931956] usb 3-10: Manufacturer: XBOW
[    1.931957] usb 3-10: SerialNumber: XBOL88EP
[    8.322005] usb 3-10: Detected FT232BM
[    8.322133] usb 3-10: FTDI USB Serial Device converter now attached to ttyUSB2

Install all the dependencies for the ContikiOS-3.0

root@node1-1:~# apt-get update
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

Download ContikiOS-3.0 from github. Further details can be found here.

root@node1-1:~# wget https://github.com/contiki-os/contiki/archive/3.0.zip
root@node1-1:~# unzip 3.0.zip
root@node1-1:~# mv contiki-3.0 contiki

Compile, load and run the ContikiOS-3.0 example

Patch the serialdump-linux tool with a newer version. This tool is also appended in the attachment as well.

root@node1-1:~# cd contiki/tools/sky
root@node1-1:~# mv serialdump-linux serialdump-linux.bak
root@node1-1:~# wget https://github.com/cmorty/contiki/raw/pull/serialdump/tools/sky/serialdump-linux
root@node1-1:~# chmod 775 serialdump-linux

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.

root@node1-1:~# cd
root@node1-1:~# cd contiki/examples/hello-world/
root@node1-1:~# make TARGET=sky MOTES=/dev/ttyUSB2 hello-world.upload login
:
:
:
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2
connecting to /dev/ttyUSB2 (115200) [OK]
Rime started with address 0.18.116.0.13.104.74.236
MAC 00:12:74:00:0d:68:4a:ec Contiki 3.0 started. Node id is not set.
nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26,
 CCA threshold -45
Tentative link-local IPv6 address
 fe80:0000:0000:0000:0212:7400:0d68:4aec
Starting 'Hello world process'
Hello, world

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.

Run the broadcast example on both node1-1 and node1-2. Each node will send it's hello message and receive from the other. Check here on how to change the hello message packet.

root@node1-2:~# cd contiki/examples/rime
root@node1-2:~# make TARGET=sky example-broadcast.upload login
:
:
../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB2
connecting to /dev/ttyUSB2 (115200) [OK]
Rime started with address 113.97
MAC 71:61:00:00:00:00:00:00 Contiki 3.0 started. Node id is not set.
nullsec CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26
Starting 'Broadcast example'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
broadcast message received from 236.74: 'Hello from node1-1'
broadcast message sent
Last modified 7 months ago Last modified on 02/23/18 10:11:24

Attachments (2)

Download all attachments as: .zip