This is an old revision of the document!
Dragan Dan-Stefan - Master AAC
The Constrained Application Protocol (CoAP) is a web transfer protocol that is intended for use with reduced-capability, low-power devices. These nodes often have 8-bit microcontrollers with small amounts of ROM and RAM. CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types. This project uses an existing CoAP implementation over an IPv6 over Low power Wireless Personal Area Networks (6LoWPAN) stack and its main goal was porting the existent environment on Sparrow v4.
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.
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: * the data exchange between 6LoWPAN devices other IPv6 network * local data exchange between devices inside the 6LoWPAN * generation and maintenance of the radio subnet
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.
= 6LoWPAN mesh network on Sparrow =
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]. * Install the next packages on your Linux machine: avr-libc, avrdude, binutils-avr, gcc-avr (example for Debian based systems)
sudo apt-get install avr-libc avrdude binutils-avr gcc-avr
* Clone the git repository
git clone https://gitlab.cs.pub.ro/dan.dragomir/dde-stack
* Switch to sparrow_support git branch
cd dde-stack/ git checkout sparrow_support
* Build ROM static library for Coordinator with MAC address support
cd ROM/lib/Sparrow_v41/ make all
* Build SLOW static library for Coordinator with MAC address support
cd SLOW/lib/Sparrow_v41/ make all
* Build the COAPEcho Application for Coordinator and upload it on a Sparrow node
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
* Build the COAPEcho Application for Router and upload it on a Sparrow node
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
* Build the COAPEcho Application for Device and upload it on a Sparrow node
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
= Serial monitor output for a Sparrow Coordinator =
= Sparrow CoAP topology with a Coordinator, a Router and two Devices =