Texas Instruments CC-6LOWPAN-DK-868 User Manual

Sub-1GHz 6LoWPAN Development kit
User’s Guide
Literature Number: SWRU298
September 2011
CC-6LOWPAN-DK-868
Page 2 of 61
Abbreviations
Abbreviations used in this data sheet are described below.
6LoWPAN
IPv6 over Low Power Wireless Personal Area Networks
IPv6
Internet Protocol version 6
ICMP
Internet Control Message Protocol
UDP
User Datagram Protocol
RS
Router Solicitation
RA
Router Advertisement
NS
Neighbor Solicitation
NA
Neighbor Advertisement
SLLAO
Source Link Layer Addressing Object
PIO
Prefix Information Object
ABRO
ARO DODAG
Destination Oriented Directed Acyclic Graph
DIS
DODAG Information Solicitation
DIO
DODAG Information Object
DAO
Destination Advertisement Object
DAO-ack
DAO acknowledge
ER
Edge Router
CC-6LOWPAN-DK-868
Page 3 of 61
Table of Contents
TABLE OF CONTENTS ......................................................................................................................... 3
LIST OF FIGURES ................................................................................................................................. 4
LIST OF TABLES ................................................................................................................................... 5
1 6LOWPAN KIT OVERVIEW ........................................................................................................ 6
1.1 FEATURES ...................................................................................................................................... 7
1.2 WHATS INCLUDED IN THE KIT? ........................................................................................................ 8
2 GETTING STARTED ................................................................................................................... 9
2.1 SETTING UP IPV6 ON YOUR PC ....................................................................................................... 9
2.2 IPV6 AND 6LOWPAN BASICS ....................................................................................................... 10
2.2.1 IPv6 Introduction ......................................................................................................................................................... 11
2.2.2 6LoWPAN Introduction ................................................................................................................................................ 11
2.3 EDGE ROUTER BOOTSTRAP PROSESS ........................................................................................... 11
2.4 NODEVIEW 2.0 ............................................................................................................................. 11
2.5 NETWORK ANALYZER APPLICATION ............................................................................................... 13
3 SOFTWARE ............................................................................................................................... 14
3.1 SENSINODE NAPSOCKET AND NANOSOCKET INTERFACE ............................................................... 14
3.2 SENSINODE NANOSTACK 2.0 LITE ................................................................................................. 15
3.2.1 Bootstrap process........................................................................................................................................................ 16
3.2.2 Synchronization ........................................................................................................................................................... 16
3.2.3 Neighbour Discovery and Router Solicitation ............................................................................................................... 17
3.2.4 RPL: IPv6 Routing Protocol for Low power and Lossy Networks ................................................................................. 17
3.2.5 Periodic processes ................................ ...................................................................................................................... 19
3.2.6 Error situations ............................................................................................................................................................ 19
3.3 CC-6LOWPAN-DK-868 SOFTWARE PROJECTS ........................................................................... 20
3.3.1 IDE installation ............................................................................................................................................................ 20
3.3.2 NanoHost Example (Network Analyzer) ....................................................................................................................... 21
3.3.3 NAPSocket Library ...................................................................................................................................................... 22
3.3.4 CC430F5137 Library Model (Network Analyzer) .......................................................................................................... 22
3.3.5 Programming the boards ................................................................ ............................................................................. 24
3.4 SENSINODE NAPSOCKET API ....................................................................................................... 25
3.4.1 Sensinode NAP Protocol API....................................................................................................................................... 26
3.5 SENSINODE NANOSOCKET API ..................................................................................................... 26
3.6 SENSINODE RF DYNAMIC CONFIGURATION API ............................................................................. 27
3.6.1 NanoSocket ................................................................................................................................................................. 27
3.6.2 NAPSocket .................................................................................................................................................................. 28
3.6.3 Node View 2.0 ............................................................................................................................................................. 28
3.7 SENSINODE NANOBOOT API ......................................................................................................... 29
3.7.1 Sensinode NanoBoot host tool .................................................................................................................................... 29
3.8 SENSINODE NODEVIEW 2.0 CUSTOM TABS .................................................................................... 29
3.8.1 Developing applications to run in custom tabs in NodeView 2.0 ................................................................................... 30
3.8.2 Exporting custom tabs to run as stand alone ............................................................................................................... 31
3.9 EDGE ROUTER (OMAP-L138) SOFTWARE ..................................................................................... 32
3.9.1 Sensinode NanoRouter 2.0 ......................................................................................................................................... 32
3.9.2 Startup scripts ............................................................................................................................................................. 32
3.9.3 Linux folder structure ................................................................................................................................................... 33
3.9.4 Sensinode NanoBoot host tool .................................................................................................................................... 33
3.9.5 Debug/console interface .............................................................................................................................................. 33
4 HARDWARE .............................................................................................................................. 33
4.1 EM430F5137RF900 ................................................................................................................... 33
4.1.1 Programming/Reprogramming the EM430F5137RF900 .............................................................................................. 34
4.1.2 Debug Interface using UART ....................................................................................................................................... 34
4.1.3 Schematics, BOM and Layout ..................................................................................................................................... 34
4.2 CC1180DB ................................................................................................................................. 40
4.2.1 Programming/Reprogramming the CC1180DB ............................................................................................................ 41
4.2.2 Schematics, BOM and Layout ..................................................................................................................................... 41
4.3 EDGE ROUTER, OMAP-L138 EXPERIMENTERS BOARD .................................................................. 50
4.3.1 Adapter Board ............................................................................................................................................................. 51
4.3.2 CC1180EM .................................................................................................................................................................. 55
5 FAQ ............................................................................................................................................ 60
5.1 SEND UDP PACKETS FROM PC ..................................................................................................... 60
CC-6LOWPAN-DK-868
Page 4 of 61
5.2 TOO MUCH CODE ......................................................................................................................... 60
5.3 LINUX KERNEL AND FILE SYSTEM ................................................................................................... 60
6 REFERENCES ........................................................................................................................... 61
7 DEVELOPMENT KIT ORDERING INFORMATION .................................................................. 61
8 GENERAL INFORMATION ....................................................................................................... 61
8.1 DOCUMENT HISTORY .................................................................................................................... 61
List of Figures
Figure 1. Sensinode NodeView Network Analyzer tool .......................................................... 6
Figure 2. CC-6LOPWAN-DK-868 kit ..................................................................................... 8
Figure 3. Kit System Overview .............................................................................................. 9
Figure 4. IPv6 enabled for Windows XP .............................................................................. 10
Figure 5. Adding an Edge Router. ....................................................................................... 12
Figure 6. NanoRouter Router View details. ......................................................................... 12
Figure 7. NodeView Network Analyzer tab. ......................................................................... 13
Figure 8. Stack overview CC1180 based system, using NAPSocket API ............................ 15
Figure 9. Stack Overview CC430 based system, using NanoSocket API ............................ 15
Figure 10. NanoHost Example project ................................................................................. 22
Figure 11. NAPSocket library project .................................................................................. 22
Figure 12. NanoSocket Example project ............................................................................. 23
Figure 13. Enabling the NanoSocket Debug Interface ......................................................... 23
Figure 14. Sensinode NAPSocket library ................................................................ ............ 26
Figure 15. Sensinode NanoSocket API ............................................................................... 27
Figure 16. Setting RF Configuration on Edge Router .......................................................... 28
Figure 17. Creating Eclipse project for NodeView 2.0 custom tab ....................................... 30
Figure 18. Folder structure for custom tabs ......................................................................... 30
Figure 19. tabConfig.txt file ................................................................................................. 31
Figure 20. EM430F5137RF900, Logical Description ........................................................... 34
Figure 21. EM430F5137RF900, PCB Components Top Layer ............................................ 36
Figure 22. EM430F5137RF900, PCB Components Bottom Layer ....................................... 36
Figure 23. EM430F5137RF900, Layout Top Layer ............................................................. 37
Figure 24. EM430F5137RF900, Layout Layer 2.................................................................. 37
Figure 25. EM430F5137RF900, Layout Layer 3.................................................................. 38
Figure 26. EM430F5137RF900, Layout Bottom Layer ........................................................ 38
Figure 27. CC1180DB, Logical Description ......................................................................... 40
Figure 28. CC1180DB, PCB Components Top Layer .......................................................... 45
Figure 29. CC1180DB, PCB Components Bottom Layer ..................................................... 46
Figure 30. CC1180DB, Layout Top Layer ........................................................................... 47
Figure 31. CC1180DB, Layout Bottom Layer ...................................................................... 48
Figure 32. OMAP-L138 Experimenter's Board Overview ..................................................... 50
Figure 33. Adapter Board, PCB Components Top Layer ..................................................... 53
Figure 34. Adapter Board, PCB Components Bottom Layer ................................................ 53
Figure 35. Adapter Board, Layout Top layer ........................................................................ 54
Figure 36. Adapter Board, Layout Bottom Layer ................................................................. 54
Figure 37. CC1180EM, PCB Components Top Layer ......................................................... 57
Figure 38. CC1180EM, PCB Components Bottom Layer .................................................... 57
Figure 39. CC1180EM, Layout Top Layer ........................................................................... 58
Figure 40. CC1180EM, Layout Bottom Layer ...................................................................... 58
CC-6LOWPAN-DK-868
Page 5 of 61
List of Tables
Table 1. CC1180 controlled LED (D1 and D2) behavior. ..................................................... 14
Table 2. MSP4305438A controlled LED (D3 and D4) behavior. .......................................... 14
Table 3. Sensinode 6LoWPAN Stack Layer Definitions. ...................................................... 16
Table 4. Beacon payload. ................................................................................................... 16
Table 5. Fixed Neighbor Discovery packet formats. ............................................................ 17
Table 6. RPL control messages .......................................................................................... 18
Table 7. Fixed formats of RPL control messages. ............................................................... 18
Table 8. RPL Objective Code Point. .................................................................................... 18
Table 9. RPL Metric container format. ................................................................................. 19
Table 10. DODAG configuration parameters. ...................................................................... 19
Table 11. EM430F5137RF900, Bill of Material .................................................................... 40
Table 12. CC1180DB, Bill of Material .................................................................................. 50
Table 13. Adapter Board LED functionality .......................................................................... 51
Table 14. Adapter Board, Bill of Material ............................................................................. 55
Table 15. CC1180EM, Bill of Material ................................................................................. 59
Table 16. Development Kit Ordering Information ................................................................. 61
Table 17. Document History ................................................................................................ 61
CC-6LOWPAN-DK-868
Page 6 of 61
1 6LoWPAN Kit Overview
This document describes the TI 6LoWPAN evaluation kit for use in the 868/915MHz bands. The kit is based on hardware from TI and 6LoWPAN software (NanoStack) from TI third party Sensinode Ltd. The CC-6LOWPAN-DK-868 kit provides easy way for users to start developing their own wireless sensor network applications based on 6LoWPAN technology. There are two different APIs for communicating with the NanoStack, based on if you use CC1180 Network Processor or the CC430 SoC. The API used for CC1180 is called NAPSocket, while the API for CC430 is called NanoSocket.
The kit contains a 6LoWPAN Edge Router (access point/gateway to IPv6) based on TI‟s OMAP-L138 processor. The Edge Router (ER) uses a CC1180EM as radio interface. The Edge Router is running Sensinode Ltd NanoRouter 2.0 software and can connect wireless sensor nodes running Sensinode Ltd NanoStack 2.0 lite. The evaluation version of NanoRouter 2.0 included in the kit is limited to 10 nodes per Edge Router.
Included in the kit are two EM430F5137RF900 Rev 3.2 boards and two CC1180DB boards. The EM430F5137RF900 and CC1180DB boards are used as wireless sensor devices in the kit. CC430 comes with library support for Sensinode NanoStack 2.0 lite (NanoSocket [8]). This library model allows easy implementation of user applications, built directly on top of the NanoSocket library.
The CC1180DB contains a Wireless Network Processor (WNP), CC1180, which handles all 6LoWPAN network communication. Connected to the WNP is a host processor (MPS430F5438A) running the user application. The hardware interface between the network processor and the host processor is UART. The software interface between the network processor and the host MCU is Sensinode NAPSocket API [12]. The NAPSocket API acts as a wrapper library to parse Sensinode NAP protocol messages [9].
The kit provides Edge Router (NanoRouter) control and testing software (Sensinode NodeView 2.0 [10]). NodeView 2.0 can be used to control NanoRouter software running on the Edge Router in real time and provides e.g. address information of the connected nodes. The control protocol is based on Sensinode proprietary UDP communication. The NodeView 2.0 tool also provides a simple way to create user‟s own java applications that are included in the NodeView 2.0 GUI in the form own separate tabs.
All nodes can act as routers inside the 6LoWPAN network. The radio transceivers on the nodes are thus always on, which makes the system less suitable for battery-powered devices.
This documentation gives detailed information of the kit contents and behavior, its configuration and how the different 6LoWPAN standards are implemented.
Figure 1. Sensinode NodeView Network Analyzer tool
CC-6LOWPAN-DK-868
Page 7 of 61
1.1 Features
IP-based networking, enabling the “Internet of Things” CC1180 Over-Network Download (OTA), future proofs:
o Device applications and network upgrades
Low memory footprint;
o CC1180 6LoWPAN stack is less than 32kB o CC430 6LoWPAN stack is about 17kB
Sensinode 6LoWPAN software can run on all frequencies that CC1180 and CC430 support,
providing a sub-GHz mesh solution. Note: The kit hardware is for use in the 868/915 MHz bands.
Low development complexity, customers used to IP programming will be up and running in no
time with the simple socket API approach.
Configurable RF interface:
o Output power: -30dBm to +10dBm o Date rates: 50, 100, 150 and 200kbit/s o RX Attenuation, for close-in systems o AES-CCM* secured IEEE802.15.4e payloads, using network-wide key.
Coordinated mesh networking (modified RPL) IEEE802.15.4g/e PHY and MAC Compressed IPv6 headers (subset of IP header compression) ICMPv6 Neighbor Discovery (subset of ND) User application uses User Datagram Protocol (UDP) to send data Short address link-layer communication (based on allocated two byte address, unique under
a simple 6LoWPAN, allocation coordinated by a single Edge Router)
Fully automatic bootstrap process, automatic route discovery Self-healing mesh Each node replies to ICMPv6 echo requests P2P communication Synchronous frequency hopping possible, using 50 FHSS channels
CC-6LOWPAN-DK-868
Page 8 of 61
Figure 2. CC-6LOPWAN-DK-868 kit
1.2 What’s included in the kit?
2 CC1180DB nodes (CC1180 NWP plus MSP4305438A host MCU) 2 EM430F5137900 (CC430 SoC) nodes 1 OMAP-L138 based Edge Router Board (Gateway, running Linux) 1 Adapter board, for connection of CC1180EM to OMAP-L138 board 1 CC1180EM (radio interface to OMAP-L138 board) MSP-FET430UIF Debugger, used to debug and download code to nodes. Ethernet Cable (Crossover, for direct connection to PC) RS-232 NULL modem cable (used for Linux debug console) Power supply for OMAP-L138 board, incl. cables USB cable for MSP-FET430UIF Debugger Antennas, for 868/915 MHz band Batteries (incl. holders for CC430 boards) Quick Start Guide Sensinode NodeView 2.0 Network Analyzer PC SW Software application examples
CC-6LOWPAN-DK-868
Page 9 of 61
2 Getting Started
This chapter gives the user a quick start to using the kit. The 6LoWPAN network is completely self healing and self organizing. The only thing the user needs to do in order to get the network up and running is to set up the Edge Router, verify that the Edge Router has Ethernet connection with IPv6 support and start it. When the NanoRouter application on the Edge Router board boots up, automatic scripts configures the NanoRouter software and starts advertising the network over the radio interface. For a more detailed procedure please see the Quick Start Guide [14].
If the pre-programmed nodes from the kit are powered up, they will automatically search for and join to available network, allocate IPv6 addresses and are ready to go with no user input needed at all. The following chapter provides more detailed information what happens behind the scenes. The below picture describes an architectural overview for the complete system. Note that the 6LoWPAN stack handles exactly which node connects to which node automatically, hence forming a fully automatic 6LoWPAN network.
Figure 3. Kit System Overview
2.1 Setting up IPv6 on your PC
Most Internet hosts are still using IPv4 only a few are using the new IPv6 protocol. The Sensinode NanoStack 2.0 is using IPv6, so you need to have your PC ready also. For Microsoft Windows Vista and 7 IPv6 is supported natively. If you are running Windows XP, make sure that you have the Service Pack 3 installed. In addition, when you have Windows XP Service Pack 3 installed, you also need to check to make sure that the IPv6 protocol is installed in your system. You can verify that this is installed by looking at the properties of any Network Connection on your computer (Start Menu ­> Network Connections). As you see from the below screenshot, if you call the properties for any connection, you should have an option called Internet Protocol Version 6 (TCP/IPv6).
CC-6LOWPAN-DK-868
Page 10 of 61
Figure 4. IPv6 enabled for Windows XP
Follow the below steps to install IPv6 for Windows XP if you do not have it installed. Open a command prompt and write:
ipv6 install
To be able to communicate with the devices using IPv6 your PC needs to be assigned an IPv6 address. Assigning an IPv6 address and a default route is described for Windows XP, Vista, 7 and for Linux in the steps below.
Assign an IPv6 address to the PC using the command prompt (Run in administrator mode in Windows
7). This example adds the IPv6 address 2001::22 to your PC:
netsh interface ipv6 add address “Local Area Connection” 2001::22
Set up a default route using the command prompt: (Run in administrator mode in Windows 7)
netsh interface ipv6 add route ::/0 “Local Area Connection”
Note! You must change “Local Area Connection” to the actual name of the Ethernet connection you
want to use. You can get it from Windows Network Connections. The IPv6 address (2001::22 in this example) has to be unique on your network.
For Linux the following commands to add IPv6 address and default route can be used:
ifconfig eth0 inet6 add 2001::22/64
route -A inet6 add 2001::/0 dev eth0
Note that some antivirus software blocks all incoming IPv6 traffic.
2.2 IPv6 and 6LoWPAN Basics
To fully benefit from the CC-6LOWPAN-DK-868 kit a basic understanding of both IPv6 and 6LoWPAN is needed. This section makes the user familiar with basic IPv6 and 6LoWPAN technologies.
TI's third party Sensinode Ltd. 6LoWPAN solution provides an easy way of passing messages around in a 6LoWPAN network, using a socket approach to both sending and receiving data as well as controlling the network parameters. In small RF networks, i.e. a sensor network, sending data inside the network is usually straight forward. Problems arise when one wants to send data to the internet or intranet. This would normally include either specialized software on devices connected to the network,
CC-6LOWPAN-DK-868
Page 11 of 61
or translating the RF protocol to a network protocol, i.e. using a proxy. CC-6LOWPAN-DK-868 is therefore based on IPv6 and 6LoWPAN, eliminating such need for application layer gateways.
2.2.1 IPv6 Introduction Internet Protocol (IP) is used in the world‟s largest networks. Nearly every desktop computer supports
IP, which makes IP ideal to use when one wants to hook up a wireless sensor network to a larger backbone network. Setting up a wireless sensor network can even be managed by the IT department on a company, without any knowledge of RF networks at all.
IP is not optimized for low-power, low-cost sensor networks. But since it's a very flexible protocol it can fairly easy be adapted to make a perfect fit for a wireless sensor network, which is exactly what 6LoWPAN does.
2.2.1.1 Addressing
The most obvious difference between IPv4 and IPv6 is the number of supported addresses. IPv4 supports 232 addresses, while IPv6 supports 2
128
addresses.
A typical IPv6 address might look like this: 2001:0000:0000:0000:0000:00FF:FE00:0301. All leading zeros can be omitted, leaving the address to look like: 2001:0:0:0:0:FF:FE00:301. Finally zeros in the middle can be replaced by a double colon, leaving the address to: 2001::FF:FE00:301
All IPv6 networks have a prefix. All devices in the same network have the same prefix. The prefix is written like this: 2001:0:0:0:0:FF:FE00:301/64, meaning that the prefix is 64 bits long. Thus the prefix for this example is: 2001:0000:0000:0000
Every interface also has a local link address associated with it. The link-local address is only valid within the network and cannot be routed to another network. A link local address start with FE80::
2.2.2 6LoWPAN Introduction Since the IPv6 header alone is 40 bytes, and the Maximum Transmission Unit (MTU) of IP is 1280
bytes, frames to be sent over a low power RF network based on IEEE 802.15.4 has to be compressed in some way. IEEE 802.15.4 has a maximum packet size of 127 bytes, so a 40 byte IPv6 header would take up more than 30% of the packet. The 6LoWPAN adaptation layer bridges those two technologies together, without the need of any application gateways.
Each node in a 6LoWPAN network has a unique IPv6 address, as described in the previous chapter. In addition to the IPv6 address all nodes also has a unique 8 byte IEEE address. The IEEE address is stored in flash memory of the devices. For CC430 based devices the IEEE address is stored on flash address 0xFF70 (MSB on address 0xFF70). On the CC1180 the IEEE address is read and written with a Sensinode bootloader utility called NanoBoot host. NanoBoot host is available for standard Linux platforms and the OMAP platform. On all nodes in the CC-6LOWPAN-DK-868 the preloaded IEEE address are printed on a sticker on each node.
2.3 Edge Router Bootstrap Prosess
The Edge Router board requires an Ethernet cable and main power. Also verify that the CC1180EM radio module is properly connected to the OMAP J30 connector with the adapter board and has an antenna. To start the Edge Router simply power up the board. On the board there is an automatic script which will launch the NanoRouter 2.0 software during Linux kernel boot process. The time for the Linux boot process is about 45 seconds. NanoRouter software status can be easily checked by initiating a NodeView connection to the board IPv6 address, which is described in the next chapter.
2.4 NodeView 2.0
NodeView can be used to control and communicate with the NanoRouter software running on an Edge Router. The NodeView software is a java based cross platform tool designed for 6LoWPAN testing and evaluating purposes. When NodeView is started, it opens the „Router View tab. The „Router View tab contains 'File' and 'Options' toolbars. To connect NodeView to an Edge Router choose File->Add NanoRouter IPv6 from the menu.
CC-6LOWPAN-DK-868
Page 12 of 61
Figure 5. Adding an Edge Router.
The address must be given in a basic IPv6 format seen in the figure above. To connect to the standard Edge Router delivered with the CC-6LOWPAN-DK-868 kit simply enter 2001::11. After the Edge Router is added, the details can be seen from the NodeView „router View‟ tab if the connection was successfully established. When a sensor node joins the network, it can be observed in the Nodes list shown in Figure 2Figure 6. The list is updated based on the Edge Router whiteboard information or by pressing 'Clear and Reload' button. The whiteboard of the Edge Router contains information of all connected nodes.
Figure 6. NanoRouter Router View details.
As described earlier in this document nodes automatically scans for and joins available 6LoWPAN networks. When a node has joined a network a Network Analyzer application is launched on the node. The Network Analyzer application sends data about the network to the NodeView tool. The start is trigged by a message from NodeView, the activation message is sent automatically every time when the whiteboard information changes or when user press the „Clear and Reload‟ button.
CC-6LOWPAN-DK-868
Page 13 of 61
Figure 7. NodeView Network Analyzer tab.
In Figure 7, the green node indicates a normal node, while the blue color indicates a routing node. The black/grey color indicates a node that has no longer connectivity to the NodeView. The red color indicates a configured Edge Router. The circles describe a logical position of a node in the network in hops. 'File', 'Options' and 'Help' contains useful information and configurations that can be useful. The set Global Transmit Interval found in Options can be used to change how often the nodes are set to send their network analyzer data to the Edge Router, the default value is 40s. Pay attention when setting this value, since setting it too low in a large network can degrade the network overall performance. One feature that can be useful when analyzing routing paths is the ability to have a background image in NodeView. To enable this feature place your background image (must be in .jpg format) in the same folder as NodeView, the go to Options->Use background. More information on how to use NodeView 2.0 can be found in [10].
2.5 Network Analyzer Application
All sensor nodes come with a pre-programmed Network Analyzer firmware. The network analyzer application is used to gather information about the network such as RSSI on different links, network topology and application layer data traffic etc. This section describes behavior of the LEDs and buttons that user may use on the nodes. The network analyzer application software for the nodes is described in detail later in this document.
CC1180DB and CC430F5137 both have a green and a red led. The CC1180DB also has LEDs that are controlled by the MSP4305438A host MCU. Radio LEDs (D1 and D2) are located in left bottom corner when holding CC1180DB with jumpers and buttons pointing upwards. The CC1180 contains a bootloader, Sensinode NanoBoot 1.0, and a NanoStack 2.0 Wireless Network Processor firmware. The user can control which state (mode) that CC1180 is in, either bootloader mode or application mode.
When the NanoBoot mode is chosen, both LEDs are on. The mode can be switched by pressing the button S1. This will cause a falling edge interrupt to the CC1180 chip (grounding P1.2). Both LEDs will be now disabled until a network connection is established (indicated with green LED). If the red LED
CC-6LOWPAN-DK-868
Page 14 of 61
blinks with 1 second interval the network is disabled. The red LED also blink very rapidly during any RF event but mainly remains inactive. Please note that the connection will not be established if the MSP4305438A host MCU doesn‟t send a networking enable message or there is no active NanoRouter available within the range with correct RF settings.
When the connection is established, green LED remains active and the red LED blinks on every RF event.
Green LED active, red LED disabled but blinking
Red LED blinking with 1 second interval
Green LED inactive, red LED blinking rapidly.
Both LEDs are active
Network connection established
Networking is not enabled
Scanning for network
Bootloader mode
Table 1. CC1180 controlled LED (D1 and D2) behavior.
Table 1 applies also for the CC430F5137 LEDs except for the bootloader LED usage, since there is no NanoBoot 1.0 in use in CC430F5137). The MSP4305438A host MCU has a Network Analyzer application programmed by default as describe earlier in this document. The RSSI for the node is displayed using the LEDs. The LED control of the Network Analyzer application is defined in Table 2.
Red LED toggling with 1 second interval
Both LEDs disabled
Green LED active, red LED disabled
Both LEDs remains active
Red LED remains active, green LED disabled
3 concurrent reply messages missed or Analyzer is not activated
Reply message measured RSSI level above -40 dBm.
Reply message measured RSSI level between ­40 and -65 dBm
Reply message measured RSSI level between -65 and ­90 dBm.
RSSI reading below -90 dBm.
Table 2. MSP4305438A controlled LED (D3 and D4) behavior.
3 Software
Sensinode NanoStack 2.0 lite operating system core is event based, all the peripherals such as timers, trigger events are executed in the main program. Interrupt service routines are used by hardware drivers which may trigger events.
3.1 Sensinode NAPSocket and NanoSocket interface
There are, as described earlier, two different APIs for using Sensinode NanoStack 2.0 lite. Network Processor (NAPSocket API [12]) and the library model (NanoSocket API [8]) provide easy-to-use interfaces. NanoStack 2.0 lite networking must be initialized properly, networking is off by default. User is provided an interface which allows enabling of networking; e.g. polling connectivity and configuring the RF interface setup for user needs. For the Network Processor, NAPSocket library [12] is an interface library running on a host MCU controlling the Network Processor (CC1180). The library model of NanoStack 2.0 lite uses a function call interface which allows direct access to configure networking features as well as other configurations, e.g. RF configuration. This interface system is called NanoSocket API [8]. NanoSocket API is linked into user IAR application project and it contains a .lib file of NanoStack 2.0 lite and a few header files. Both interfaces encapsulate UDP communication into a simple socket system, making RF easy! The Sensinode NAPSocket and NanoSocket APIs are described in detail below.
CC-6LOWPAN-DK-868
Page 15 of 61
Figure 8. Stack overview CC1180 based system, using NAPSocket API
Figure 9. Stack Overview CC430 based system, using NanoSocket API
3.2 Sensinode NanoStack 2.0 lite
Sensinode NanoStack 2.0 lite is an embedded operating system and a 6LoWPAN protocol stack designed especially for low power and cheap wireless sensor devices.
The protocol stack is designed to comply with a set of standards mostly provided by IETF 6LoWPAN working group. Table 3 describes the layer structure of the protocol stack and the used standards for each protocol layer.
CC-6LOWPAN-DK-868
Page 16 of 61
Layer
Standard
Description
PHY
802.15.4g [4]
Link layer communication
-GFSK modulation
-FHSS support
-Single band in EU
MAC
802.15.4e [5]
Link layer communication
-Addressing modes (16 bit addressing mode)
-AES-128 bit CCM* support
IP
draft-ietf-6lowpan-hc-13 [1]
Network layer communication, routing
-Addressing modes (128 bit, multicast group 2, link local)
Neighbour Discovery
draft-ietf-6lowpan-nd-13 [2]
Network layer communication, address registration, network scan. Neighbour resolution.
Routing method
Draft-ietf-roll-rpl-13 [3]
Network layer communication, coordinator controlled routing.
Table 3. Sensinode 6LoWPAN Stack Layer Definitions.
3.2.1 Bootstrap process When a node is powered up and set to search for network, it activates the MAC and PHY radio
operations automatically, providing a fully automatic bootstrap process.
3.2.2 Synchronization All nodes must synchronize to a simple 6LoWPAN Edge Router since the radio PHY supports
frequency hopping system. When the synchronization is established, each node will start hopping on the predefined channels. Each node remains in a channel for 350 ms, this time period is called an active period. After each active period, a new channel is chosen and nodes remain in a guard period for 50ms. During that period, radio receivers are disabled and no communication is performed. Each 50ms slot in the active period and the guard period is called a superframe. Each superframe consists of 330 microsecond slots. Each superframe causes an interrupt for the radio module. This interrupt is served by a crystal; the crystal must follow tolerances stated in the respective datasheet in order to keep up the synchronization. Note that the synchronization is established even if the system is of single channel type. During the active period, RF receiver is active and MCU is running. (In CC430F5137 CPU sleeps if no other operations are performed in order to keep the power consumption at a minimum).
The synchronization process is described here. First, a powered and activated node scans for the beacon by broadcasting a beacon request periodically. Each node which is already joined to the network will reply with a unicast beacon to the originator of the beacon requests. The beacon contains timing information of the superframe. The beacon payload is described in Table 4.
Byte 1 2 3 4
5
Value
'S'
'F'
Remaining slots in superframe
Superframe ID
Next channel table index
Table 4. Beacon payload.
Here, the 'S' and the 'F' are header bytes to discard beacons of other systems. The remaining slots field in the superframe message describe how many 330 us slots are left in a current superframe. The superframe ID describes the number of the current superframe. Superframes are numbered from 0 to 7; where 1 to 7 is the active period superframes and superframe 0 indicates the guard period. Beacons and beacon requests are built according to IEEE802.15.4e specification [5]. After synchronization is performed, it is updated with ~10 second interval by sending unicast beacon request to the node that responded to the beacon.
CC-6LOWPAN-DK-868
Page 17 of 61
3.2.3 Neighbour Discovery and Router Solicitation When a node is synchronized, the ICMP (Internet Control Message Protocol) layer is activated. The
ICMP layer scans for suitable routing nodes or Edge Routers by broadcasting a Router Solicitation (RS) message. On reception of a RS, a routing node responds by sending a link local (unicast) Router Advertisement (RA) to the scanning node.
On reception of a RA, the joining node receives the IPv6 prefix of the network. The prefix is used to communicate within a simple 6LoWPAN network. Here, the prefix is defined to be 8 first bytes of the IPv6 address that the NanoRouter advertises. After the prefix information is solicited, the node sends a Neighbour Solicitation (NS) message. The NS message is used to solicit neighbour information of the network. Here, a neighbour cache size is zero and therefore contains no entries. The NS also contains a header field to register an allocated 16-bit short address. As a response to the NS, a Neighbour Advertisement (NA) is sent. The NA message contains information of advertising node and status fields if the address allocation was successfully performed.
The NS is sent first to a routing node which then delivers it to the Edge Router using RPL routing, if the scanning node cannot reach the Edge Router directly. The NA message is sent from the Edge Router to the routing node, which then sends it to the registrating node by using the link local unicast. More detailed information can be found from Draft-ietf-6lowpan-nd-13 (draft-ietf-6lowpan-nd-13) [2].
3.2.3.1 Fixed packet formats
In order to achieve a very lightweight 6LoWPAN stack, some packet formats need to be fixed to avoid unnecessary packet processing. In this section fixed packet formats are described. Table 5 describes fixed packet formats of Neighbour Discovery messages.
Message
Format
Router Solicitation (RS)
SLLAO
Router Advertisement (RA)
PIO, ABRO, SLLAO
Neighbour Solicitation (NS)
ARO, SLLAO
Neighbour Advertisement (NA)
ARO, SLLAO
Table 5. Fixed Neighbor Discovery packet formats.
If other packet formats of Neighbour Discovery messages are received, they are discarded silently. Detailed explanation of SLLAO, PIO, ABRO and ARO can be found from [2].
3.2.4 RPL: IPv6 Routing Protocol for Low power and Lossy Networks In order to achieve a lightweight 6LoWPAN stack, routing is based on RPL control messages (DIS,
DIO, DAO and DAO-ACK). The routing is coordinated by the NanoRouter 2.0 software running on the Edge Router, which keeps record of routing tables as well as whiteboards over time.
Nodes form topological paths extending from the access point. Each node „knows‟ their RPL parent.
Each node allows an unlimited amount of child nodes, but only one child may continue routing. This is controlled by RPL poisoning and by sharing DIO message information required for routing. Each node is registered into the Edge Router (NS, DAO), so the Edge Router can form a whole path into a single node by summarizing all the registration data. Finally, the Edge Router knows the destination address, path and depth in a network and therefore is able to route data to the destination. Forwarded messages are also having a flag (RPL hop-by-hop option header) which indicates the direction of forwarded data (up and down).
In routing systems where flow paths are used, each „knot‟-node can become a problem. As a flow spreads into separate flows, routing becomes impossible. Each node can have only one routing child, but unlimited amount of non-routing child nodes. Therefore routing is allowed only in a node which was connected to a routing node as the first child. This logic is controlled by a timer, by keeping the first child addressing information in memory and by restricting routing using RPL control message (DIO).
Draft-ietf-roll-rpl-13 [3] defines the used routing protocol. It contains a few ICMP layer messages called RPL control messages. These messages contain information of routing nodes and hosts. The information is gathered to the Edge Router and routing configurations are sent all over the simple 6LoWPAN network. Table 6 illustrates a basic description of each message type.
CC-6LOWPAN-DK-868
Page 18 of 61
Message type
Description
Addressing options
DIS
Used to scan for RPL DODAG.
Multicast, unicast
DIO
Used to advertise RPL DODAG.
Multicast, unicast
DAO
Contains routing information from source to the next hop parent.
Unicast DAO-ACK
Acknowledge message for DAO.
Unicast
Table 6. RPL control messages
When the node has accomplished Neighbour Discovery, the RPL routing protocol takes place. A joining node scans for a Destination Oriented Directed Acyclic Graph (DODAG) Information Object (DIO) by broadcasting a DODAG Information Solicitation (DIS) message. When a routing node receives the DIS message, it sends the DIO as a response. The DIO may, or may not, contain DODAG information. All details of this functionality are described in [3].
The DIO message also contains address information of the parent and a RPL root which is the Edge Router. On reception of the DIO, a Destination Advertisement Object (DAO) is sent to the RPL root after a predefined time. The DAO contains route information from the RPL host to the RPL parent. Here, this information represents one logical interconnection within the simple 6LoWPAN network.
When the root receives the DAO, it gathers route information of the DAOs to a routing table. The routing table can be used to build a whole path from the root to the destination node. This allows the root to send data to any registered and joined node within a RPL DODAG. As a response to the DAO, a DAO-ack is sent if requested.
In order to achieve a lightweight 6LoWPAN stack, P2P data (data going from node to node) has to be delivered to the Edge Router and then routed from the Edge Router to the destination node. More detailed information of each packet format can be found from [3]. It is however possible to send data directly from one node to another by using the multicast feature, given that the nodes are within the same physical RF range.
3.2.4.1 Fixed packet formats
Draft-ietf-roll-rpl-13 [3] defines multiple formats for RPL control messages and their options. Table 7 describes fixed packet formats for each RPL control message.
RPL control message
Options
DIS
No options
DIO
DODAG configuration, metric container or only metric container
DAO
RPL target, transit information
DAO-ack
No options
Table 7. Fixed formats of RPL control messages.
Any other formats of RPL control messages are discarded silently.
3.2.4.2 DODAG configuration option
This CC-6LOWPAN-DK-868 kit uses a custom RPL objective function, please see [3] for more information. Here, an Objective Code Point (defined in a DODAG configuration in [3]) is defined to be:
MSB byte
LSB Byte
's'
'n'
Table 8. RPL Objective Code Point.
CC-6LOWPAN-DK-868
Page 19 of 61
The Objective Code Point indicates a used objective function. The Objective Function requires a metric container. The metric container has the following format:
Byte 1
Byte 2
Byte 3
Byte 3
Type = 2
Length = 2
's'
Hop count
Table 9. RPL Metric container format.
The metric container must be included within a DIO and if it not exists, the DIO is discarded silently. A node that doesn't receive DODAG configuration must advertise its rank as INFINITE_RANK (0xffff).
3.2.4.3 Sensinode custom Objective Function
The used Objective Function is based on a link quality metric where the received signal strength indicator is graded from 1 to 8, where 1 is the best possible link and 8 is the worst link. The rank used in RPL control messages is then calculated on the reception of a DIO message. The calculated link quality grade is added to the received rank. The calculated rank is then divided by a hop count within the metric container and is compared to the current rank divided with current hop count. If the new rank is smaller than the old rank, a topology change is made. Therefore a DODAG configuration defines minimal rank increase of 255*1 and maximum rank increase of 8*255. For platforms not supporting RSSI calculation, default rank increase of 3 can be used. Table 10 summarizes these definitions.
Definition
Value
Minimum rank increase
255*1
Maximum rank increase
255*8
Default rank increase
255*3
Table 10. DODAG configuration parameters.
A more detailed explanation of these parameters can be read from [3]
3.2.5 Periodic processes This section describes the periodic messaging within a simple 6LoWPAN network. In order to update
the routing information, the RPL protocol sends messages periodically to maintain and update routes. The period is mainly controlled by Edge Router (NanoRouter) but may change dynamically due to RF events within a network.
In order to verify the connectivity and avoid duplicate address allocation, also the Neighbour Discovery process is performed periodically. The period may change depending on failure events within a network.
The synchronization is also updated periodically as explained in 3.2.2. Timings may also change due to RF errors and accepted beacons.
3.2.6 Error situations Users of the kit need to be aware of and fully understand the limits of the radio range of the used
devices. If the node doesn't have a network within its radio range, it is not able to join the network. If default firmware (Network Analyzer application) are used, the LEDs will indicate (via RSSI) this kind of a communication problem as explained in Table 1.
As the routes are maintained based on periodic scans and advertisements, the network do not support a high grade of mobility. There will be communication losses if a node has been joined to an existing network but then is moved to a different location within the network. This is due to the fact that the nodes cannot realize the change in topology very fast. However, the network is able to do self-healing in these situations by listening to advertisements all the time.
CC-6LOWPAN-DK-868
Page 20 of 61
3.3 CC-6LOWPAN-DK-868 Software Projects
Included in the kit are example projects to be used with IAR Embedded Workbench. This section describes the setup, use of, and installation of those projects.
3.3.1 IDE installation The projects included in the kit are for the IAR Embedded Workbench IDE 5.20 for MSP. It is possible
to use the "Kick-start" version of the IAR Embedded Workbench to build the application examples for CC1180DB. The IAR Kick-start version allows the user to build applications not exceeding 8kB. The demo application (Network Analyzer) for CC1180DB in the kit is using the NAPSocket library, and the build size is about 4kB of Flash and 2kB of RAM (including the NAPSocket library).
To be able to build a CC430 application one must use the full version of IAR Embedded Workbench, due to the size of the 6LoWPAN CC430 NanoSocket library. The build size for the CC430 demo application (including 6LoWPAN stack) is about 19kB of Flash and 3kB of RAM. This leaves 13kB of flash and about 1kB of RAM to the user application.
For software development and modification of the preprogrammed firmware (Network Analyzer) the following steps are needed:
1. Install IAR Embedded Workbench for MSP, all versions can be found here: IAR Embedded
Workbench
2. Download the CC-6LOWPAN-DK-868 Application Example zip files from
http://www.ti.com/6lowpan and unzip the files.
3. Download the NAP Socket library source from http://www.ti.com/6lowpan; this is needed to get the .lib file that the CC1180 example application is using. It is also needed if you want to run/port the application in/to another host MCU.
Make sure to extract the NAP Socket library and Example Application into the same folder, in order to not have to change the settings in the IAR projects.
For more information on the different IDE options and details please visit http://www.iar.com The examples are all configured as IAR workspaces, one workspace for CC430 and one for
MSP430F45438A (to be used on the CC1180DB). The workspace for CC430 is called CC430NetworkAnalyzer.eww and the workspace for MSP430 (for use on the CC1180DB) is called NanoHOEX.eww.
The files are organized into folders corresponding to their location in the file structure, e.g.:
Libraries - this contains used library file. Either CC430 NanoSocket library or Sensinode NAP
Socket library for MSP430 (for CC1180DB).
Applications - the sample applications. Platform - this contains miscellaneous utilities, such as ADC driver for temperature/battery
level measurements.
IAR automatically creates an additional directory, Output, that contains any debug or list files. The project configurations are all fairly simple to ease the transition to other platforms. Changes to the
default project configuration are the following (can be found under project Options-> Project: Options) CC430 project:
General Options: Target - change Device to CC430F5137. Library Configuration - CLIB.
Library options - Change to Large Printf formatter. Change to Large Scanf formatter. Stack/Heap - Override default and set Stack size: 256, Data16 heap size: 256.
C/C++ Compiler: Language tick multifile comp. Preprocessor - Under "Additional include
directories" the relative paths for all files are added. Otherwise IAR will display a warning if the project directory changes, since IAR by default uses absolute paths in its project configuration. Under Defined symbols: add NS_DEBUG=1 (if debug interface shall be enabled) and MSPCORETYPE=5137.
Loading...
+ 46 hidden pages