The new structure of libcoap allows to clone Contiki in a
subdirectory. The example build now uses Makefile to first clone
Contiki and then invoke Makefile.contiki for the actual build.
The TARGET is set to minimal-net by default but can be changed to
any other (tested) target.
Some configuration flags have been changed since Contiki version 3.
The Makefile.contiki for building a server example that uses libcoap
as a Contiki app has been fixed. The following builds now succeed:
make -f Makefile.contiki TARGET=minimal-net
make -f Makefile.contiki TARGET=econotag
make -f Makefile.contiki TARGET=mbxxx
uip_ds6_prefix_add is using 6 arguments, better use explicit argument
list than let the compiler decide. Some compiler will complain if some
optionally arguments are missed.
Made vpath %.c point to ../../src and repaired include path.
The common part of the Makefile has been moved to Makefile.common
to leverage Makefile creation for other platforms such as econotag.
Directory examples/contiki now contains a small example server for
Contiki and a Makefile for platform minimal-net.
Build:
make contiki # clones Contiki
make server # creates the minimal-net coap server
Run:
Unfortunately, you have to run the server with sudo unless you
set CAP_NET_ADMIN for both, the server executable, and ifconfig
(sudo setcap cap_net_admin+pei ...).
sudo ./server
Then, add the server's interface address to the tap0 device and
optionally set a default route:
sudo ip -6 a a aaaa::1000 dev tap0
sudo ip -6 r a aaaa::/64 dev tap0
Although everything should work now, it does not. I had to send
router advertisements on tap0:
sudo radvd -C ./radvd.conf
Note that on Debian (and Ubuntu, and ...), radvd will not start
when IPv6 forwarding is disabled (which is usually the case on
end systems). Trying to enable like this did not work for me:
sudo sysctl -w net.ipv6.conf.tap0.forwarding=1
sudo sysctl -w net.ipv6.conf.tap0.mc_forwarding=1
Workaround (ugly): get the radvd sources, compile them and use that.