libcoap currently is available only as source archive or (preferably) can be cloned via Git. A debian package is being worked on.

Get the Code

Latest development releases are available as package for download, or from the git repository.

There is also a stable version which can also be cloned from git.

(Note that the former SF repository is outdated.)

Configuration

On platforms where POSIX system calls are available, the installation follows the usual configure/make cycle as described below.

Linux, Mac OSX and other POSIX platforms

If you have cloned the sources via git, you need to run ./autogen.sh to generate the build scripts. This step is optional when a source archive is used.

Next, say ./configure followed by make and make install.

Besides common GNU options, the configure script provides the following switches to control the build process:

Contiki

An example Contiki application can be found in examples/contiki. You need to run configure (possibly preceded by autogen.sh when cloned from git). The example Makefile will clone the Contiki-NG repository and create a symbolic link in Contiki’s apps directory to the libcoap root directory where Makefile.libcoap is located. After that, a simple server application is build by Makefile.contiki.

There is currently no DTLS support for libcoap with Contiki.

RIOT

Example RIOT application can be found under examples/riot. The examples/riot example Makefile will clone the RIOT repository and then build an example client, server and test server within the RIOT subdirectory.

LwIP

Using libcoap with LwIP requires a hand-crafted Makefile. Please refer to examples/lwip/Makefile to see how this is done.

There is DTLS (TinyDTLS) support for libcoap with LwIP.

TinyOS

The usage of libcoap with TinyOS is documented in the TinyOS Wiki. Note that this implements an outdated version of the protocol.

There is no DTLS support for libcoap with TinyOS.

libcoap

  • Olaf Bergmann •  bergmann@tzi.org  •  2015—2024
  • PGP key fingerprint: 5E5B E022 04CA 0B0E A2A0 0CBA A845 261A 9F38 A9A0

    (former PGP key fingerprint: 5111 C4C4 4DB3 7FFB 1EA3 E264 606A 6D46 C40B F79B)