[Contiki-developers] CoAP development road-map?

224 views
Skip to first unread message

Jonathan Chung

unread,
Jul 15, 2011, 12:28:24 AM7/15/11
to contiki-d...@lists.sourceforge.net
Hi,

We are looking to develop CoAP applications and would like to know if there is a road-map CoAP development in the Contiki project to support features in the examples/rest-example/README To Do lists (e.g. Tokens, Retransmissions, Option handling, etc), as well as other features (e.g. flexible piggy-back or separate response selection). We would like to contribute to the project but are mindful of duplicate efforts.

Regards,
Jonathan Chung

Barbieri Davide

unread,
Jul 18, 2011, 8:24:48 AM7/18/11
to Contiki developer mailing list

I’m very interested in it too, since several drafts have been released recently!



--
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

Kovatsch Matthias

unread,
Jul 18, 2011, 9:49:23 AM7/18/11
to Contiki developer mailing list

Hi

 

There is a new CoAP implementation for Contiki that is intended to be included in the official repository.

At the moment it is available at:

 

https://github.com/mkovatsc/SmartAppContiki -> branch coap-07

 

The update to draft 07 is quite recent and I have to check whether the new rest-example runs out of the box…

Branch coap-06 should work.

 

Best regards

Matthias

Barbieri Davide

unread,
Jul 19, 2011, 5:01:30 AM7/19/11
to Contiki developer mailing list

Great work! Thanks!

cyril auburtin

unread,
Aug 2, 2011, 11:48:03 AM8/2/11
to Contiki developer mailing list
Hello

in https://github.com/mkovatsc/SmartAppContiki branch coap-06

I wanted to use the rest-server-exemple with minimal-net platform

but it doesn't build, in static-routing.c:

#if !defined (CONTIKI_TARGET_MINIMAL_NET) /* Any other targets will be added here (&& ! defined (OTHER))*/

minimal-net isn't supported?


------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

cyril auburtin

unread,
Aug 2, 2011, 11:57:27 AM8/2/11
to Contiki developer mailing list
in SmartAppContiki/examples/rest-example

make TARGET=minimal-net rest-server-example   gives:

gcc -DRF_CHANNEL=21 -DIEEE802154_CONF_PANID=0xBEEF -DUIP_CONF_IPV6_RPL=1 -DPROJECT_CONF_H=\"project-conf.h\" -ffunction-sections -DWITH_COAP=6 -DREST=coap_rest_implementation -DUIP_CONF_TCP=0 -DCONTIKI=1 -DCONTIKI_TARGET_MINIMAL_NET=1 -DUIP_CONF_IPV6=1 -Wall -g -I/usr/local/include  -O  -I. -I../../platform/minimal-net/. -I../../cpu/native/. -I../../cpu/native/net -I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime -I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk -I../../core/loader -I../../core/. -I../../apps/coap-06 -I../../apps/rest-engine -MMD -c static-routing.c -o obj_minimal-net/static-routing.o
static-routing.c:24:21: fatal error: node-id.h: Aucun fichier ou dossier de ce type
compilation terminated.
make: *** [obj_minimal-net/static-routing.o] Erreur 1
rm rest-server-example.co



------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1

David Kopf

unread,
Aug 2, 2011, 12:14:02 PM8/2/11
to Contiki developer mailing list
If you are referring to
https://github.com/mkovatsc/SmartAppContiki/blob/coap-06/examples/rest-example/static-routing.c
I don't see that line.
What happens if you just take it out?

-----Original Message-----
From: cyril auburtin
Sent: Tuesday, August 02, 2011 11:48 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?


Hello

in https://github.com/mkovatsc/SmartAppContiki branch coap-06
I wanted to use the rest-server-exemple with minimal-net platform

but it doesn't build, in static-routing.c:

#if !defined (CONTIKI_TARGET_MINIMAL_NET) /* Any other targets will be added
here (&& ! defined (OTHER))*/

minimal-net isn't supported?


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1

David Kopf

unread,
Aug 2, 2011, 12:23:40 PM8/2/11
to Contiki developer mailing list
That is just a way to save and read back a 32 bit node id to eeprom on
various platforms. If it won't work without that copy node-id.h and .c from
some other platform and dummy out the two routines, and return your favorite
number e.g. 0xdeadbeef. If you want multiple instances you would have to
change it for each one I suppose.

-----Original Message-----
From: cyril auburtin

Sent: Tuesday, August 02, 2011 11:57 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?


in SmartAppContiki/examples/rest-example

make TARGET=minimal-net rest-server-example gives:

gcc -DRF_CHANNEL=21 -DIEEE802154_CONF_PANID=0xBEEF -DUIP_CONF_IPV6_RPL=1 -DPROJECT_CONF_H=\"project-conf.h\"
-ffunction-sections -DWITH_COAP=6 -DREST=coap_rest_implementation -DUIP_CONF_TCP=0
-DCONTIKI=1 -DCONTIKI_TARGET_MINIMAL_NET=1 -DUIP_CONF_IPV6=1 -Wall -g -I/usr/local/include
-O -I. -I../../platform/minimal-net/. -I../../cpu/native/. -I../../cpu/native/net
-I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime
-I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk
-I../../core/loader -I../../core/. -I../../apps/coap-06 -I../../apps/rest-engine
-MMD -c static-routing.c -o obj_minimal-net/static-routing.o
static-routing.c:24:21: fatal error: node-id.h: Aucun fichier ou dossier de
ce type
compilation terminated.
make: *** [obj_minimal-net/static-routing.o] Erreur 1
rm rest-server-example.co

Hello

in https://github.com/mkovatsc/SmartAppContiki branch coap-06
I wanted to use the rest-server-exemple with minimal-net platform

but it doesn't build, in static-routing.c:

#if !defined (CONTIKI_TARGET_MINIMAL_NET) /* Any other targets will be added
here (&& ! defined (OTHER))*/

minimal-net isn't supported?

Great work! Thanks!

Hi

Branch coap-06 should work.

Best regards

Matthias

Hi,

Regards,
Jonathan Chung

--


The information transmitted is intended for the person or entity to which it
is addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination or other use of, or taking of any
action in reliance upon, this information by persons or entities other than
the intended recipient is prohibited. If you received this in error, please
contact the sender and delete the material from any computer.

cyril auburtin

unread,
Aug 2, 2011, 1:25:05 PM8/2/11
to Contiki developer mailing list
ok
actually I have tried to run the rest-server-example with minimal-net
first with latest contiki git sources

I can ping6 the server
I have used copper Firefox extension , but it times out

the same thing happen, when I run the rest-server-example.csc in cooja
ping6 works but not copper

So I thought it would work better with https://github.com/mkovatsc/SmartAppContiki


Kovatsch Matthias

unread,
Aug 3, 2011, 10:21:11 AM8/3/11
to Contiki developer mailing list

Hi

 

minimal-net was working, it should only be an issue with the configuration (Makefile and project-conf.h).

I will have a look at it and fix it…

 

Ciao

Matthias

cyril auburtin

unread,
Aug 3, 2011, 11:47:55 AM8/3/11
to Contiki developer mailing list
thanks matthias

I have tried with latest contiki code
to launch rest-server-exemple with minimal-net target
also launched
sudo route add -6 aaaa::/64 tap0
sudo ip -6 address add aaaa::1/64 dev tap0
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo /etc/init.d/radvd stop
sudo /etc/init.d/radvd start

then with copper I am not able to do anything with the rest-server, it times out
I don't know what to debug since I never enter in the handler of the server

for example trying to get helloworld ressource, copper says
INFO: TransactionHandler.cancelTransactions [cancelled transaction 41293]
=sending CoAP message===
 Type: Confirmable
 Code: GET
 Transaction ID: 41294
 Options:
  Uri: /helloworld [1 option]
 Payload:

 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
=re-sending CoAP message
 Transaction ID: 41294
 New timeout: 4000
 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
=re-sending CoAP message
 Transaction ID: 41294
 New timeout: 8000
 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
=re-sending CoAP message
 Transaction ID: 41294
 New timeout: 16000
 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
=re-sending CoAP message
 Transaction ID: 41294
 New timeout: 32000
 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
=timeout================
 Transaction ID: 41294
 =======================
INFO: errorHandler()



I would like to launch coap-client-exemple with server address aaaa::206:98ff:fe00:232 but not with minimal-net since rest-server is already running, coap-client would take the same address
how could this be done?


I have tried with cooja, and only helloworld ressource works

INFO: loading cached resource links
=sending CoAP message===
 Type: Confirmable
 Code: GET
 Transaction ID: 61786
 Options:
  Uri: /helloworld [1 option]
 Payload:

 =======================
-sent UDP datagram------
 Length: 15
 -----------------------
-receiving UDP datagram-
 Length: 19
 -----------------------
=received CoAP message==
 Type: Acknowledgment
 Code: 2.16 Unknown by Copper
 Transaction ID: 61786
 Options:
  Content-Type: text/plain [0]
 Payload:
Hello World!

 =======================
INFO: defaultHandler()


INFO: loading cached resource links
=sending CoAP message===
 Type: Confirmable
 Code: GET
 Transaction ID: 29889
 Options:
  Uri: /.well-known/core [1 option]
 Payload:

 =======================
-sent UDP datagram------
 Length: 21
 -----------------------
-receiving UDP datagram-
 Length: 4
 -----------------------
=received CoAP message==
 Type: Acknowledgment
 Code: 5.04 Gateway Timeout
 Transaction ID: 29889
 Options:
 Payload:

 =======================
INFO: defaultHandler()



I have tried with copper coap06 and coap03 versions, which versions contiki coap is today?

thanks for the help




Kovatsch Matthias

unread,
Aug 3, 2011, 11:53:31 AM8/3/11
to Contiki developer mailing list

Okay, the basic fix is to remove static-routing.c from the source-files for minimal-net, as it is unused anyway:

 

ifneq ($(TARGET), minimal-net)

PROJECT_SOURCEFILES += static-routing.c

endif

 

I do, however, have a problem reaching the minimal-net server since the changes at the platform code with the new HARD_CODED_ADDRESS define…

David Kopf

unread,
Aug 3, 2011, 11:59:57 AM8/3/11
to Contiki developer mailing list
Hi Cyril,

minimal-net will take a hard coded address in either the
/platform/contiki-conf.h file or /platform/contiki-main.c
Read the comments there, basically
#define HARD_CODED_ADDRESS "fdfd::10" //assign prefix and ipv6 address
fdfd::ff:fe00:10
With rpl only the link-local part ::ff:fe00:10 is used as the prefix comes
from the border router.
Setting the :10, :20, etc for each build allows different instances.

Running on minimal-net you should be able to see the traffic with wireshark
to indicate why the server is not responding. I suspect the syn/ack
handshake is working but the GET is overflowing the uip buffer.

Are you using the right port number for coap?

-----Original Message-----
From: cyril auburtin
Sent: Wednesday, August 03, 2011 11:47 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?


thanks matthias

I have tried with latest contiki code
to launch rest-server-exemple with minimal-net target
also launched
sudo route add -6 aaaa::/64 tap0
sudo ip -6 address add aaaa::1/64 dev tap0
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo /etc/init.d/radvd stop
sudo /etc/init.d/radvd start

then with copper I am not able to do anything with the rest-server, it times
out
I don't know what to debug since I never enter in the handler of the server

David Kopf

unread,
Aug 3, 2011, 12:05:05 PM8/3/11
to Contiki developer mailing list
HARD_CODED_ADDRESS should only affect the minimal-net rpl build unless I
messed it up.
If not defined it should use the mac address set in uip6.c to generate the
[fe80::206:98ff:fe00:232] default.
What address does it report on startup?

-----Original Message-----
From: Kovatsch Matthias
Sent: Wednesday, August 03, 2011 11:53 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

Okay, the basic fix is to remove static-routing.c from the source-files for
minimal-net, as it is unused anyway:

ifneq ($(TARGET), minimal-net)

PROJECT_SOURCEFILES += static-routing.c

endif

I do, however, have a problem reaching the minimal-net server since the
changes at the platform code with the new HARD_CODED_ADDRESS define…

Kovatsch Matthias

unread,
Aug 3, 2011, 12:06:29 PM8/3/11
to Contiki developer mailing list

Okay, my fault, my routing was messed up. It is working now.

I am pushing the fix to SmartAppContiki…

cyril auburtin

unread,
Aug 3, 2011, 12:11:53 PM8/3/11
to Contiki developer mailing list
thanks I will try minimal-net with a rest-server and a coap-client with different ipv6, and debug

yes I tried copper with [aaaa::206:98ff:fe00:232]:61616


cyril auburtin

unread,
Aug 3, 2011, 12:13:41 PM8/3/11
to Contiki developer mailing list
I have code from git://contiki.git.sourceforge.net/gitroot/contiki/contiki
which version of coap does it provide? Is it better to use SmartAppContiki, and which branch
thx


Kovatsch Matthias

unread,
Aug 3, 2011, 12:19:08 PM8/3/11
to Contiki developer mailing list

Okay, just to be sure:

The master of SmartAppContiki is quite outdated, as I am working in branch coap-07.

If you use the coap-07 branch, the CoAP implementation is different from the official Contiki repository! The port, for instance, is now 5683 by default.

 

Your mail just came in ;)

 

As the name tells, coap-07 implements the current draft 07. The official one only provides a subset of draft 03.

David Kopf

unread,
Aug 3, 2011, 12:26:04 PM8/3/11
to Contiki developer mailing list
Sorry I did mess it up, not assigning the aaaa:: prefix if
HARD_CODED_ADDRESS not defined.
I did not notice since I use link-local addresses for testing.
I will push this change to minimal net contiki-main.c:

#if !UIP_CONF_IPV6_RPL
uip_ipaddr_t ipaddr;
#ifdef HARD_CODED_ADDRESS
uiplib_ipaddrconv(HARD_CODED_ADDRESS, &ipaddr);
#else
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
#endif
if ((ipaddr.u16[0]!=0) || (ipaddr.u16[1]!=0) || (ipaddr.u16[2]!=0) ||
(ipaddr.u16[3]!=0)) {
#if UIP_CONF_ROUTER
uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0, 0, 0, 0);
#else /* UIP_CONF_ROUTER */
uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0);
#endif /* UIP_CONF_ROUTER */
#if !UIP_CONF_IPV6_RPL
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
#endif
}
#endif

Kovatsch Matthias

unread,
Aug 3, 2011, 12:37:41 PM8/3/11
to Contiki developer mailing list
Ah, I guessed it would be mandatory to set HARD_CODED_ADDRESS...
Maybe it is nicer to have a #ifndef HARD_CODED_ADDRESS in the Contiki-conf.h rather than having some constant address in the code? Then we have one level less of places to configure something ;)

cyril auburtin

unread,
Aug 3, 2011, 12:38:53 PM8/3/11
to Contiki developer mailing list
I am in coap-06 branch and copper 06
 still minimal-net, with your precedent fix

and coap://[aaaa::206:98ff:fe00:232]:5683/.well-known/core  GET:

=sending CoAP message===
 Type: Confirmable
 Code: GET
 Transaction ID: 28874

 Options:
  Uri: /.well-known/core [1 option]
 Payload:

 =======================
-sent UDP datagram------
 Length: 21
 -----------------------
-receiving UDP datagram-
 Length: 25

 -----------------------
=received CoAP message==
 Type: Acknowledgment
 Code: 4.02 Bad Option
 Transaction ID: 28874
 Options:
  Block2: 0 (128 B/block) [1 byte(s)]
 Payload:
Block out of scope
 =======================
INFO: discoverHandler()


hello is working

but discover doesn't work
I have this alert "ERROR: Main.discoverHandler [Content-Type is null, not 'application/link-format']"




David Kopf

unread,
Aug 3, 2011, 1:23:50 PM8/3/11
to Contiki developer mailing list
The mac address in uip6.c is probably written in stone since that has been
used in all the tutorials and wikis.
#if UIP_CONF_LL_802154
uip_lladdr_t uip_lladdr;
#else /*UIP_CONF_LL_802154*/
uip_lladdr_t uip_lladdr = {{0x00,0x06,0x98,0x00,0x02,0x32}};
#endif /*UIP_CONF_LL_802154*/

HARD_CODED_PREFIX overwrites that at startup to make the tun0 or wpcap
ethernet macs consistent with the assigned ipv6 addresses. Perhaps
UIP_CONF_LL_802154 should have been used instead.

The aaaa:: prefix is in a lot of tutorials too, perhaps an unfortunate
choice because it triggers the 6LoWPAN stateful address compression. IMO it
is not kosher to assign a hard coded prefix to an ipv6 device, that should
be picked up through the interface.

Personally I use link-local fe80::whatever%usb0 for quick tests and fdfd::
when I go the trouble of setting up the interface for prefix advertising.
The non-SLIP Rpl border router is a special case that does not accept RA's
with prefix advertisement, so minimal-net needs that prefix hard coded. But
it could be set in the contiki-conf.h file as the default for all examples,
with the comment that leaving the prefix undefined until the interface
assigns one is the proper way (HARD_CODED_ADDRESS = ::a:b:c:d would give a
unique mac address with no prefix) and that specifying e.g. aaaa::a:b:c:d
would end up with two prefixes if another came through the interface.

It may be clearer to use something like UIP_CONF_IPV6_PREFIX = 0 by default
but settable to foo::/64 if that is really what you want, and
UIP_CONF_LL_802154 for lladdr=bar. That does have the effect of ending up
with the ipv6 address of foo:ff:fe:bar which is kind of inconvenient. foo:1,
foo2:2, foo:3 is easier to type.

Kovatsch Matthias

unread,
Aug 3, 2011, 1:36:14 PM8/3/11
to Contiki developer mailing list

Okay, there is a bug that only shows on minimal-net.

It works exactly once, then the automatic chunking into blocks messes up the byte offset.

I’ll fix that soon.

 

Thanks for triggering the good old minimal-net test! :)

cyril auburtin

unread,
Aug 3, 2011, 2:03:07 PM8/3/11
to Contiki developer mailing list
yes right, that worked once, I could see all ressources, then discovery fails


cyril auburtin

unread,
Aug 3, 2011, 3:20:40 PM8/3/11
to Contiki developer mailing list
thanks it's working well

how is the leds ressource request supposed to be formed?


cyril auburtin

unread,
Aug 4, 2011, 7:06:07 AM8/4/11
to Contiki developer mailing list
I have used post or put query method, on uri: coap://[aaaa::212:7402:2:202]:5683/leds?color=blue with payload 'mode=on'
but would it work with multiple variables in the uri, and if yes how to do it

thx


Kovatsch Matthias

unread,
Aug 4, 2011, 7:07:20 AM8/4/11
to Contiki developer mailing list

Fixed.

 

If you still want to use CoAP-06, also use the coap-07 branch. It includes all three stages (03, 06, 07).

BTW: There is a new Copper version for 07, but I am still waiting for the Mozilla review so that it appears on the website…

cyril auburtin

unread,
Aug 8, 2011, 9:54:14 AM8/8/11
to Contiki developer mailing list
Hello

again with minimal-net, your corrections for rest-server made it work, with copper client

I have tried using coap-client-example.c, with
#define SERVER_NODE(ipaddr)   uip_ip6addr(ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 0x0010) /* minimal-net */

coap-client is built with #define HARD_CODED_ADDRESS      "aaaa::5"
and rest-server with #define HARD_CODED_ADDRESS      "aaaa::10"

I activate radvd forwarding, copper is still able to communicate with rest-server but coap-client says continuously:
ifconfig tap0 up
IPV6 Addresss: [aaaa::ff:fe00:5]
IPV6 Addresss: [fe80::ff:fe00:5]
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core




cyril auburtin

unread,
Aug 11, 2011, 6:22:01 AM8/11/11
to Contiki developer mailing list
coap-client is not working with minimal-net (https://github.com/mkovatsc/SmartAppContiki/tree/coap-07/examples/rest-example branch coap-07)
maybe due to recent changes

$ sudo ./coap-client-example.minimal-net
ifconfig tap0 up
IPV6 Addresss: [aaaa::ff:fe00:5]
IPV6 Addresss: [fe80::ff:fe00:5]
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...
Sending to /.well-known/core
  GETting URL...

with a rest-server with :10 running, (and joinable with copper)



Kovatsch Matthias

unread,
Aug 14, 2011, 11:47:30 PM8/14/11
to Contiki developer mailing list

The client example is just there to give an idea how to implement a client and is thought for Cooja. To have an “interactive client”, it is based on the sky platform and uses a button and an LED server-sided.

The printf is buggy for the timed request, which gets the /toggle resource every 10 seconds.

The printf is actually for the button-event request, which cycles between different resources.

Have a look at the code and use the API calls from coap-0x.h to implement a useful minimal-net client.

I will add another example that uses blocking requests (in terms of control flow) that also support transparent blockwise transfers at the client side.

 

Best regards

Matthias

Kovatsch Matthias

unread,
Aug 25, 2011, 12:50:54 PM8/25/11
to Contiki developer mailing list

I now have a similar problem testing minimal-net client/server under Linux.

The examples work on motes and in Cooja, but not for minimal-net. The problem is that the two minimal-net instances cannot reach each other. If I try ping6, only the instance started first is reachable.

 

I set the correct address for tap0, when adding routes I get error messages:

user@instant-contiki:~$ sudo ip -6 route add fdfd::/64 via fdfd::1

RTNETLINK answers: Invalid argument

user@instant-contiki:~$ sudo route -A inet6 add fdfd::/64 gw fdfd::1

SIOCADDRT: Invalid argument

 

Link-local addresses do not work, either.

 

Is there something special to do, so that all instances are actually on the same tap0 device?

Had anyone multiple instances of minimal-net nodes communicating with each other before?

 

Bye

Matthias

David Kopf

unread,
Aug 25, 2011, 1:17:13 PM8/25/11
to Contiki developer mailing list
I had a rpl border router and two rpl clients working working in windows:
http://www.sics.se/contiki/wiki/index.php/A_RPL_network_on_the_minimal-net_platform
I had to hard code different addresses for each. but they all connected to one loopback using wpcap. Don't know if the same thing
could be done on ubuntu with multiple tuns and maybe a bridge, but the pcap method should work there as well (but would have to be
written).

-----Original Message-----
From: Kovatsch Matthias

Sent: Thursday, August 25, 2011 12:50 PM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

I now have a similar problem testing minimal-net client/server under Linux.

The examples work on motes and in Cooja, but not for minimal-net. The problem is that the two minimal-net instances cannot reach
each other. If I try ping6, only the instance started first is reachable.

I set the correct address for tap0, when adding routes I get error messages:

user@instant-contiki:~$ sudo ip -6 route add fdfd::/64 via fdfd::1

RTNETLINK answers: Invalid argument

user@instant-contiki:~$ sudo route -A inet6 add fdfd::/64 gw fdfd::1

SIOCADDRT: Invalid argument

Link-local addresses do not work, either.

Is there something special to do, so that all instances are actually on the same tap0 device?

Had anyone multiple instances of minimal-net nodes communicating with each other before?

Bye

Matthias

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev

Benjamin Beichler

unread,
Aug 25, 2011, 4:22:15 PM8/25/11
to Contiki developer mailing list
Hi,

i think this is a problem in /cpu/native/tapdev6.c

In the init code the tap0 device is hardcoded. But if you use linux and tap0 is already used, you got another tap device. The following code (ifconfig device ect.) also use hardcoded tap0. As I already mentionend some weeks ago, it would be more robust to ask for tap0 while the linux systemcall.

For solving the problem with multiple minimal-net instances, the tapdev6 have to more flexible in the name of the tapdevice. Of course a short hack is to rename the hardcoded device names for every instance.

kind regards

PS: this is the fix for the system call

diff --git a/cpu/native/net/tapdev6.c b/cpu/native/net/tapdev6.c
index 6334bbe..4fc34c2 100644
--- a/cpu/native/net/tapdev6.c
+++ b/cpu/native/net/tapdev6.c
@@ -132,6 +132,7 @@ tapdev_init(void)
   {
     struct ifreq ifr;
     memset(&ifr, 0, sizeof(ifr));
+    strncpy(ifr.ifr_name,"tap0", sizeof(ifr.ifr_name) - 1);
     ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
     if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
       perror(buf);
------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________ Contiki-developers mailing list Contiki-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/contiki-developers

Melisa Junuzovic

unread,
Aug 25, 2011, 4:30:36 PM8/25/11
to contiki-d...@lists.sourceforge.net
Hm I don't have this file in cpu because I do not using git repository but svn :(
this is my tap
tapdev_init();
#if !UIP_CONF_IPV6
  tcpip_set_outputfunc(tapdev_output);
#else
  tcpip_set_outputfunc(tapdev_send);
#endif
  process_poll(&tapdev_process);

  PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT);

  tapdev_exit();

  PROCESS_END();
}

do you know what should I do? Please help :S


Date: Thu, 25 Aug 2011 22:22:15 +0200
From: hadri...@googlemail.com
To: contiki-d...@lists.sourceforge.net

Benjamin Beichler

unread,
Aug 25, 2011, 4:38:32 PM8/25/11
to Contiki developer mailing list
Sorry, my mistake...

The file is in /cpu/native/net/tapdev6.c

By the way: The problem also exist in /cpu/native/net/tapdev.c, because the code is nearly the same ;-)


Am 25.08.2011 22:30, schrieb Melisa Junuzovic:
Hm I don't have this file in cpu because I do not using git repository but svn :(
this is my tap
tapdev_init();
#if !UIP_CONF_IPV6
� tcpip_set_outputfunc(tapdev_output);
#else
� tcpip_set_outputfunc(tapdev_send);
#endif
� process_poll(&tapdev_process);

� PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT);

� tapdev_exit();

� PROCESS_END();

}

do you know what should I do? Please help :S


Date: Thu, 25 Aug 2011 22:22:15 +0200
From: hadri...@googlemail.com
To: contiki-d...@lists.sourceforge.net
Subject: Re: [Contiki-developers] CoAP development road-map?

Hi,

i think this is a problem in /cpu/native/tapdev6.c

In the init code the tap0 device is hardcoded. But if you use linux and tap0 is already used, you got another tap device. The following code (ifconfig device ect.) also use hardcoded tap0. As I already mentionend some weeks ago, it would be more robust to ask for tap0 while the linux systemcall.

For solving the problem with multiple minimal-net instances, the tapdev6 have to more flexible in the name of the tapdevice. Of course a short hack is to rename the hardcoded device names for every instance.

kind regards

PS: this is the fix for the system call

diff --git a/cpu/native/net/tapdev6.c b/cpu/native/net/tapdev6.c
index 6334bbe..4fc34c2 100644
--- a/cpu/native/net/tapdev6.c
+++ b/cpu/native/net/tapdev6.c
@@ -132,6 +132,7 @@ tapdev_init(void)
�� {
���� struct ifreq ifr;
���� memset(&ifr, 0, sizeof(ifr));
+��� strncpy(ifr.ifr_name,"tap0", sizeof(ifr.ifr_name) - 1);
���� ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
���� if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
������ perror(buf);



Am 25.08.2011 18:50, schrieb Kovatsch Matthias:

I now have a similar problem testing minimal-net client/server under Linux.

The examples work on motes and in Cooja, but not for minimal-net. The problem is that the two minimal-net instances cannot reach each other. If I try ping6, only the instance started first is reachable.

�

I set the correct address for tap0, when adding routes I get error messages:

user@instant-contiki:~$ sudo ip -6 route add fdfd::/64 via fdfd::1

RTNETLINK answers: Invalid argument

user@instant-contiki:~$ sudo route -A inet6 add fdfd::/64 gw fdfd::1

SIOCADDRT: Invalid argument

�

Link-local addresses do not work, either.

�

Is there something special to do, so that all instances are actually on the same tap0 device?

Had anyone multiple instances of minimal-net nodes communicating with each other before?

�

Bye

Matthias

�

�

From: Kovatsch Matthias [mailto:kova...@inf.ethz.ch]
Sent: Montag, 15. August 2011 05:48
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

�

The client example is just there to give an idea how to implement a client and is thought for Cooja. To have an �interactive client�, it is based on the sky platform and uses a button and an LED server-sided.

The printf is buggy for the timed request, which gets the /toggle resource every 10 seconds.

The printf is actually for the button-event request, which cycles between different resources.

Have a look at the code and use the API calls from coap-0x.h to implement a useful minimal-net client.

I will add another example that uses blocking requests (in terms of control flow) that also support transparent blockwise transfers at the client side.

�

Best regards

Matthias

�

�

From: cyril auburtin [mailto:cyril.a...@inria.fr]
Sent: Thursday, August 11, 2011 12:22 PM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

�

coap-client is not working with minimal-net (https://github.com/mkovatsc/SmartAppContiki/tree/coap-07/examples/rest-example branch coap-07)
maybe due to recent changes

$ sudo ./coap-client-example.minimal-net
ifconfig tap0 up
IPV6 Addresss: [aaaa::ff:fe00:5]
IPV6 Addresss: [fe80::ff:fe00:5]
Sending to /.well-known/core

� GETting URL...
Sending to /.well-known/core
� GETting URL...
Sending to /.well-known/core
� GETting URL...



with a rest-server with :10 running, (and joinable with copper)

Hello

again with minimal-net, your corrections for rest-server made it work, with copper client

I have tried using coap-client-example.c, with

#define SERVER_NODE(ipaddr)�� uip_ip6addr(ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 0x0010) /* minimal-net */

coap-client is built with #define HARD_CODED_ADDRESS����� "aaaa::5"
and rest-server with #define HARD_CODED_ADDRESS����� "aaaa::10"



I activate radvd forwarding, copper is still able to communicate with rest-server but coap-client says continuously:
ifconfig tap0 up
IPV6 Addresss: [aaaa::ff:fe00:5]
IPV6 Addresss: [fe80::ff:fe00:5]
Sending to /.well-known/core

� GETting URL...
Sending to /.well-known/core
� GETting URL...
Sending to /.well-known/core
� GETting URL...
Sending to /.well-known/core
� GETting URL...
Sending to /.well-known/core
� GETting URL...
Sending to /.well-known/core


I have used post or put query method, on uri: coap://[aaaa::212:7402:2:202]:5683/leds?color=blue with payload 'mode=on'
but would it work with multiple variables in the uri, and if yes how to do it

thx


thanks it's working well

how is the leds ressource request supposed to be formed?


Okay, there is a bug that only shows on minimal-net.

It works exactly once, then the automatic chunking into blocks messes up the byte offset.

I�ll fix that soon.

�

Thanks for triggering the good old minimal-net test! :)

�

�

From: cyril auburtin [mailto:cyril.a...@inria.fr]
Sent: Mittwoch, 3. August 2011 18:39
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

�

I am in coap-06 branch and copper 06

�still minimal-net, with your precedent fix

and coap://[aaaa::206:98ff:fe00:232]:5683/.well-known/core� GET:

=sending CoAP message===
�Type: Confirmable
�Code: GET
�Transaction ID: 28874
�Options:
� Uri: /.well-known/core [1 option]
�Payload:

�=======================
-sent UDP datagram------
�Length: 21
�-----------------------
-receiving UDP datagram-
�Length: 25
�-----------------------
=received CoAP message==
�Type: Acknowledgment
�Code: 4.02 Bad Option
�Transaction ID: 28874
�Options:
� Block2: 0 (128 B/block) [1 byte(s)]
�Payload:
Block out of scope
�=======================
INFO: discoverHandler()



hello is working

but discover doesn't work
I have this alert "ERROR: Main.discoverHandler [Content-Type is null, not 'application/link-format']"

Okay, just to be sure:

The master of SmartAppContiki is quite outdated, as I am working in branch coap-07.

If you use the coap-07 branch, the CoAP implementation is different from the official Contiki repository! The port, for instance, is now 5683 by default.

�

Your mail just came in ;)

�

As the name tells, coap-07 implements the current draft 07. The official one only provides a subset of draft 03.

�

�

From: cyril auburtin [mailto:cyril.a...@inria.fr]
Sent: Mittwoch, 3. August 2011 18:12
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] CoAP development road-map?

�

thanks I will try minimal-net with a rest-server and a coap-client with different ipv6, and debug

yes I tried copper with [aaaa::206:98ff:fe00:232]:61616


Hi Cyril,

minimal-net will take a hard coded address in either the
/platform/contiki-conf.h file or /platform/contiki-main.c
Read the comments there, basically

#define HARD_CODED_ADDRESS � � �"fdfd::10" //assign prefix and ipv6 address

�


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

�


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

�


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

�


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

�


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

�

------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________ Contiki-developers mailing list Contiki-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/contiki-developers


------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________ Contiki-developers mailing list Contiki-d...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/contiki-developers

M Pouillot

unread,
Jan 4, 2012, 5:03:35 AM1/4/12
to Contiki developer mailing list

Bonjour Cyril,

 

As-tu trouvé un moyen d'utiliser CoAP sur la TARGET minimal-net? As-tu un tuto le décrivant?

 

Merci d'avance.

 

cordialement,

 

Mathieu

 

De : cyril auburtin [mailto:cyril.a...@inria.fr]
Envoyé : mercredi 3 août 2011 17:48
À : Contiki developer mailing list
Objet : Re: [Contiki-developers] CoAP development road-map?

Reply all
Reply to author
Forward
0 new messages