CoAP over 6LoWPAN Introduction

Page Summary

This page is an introduction to the “Constrained Application Protocol” (CoAP). Lobaro hardware implements this protocol to interact wirelessly with external CoAP Clients over IPv6 in a standardized way.

The target audience is system integrators which want to embed Lobaro sensor solutions into their (existing) systems and networks without doing any electrical engineering work or low-level embedded programming.

Quick Facts

  • CoAP ≈ lightweight HTTP
  • URI and content-type support
  • Very low overhead (binary data)
  • Easy cooperation with HTTP (e.g. Proxies)
  • Fully Standardized by RFC7252
  • Many free implementations (C#,Go, Java…)
  • Designed for building automation & M2M
  • Reliable transmission over UDP

Key Terms

  • HTTP like
  • Client & Server architecture
  • Multicast support
  • RFC7252
  • CoAP over 6LoWPAN
  • Building automation
  • Machine-to-machine (M2M)

Sensor Readout using CoAP

1
2
3
4
1

Lobaro IPv6 Universal Box running temperature-sensor CoAP firmware.

2

Transparent IPv6 Gateway (USB or LAN Version)

3

Free CoAP implementations exist for various programming languages!

4

GET request to URI “tempRoom23” with uri-query “type=avg”

In the image above you see a basic readout of a CoAP resource. For this example the resource represents the temperature of a fictional room with number 23 and we are interested in the average value for some measurement period. To achieve this the Lobaro universal box comes awake in a predefiened time interval and performs the actual measurement of the room temperature. For this a temperature sensor has to be attached to the box. For example, it could be of type analog PT100 RTD or digital DS1820.

Very similar to a webpage on a standard http webserver the temperature values are stored on the Lobaro universal box which implements a CoAP server. For a wireless temperature readout the CoAP client has to send a “GET” request containing the uri of the resource. Optionally the client can attach some uri-query in this case “?type=avg”, to indicate that the average temperature rather than the actual  one is requested. In the above example case the full client CoAP request looks like:

GET: coap://[fe80::0211:7d00:0030:8e3f]:5684/temperatures/room23?type=avg

The CoAP server will answer most likely with an so called “piggybacked ACK” which contains both the acknowledge of the request and the payload of the response. In this example the average temperature of room 23. You can learn more about the request / response  model of CoAP by diving into chapter 2 of the CoAP RFC7252.

CoAP has been implemented in various programming languages. These libraries  can be used to build easily a CoAP client to interact with our CoAP hardware implementing the server side of the data exchange. All you need to know are the basics of UDP sockets & IPv6 networks, but you don’t have to take a soldering  iron into your hand or do low-level embedded firmware programming in “C”.

A very nice CoAP client has been build as mozilla firefox browser plugin (“Copper(Cu)“), which enables you to access resources on our embedded CoAP servers directly over the browser address  bar! We recommend  this tool for your first steps accessing Lobaro embedded  CoAP servers.

6LoWPAN CoAP System Architecture

Lobaro System Architecture

online GPS Tracker on map

CoAP Introduction Video:

On the left you can watch a fantastic video by Zach Shelby about CoAP. He is one of the major authors of CoAP.

Please take the time and watch it if you want to integrate our CoAP solutions into your projects and systems.

3rd party CoAP implementations & libraries:

The following 3rd party CoAP tool have been tested to work with Lobaro solutions:

…but since CoAP is an open standard you can use any correct CoAP implementation in your favourite programming language to read out & control our hardware!
See the wikipedia article of CoAP for an longer list of 3rd party CoAP implementations or visit this summary page.