User Tools

Site Tools


proiecte:coap-sparrow

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
proiecte:coap-sparrow [2017/01/23 19:20]
dan.dragan
proiecte:coap-sparrow [2017/01/26 23:33] (current)
iulia.manda [Porting CoAP on Sparrow v4]
Line 13: Line 13:
 6LoWPAN is a networking technology or adaptation layer that allows IPv6 packets to be carried efficiently within small link layer frames. It has defined encapsulation and header compression mechanisms that allow IPv6 packets to be sent and received over IEEE 802.15.4 based networks. 6LoWPAN is a networking technology or adaptation layer that allows IPv6 packets to be carried efficiently within small link layer frames. It has defined encapsulation and header compression mechanisms that allow IPv6 packets to be sent and received over IEEE 802.15.4 based networks.
  
-{{:proiecte: 6lowpan.png | IPv6 network with a 6LoWPAN mesh network}} +In the figure below, one may see an IPv6 network, including a 6LoWPAN mesh network. The 6LoWPAN network is connected to the IPv6 network using an edge router. This edge router or coordinator as we call it in our project performs the following actions:  
-IPv6 network with a 6LoWPAN mesh network =+* the data exchange between 6LoWPAN devices other IPv6 network 
 +* local data exchange between devices inside the 6LoWPAN 
 +* generation and maintenance of the radio subnet 
  
-{{:proiecte: coaprtos.png | 6LoWPAN mesh network with FreeRTOS}} +{{ :proiecte: 6lowpan.png?600 IPv6 network with a 6LoWPAN mesh network}} 
-= Previous model of a 6LoWPAN mesh network =+ 
 +The starting point CoAP implementation was supported by 6LoWPAN mesh networks that used as Coordinator a development board with an Atmel ARM-based microcontroller and the Routers and Devices were development boards with Atmel ATMega128rfa1 microcontrollers. In this model the Coordinator contained Real Time Operating System (FreeRTOS) with a scheduler designed to provide a predictable execution pattern. The scheduler was used to plan for execution both initialization tasks for network, low-power IP and CoAP tasks and events like responding to device join/leave requests, responding to CoAP requests.   
 +   
 +{{ :proiecte: coaprtos.png?600 | 6LoWPAN mesh network with FreeRTOS}}
  
 ===== Implementation and setup configuration ===== ===== Implementation and setup configuration =====
  
-{{:proiecte: coapbaremetal.png | 6LoWPAN mesh network without RTOS support}} +The new approach required using Sparrow v4 for all three types of nodes. Porting the Device and Router applications was not very difficult because the previous model used the same microcontroller, so the only changes were for pin enablement (sensors and LEDs) and build configuration files. 
-6LoWPAN mesh network on Sparrow =+On the Coordinator side the effort was more consistent. The figure below shows the new model with a redesigned network. First of all, the build configuration files needed to be rewritten, because of the switch from ARM to AVR, not only for the CoAP application, but also for other dependencies, like ROM, 6LoWPAN subroutines and CoAP subsystem. Since the flash size was now, reduced to half, the Real Time OS required to be removed. The execution pattern was predictible, so the RTOS scheduler was easily replaced with bare metal support for the initialization tasks and callbacks. 
 + 
 +{{ :proiecte: coapbaremetal.png?600 | 6LoWPAN mesh network without RTOS support}} 
 + 
 +6LoWPAN defines two categories of routing: mesh-under and route-over. Our project is based on the mesh-under routing method, which uses the layer-two data link layer addresses (IEEE 802.15.4 MAC and short address) to forward data packets. In a mesh-under system, routing of data happens transparently, hence mesh-under networks are considered to be one IP subnet. The only IP router in such a system is the edge router. A broadcast domain is established to ensure compatibility with higher layer IPv6 protocols such as duplicate address detection. These messages have to be sent to all devices in the network, resulting in high network load. 
  
 In order to set up a new Sparrow wireless sensor network using COAP the following instructions should be used: In order to set up a new Sparrow wireless sensor network using COAP the following instructions should be used:
  
-* Request access to Dresden Elektronik 6LoWPAN stack repository[1]. +* Request access to Dresden Elektronik 6LoWPAN stack repository [1]. 
-Clonne the git repository+Install the next packages on your Linux machine: avr-libc, avrdude, binutils-avr, gcc-avr (example for Debian based systems) 
 +<file> 
 +sudo apt-get install avr-libc avrdude binutils-avr gcc-avr 
 +</file> 
 +* Clone the git repository
 <file> <file>
 git clone https://gitlab.cs.pub.ro/dan.dragomir/dde-stack git clone https://gitlab.cs.pub.ro/dan.dragomir/dde-stack
 </file> </file>
 +* Switch to sparrow_support git branch
 +<file>
 +cd dde-stack/
 +git checkout sparrow_support
 +</file>
 +* Build ROM static library for Coordinator with MAC address support
 +<file>
 +cd ROM/lib/Sparrow_v41/
 +make all
 +</file>
 +* Build SLOW static library for Coordinator with MAC address support
 +<file>
 +cd SLOW/lib/Sparrow_v41/
 +make all
 +</file>
 +* Build the COAPEcho Application for Coordinator and upload it on a Sparrow node
 +<file>
 +cd Applications/SLOW_Examples/COAPEcho/Coordinator/Sparrow_V41/GCC/
 +make all
 +cd bin
 +sudo ~/arduino-1.6.12/hardware/tools/avr/bin/avrdude -C~/arduino-1.6.12/hardware/tools/avr/etc/avrdude.conf -v -patmega128rfa1 -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:COAPEcho-Coordinator.hex:i
 +</file>
 +* Build the COAPEcho Application for Router and upload it on a Sparrow node
 +<file>
 +cd Applications/SLOW_Examples/COAPEcho/Router/Sparrow_V41/GCC/
 +make all
 +cd bin
 +sudo ~/arduino-1.6.12/hardware/tools/avr/bin/avrdude -C~/arduino-1.6.12/hardware/tools/avr/etc/avrdude.conf -v -patmega128rfa1 -carduino -P/dev/ttyUSB1 -b57600 -D -Uflash:w:COAPEcho-Router.hex:i
 +</file>
 +* Build the COAPEcho Application for Device and upload it on a Sparrow node
 +<file>
 +cd Applications/SLOW_Examples/COAPEcho/Device/Sparrow_V41/GCC/
 +make all
 +cd bin
 +sudo ~/arduino-1.6.12/hardware/tools/avr/bin/avrdude -C~/arduino-1.6.12/hardware/tools/avr/etc/avrdude.conf -v -patmega128rfa1 -carduino -P/dev/ttyUSB2 -b57600 -D -Uflash:w:COAPEcho-Device.hex:i
 +</file>
 +
 +The image below represents the output of a serial monitoring of the Coordinator when three other Sparrow nodes joined the network. The Coordinator assigns MAC addresses and short addresses to the routers and devices and registers them in a children table.
 +
 +{{ :proiecte: serialmonitor.png | Serial monitor for Coordinator}}
  
 +The below topology presents a coordinator, a router in the middle and two devices. The router may be used to route messages from one node destined to another. The hosts can also be sleepy devices, waking up periodically to check its parent for data, enabling very low power consumption.
 + 
 +{{ :proiecte: topology.jpg?600 | Sparrow CoAP topology}}
  
 ===== Resources ===== ===== Resources =====
 * [1] https://gitlab.cs.pub.ro/dan.dragomir/dde-stack * [1] https://gitlab.cs.pub.ro/dan.dragomir/dde-stack
 +* [2] Jonas Olsson, 6LoWPAN demystified, Texas Instruments Incorporated
 +* [3] https://tools.ietf.org/html/rfc7252
proiecte/coap-sparrow.1485192018.txt.gz · Last modified: 2017/01/23 19:20 by dan.dragan