From 72890cc8189244646f175b0984402f5ceab8b81f Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 7 Apr 2018 09:21:54 -0700 Subject: [PATCH 1/4] Rename example ipso-objects to lwm2m-ipso-objects --- examples/{ipso-objects => lwm2m-ipso-objects}/Makefile | 0 examples/{ipso-objects => lwm2m-ipso-objects}/README.md | 0 .../example-ipso-objects.c | 0 .../example-ipso-temperature.c | 0 .../{ipso-objects => lwm2m-ipso-objects}/example-server.c | 0 .../{ipso-objects => lwm2m-ipso-objects}/project-conf.h | 0 .../{ipso-objects => lwm2m-ipso-objects}/serial-protocol.c | 0 .../{ipso-objects => lwm2m-ipso-objects}/serial-protocol.h | 0 tests/01-compile-base/Makefile | 4 ++-- tests/02-compile-arm-ports-01/Makefile | 2 +- tests/03-compile-arm-ports-02/Makefile | 4 ++-- tests/18-coap-lwm2m/06-lwm2m-ipso-test.sh | 6 +++--- 12 files changed, 8 insertions(+), 8 deletions(-) rename examples/{ipso-objects => lwm2m-ipso-objects}/Makefile (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/README.md (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/example-ipso-objects.c (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/example-ipso-temperature.c (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/example-server.c (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/project-conf.h (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/serial-protocol.c (100%) rename examples/{ipso-objects => lwm2m-ipso-objects}/serial-protocol.h (100%) diff --git a/examples/ipso-objects/Makefile b/examples/lwm2m-ipso-objects/Makefile similarity index 100% rename from examples/ipso-objects/Makefile rename to examples/lwm2m-ipso-objects/Makefile diff --git a/examples/ipso-objects/README.md b/examples/lwm2m-ipso-objects/README.md similarity index 100% rename from examples/ipso-objects/README.md rename to examples/lwm2m-ipso-objects/README.md diff --git a/examples/ipso-objects/example-ipso-objects.c b/examples/lwm2m-ipso-objects/example-ipso-objects.c similarity index 100% rename from examples/ipso-objects/example-ipso-objects.c rename to examples/lwm2m-ipso-objects/example-ipso-objects.c diff --git a/examples/ipso-objects/example-ipso-temperature.c b/examples/lwm2m-ipso-objects/example-ipso-temperature.c similarity index 100% rename from examples/ipso-objects/example-ipso-temperature.c rename to examples/lwm2m-ipso-objects/example-ipso-temperature.c diff --git a/examples/ipso-objects/example-server.c b/examples/lwm2m-ipso-objects/example-server.c similarity index 100% rename from examples/ipso-objects/example-server.c rename to examples/lwm2m-ipso-objects/example-server.c diff --git a/examples/ipso-objects/project-conf.h b/examples/lwm2m-ipso-objects/project-conf.h similarity index 100% rename from examples/ipso-objects/project-conf.h rename to examples/lwm2m-ipso-objects/project-conf.h diff --git a/examples/ipso-objects/serial-protocol.c b/examples/lwm2m-ipso-objects/serial-protocol.c similarity index 100% rename from examples/ipso-objects/serial-protocol.c rename to examples/lwm2m-ipso-objects/serial-protocol.c diff --git a/examples/ipso-objects/serial-protocol.h b/examples/lwm2m-ipso-objects/serial-protocol.h similarity index 100% rename from examples/ipso-objects/serial-protocol.h rename to examples/lwm2m-ipso-objects/serial-protocol.h diff --git a/tests/01-compile-base/Makefile b/tests/01-compile-base/Makefile index 0c7e248e0..cb20757c7 100644 --- a/tests/01-compile-base/Makefile +++ b/tests/01-compile-base/Makefile @@ -14,8 +14,8 @@ libs/energest/sky \ libs/data-structures/native \ libs/data-structures/sky \ libs/stack-check/sky \ -ipso-objects/native \ -ipso-objects/native:MAKE_WITH_DTLS=1 \ +lwm2m-ipso-objects/native \ +lwm2m-ipso-objects/native:MAKE_WITH_DTLS=1 \ rpl-udp/sky \ rpl-border-router/native \ rpl-border-router/sky \ diff --git a/tests/02-compile-arm-ports-01/Makefile b/tests/02-compile-arm-ports-01/Makefile index 51b232173..1ecf59fe4 100644 --- a/tests/02-compile-arm-ports-01/Makefile +++ b/tests/02-compile-arm-ports-01/Makefile @@ -40,7 +40,7 @@ sensniff/cc2538dk \ rpl-udp/cc2538dk \ coap/cc2538dk \ slip-radio/cc2538dk \ -ipso-objects/cc2538dk \ +lwm2m-ipso-objects/cc2538dk \ multicast/cc2538dk \ dev/gpio-hal/cc2538dk \ dev/leds/cc2538dk \ diff --git a/tests/03-compile-arm-ports-02/Makefile b/tests/03-compile-arm-ports-02/Makefile index a69ec44a0..18b052f14 100644 --- a/tests/03-compile-arm-ports-02/Makefile +++ b/tests/03-compile-arm-ports-02/Makefile @@ -14,8 +14,8 @@ platform-specific/zoul/rtcc/zoul \ platform-specific/zoul/zoul \ coap/zoul \ multicast/zoul \ -ipso-objects/zoul \ -ipso-objects/zoul:MAKE_WITH_DTLS=1 \ +lwm2m-ipso-objects/zoul \ +lwm2m-ipso-objects/zoul:MAKE_WITH_DTLS=1 \ hello-world/zoul \ sensniff/zoul \ sensniff/zoul:ZOUL_CONF_SUB_GHZ_SNIFFER=1 \ diff --git a/tests/18-coap-lwm2m/06-lwm2m-ipso-test.sh b/tests/18-coap-lwm2m/06-lwm2m-ipso-test.sh index 7684044a8..9aacc2976 100755 --- a/tests/18-coap-lwm2m/06-lwm2m-ipso-test.sh +++ b/tests/18-coap-lwm2m/06-lwm2m-ipso-test.sh @@ -9,9 +9,9 @@ IPADDR=fd00::302:304:506:708 # Starting Contiki-NG native node echo "Starting native node - lwm2m/ipso objects" -make -C $CONTIKI/examples/ipso-objects clean >/dev/null -make -C $CONTIKI/examples/ipso-objects > make.log 2> make.err -sudo $CONTIKI/examples/ipso-objects/example-ipso-objects.native > node.log 2> node.err & +make -C $CONTIKI/examples/lwm2m-ipso-objects clean >/dev/null +make -C $CONTIKI/examples/lwm2m-ipso-objects > make.log 2> make.err +sudo $CONTIKI/examples/lwm2m-ipso-objects/example-ipso-objects.native > node.log 2> node.err & CPID=$! sleep 10 From 8b95d2258921f80bfab1c7d4b21fcfd783bf400b Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 7 Apr 2018 09:26:41 -0700 Subject: [PATCH 2/4] Update lwm2m-ipso-example Readme --- examples/lwm2m-ipso-objects/README.md | 52 ++++----------------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/examples/lwm2m-ipso-objects/README.md b/examples/lwm2m-ipso-objects/README.md index e9be82dcb..30cc5832f 100644 --- a/examples/lwm2m-ipso-objects/README.md +++ b/examples/lwm2m-ipso-objects/README.md @@ -1,48 +1,10 @@ -IPSO Objects Example +LWM2M with IPSO Objects Example ============================================ -This is an example of how to make use of the IPSO Object and LWM2M -implementation in Contiki. - -The LWM2M implementation is based on the Erbium CoAP implementation -and consists of two apps: lwm2m-engine and ipso-objects. The -lwm2m-engine handle the specifics of LWM2M including bootstrapping and -how read/writes of objects and resources are handled. The ipso-objects -contains implementations of some of the IPSO Smart Objects. - -The implementation was used during the IPSO Interop in May 2015, -Kista, Sweden, and was successfully tested with other -implementations. - -The examples use some of the basic IPSO object for controlling LEDs on -Contiki devices and for reading out temperature. - -##Testing IPSO-objects with Leshan - -First program a device with the examples/ipso-objects/example-ipso-objects.c - -```bash ->make example-ipso-objects.upload TARGET=zoul ->... -``` - -After that start up a native-border router or other border router on fd00::1/64 -or another prefix - NOTE: if you use another prefix you will need to change LWM2M_SERVER_ADDRESS for which the device will register - in project-conf.h: -``` -#define LWM2M_SERVER_ADDRESS "fd00::1" -``` - -Then when everything is setup you can download a Leshan and use that to -test controlling LEDs of the device. - -###Starting Leshan -```bash -wget https://hudson.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/leshan-standalone.jar -java -jar ./leshan-standalone.jar -``` -Browse to leshans device page with http://127.0.0.1:8080 . - -When you have started the border-router and also Leshan you should now -start (or reboot) your IPSO Object enabled device. Within 30 seconds -you should be able to see it on the Leshan device page. +This is an OMA LWM2M example implementing IPSO Objects. +It can connect to a Leshan server out-of-the-box. +Important configuration paramters: +* `LWM2M_SERVER_ADDRESS`: the address of the server to register to (or bosstrap from) +* `REGISTER_WITH_LWM2M_BOOTSTRAP_SERVER`: set to bootstrap via `LWM2M_SERVER_ADDRESS` and then obtain the registration server address +A tutorial for setting up this example is provided on the wiki. From f5ae6b641e43dad61cff9e4e049790bb5e4c8827 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 7 Apr 2018 10:48:52 -0700 Subject: [PATCH 3/4] Move ipv6-hooks examples to libs directory --- examples/{ => libs}/ipv6-hooks/Makefile | 2 +- examples/{ => libs}/ipv6-hooks/README.md | 0 examples/{ => libs}/ipv6-hooks/ipv6-hooks.c | 0 tests/01-compile-base/Makefile | 2 +- tests/03-compile-arm-ports-02/Makefile | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename examples/{ => libs}/ipv6-hooks/Makefile (84%) rename examples/{ => libs}/ipv6-hooks/README.md (100%) rename examples/{ => libs}/ipv6-hooks/ipv6-hooks.c (100%) diff --git a/examples/ipv6-hooks/Makefile b/examples/libs/ipv6-hooks/Makefile similarity index 84% rename from examples/ipv6-hooks/Makefile rename to examples/libs/ipv6-hooks/Makefile index be8cc953e..63085face 100644 --- a/examples/ipv6-hooks/Makefile +++ b/examples/libs/ipv6-hooks/Makefile @@ -1,5 +1,5 @@ CONTIKI_PROJECT = ipv6-hooks all: $(CONTIKI_PROJECT) -CONTIKI=../.. +CONTIKI=../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6-hooks/README.md b/examples/libs/ipv6-hooks/README.md similarity index 100% rename from examples/ipv6-hooks/README.md rename to examples/libs/ipv6-hooks/README.md diff --git a/examples/ipv6-hooks/ipv6-hooks.c b/examples/libs/ipv6-hooks/ipv6-hooks.c similarity index 100% rename from examples/ipv6-hooks/ipv6-hooks.c rename to examples/libs/ipv6-hooks/ipv6-hooks.c diff --git a/tests/01-compile-base/Makefile b/tests/01-compile-base/Makefile index cb20757c7..76722e7f2 100644 --- a/tests/01-compile-base/Makefile +++ b/tests/01-compile-base/Makefile @@ -20,7 +20,7 @@ rpl-udp/sky \ rpl-border-router/native \ rpl-border-router/sky \ slip-radio/sky \ -ipv6-hooks/sky \ +libs/ipv6-hooks/sky \ nullnet/native \ TOOLS= diff --git a/tests/03-compile-arm-ports-02/Makefile b/tests/03-compile-arm-ports-02/Makefile index 18b052f14..8cc99d914 100644 --- a/tests/03-compile-arm-ports-02/Makefile +++ b/tests/03-compile-arm-ports-02/Makefile @@ -59,7 +59,7 @@ rpl-udp/openmote-cc2538 \ dev/gpio-hal/openmote-cc2538 \ dev/leds/openmote-cc2538 \ rpl-border-router/openmote-cc2538 \ -ipv6-hooks/openmote-cc2538 \ +libs/ipv6-hooks/openmote-cc2538 \ TOOLS= From 9454191b84ffdf292fec23daa3fd6344a6d0ba10 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 7 Apr 2018 10:49:59 -0700 Subject: [PATCH 4/4] Renamd http-socket example to websocket --- examples/{http-socket => websocket}/Makefile | 0 examples/{http-socket => websocket}/http-example.c | 0 examples/{http-socket => websocket}/project-conf.h | 0 examples/{http-socket => websocket}/websocket-example.c | 0 examples/{http-socket => websocket}/websocket-node/Makefile | 0 .../{http-socket => websocket}/websocket-node/example-server.js | 0 tests/03-compile-arm-ports-02/Makefile | 2 +- 7 files changed, 1 insertion(+), 1 deletion(-) rename examples/{http-socket => websocket}/Makefile (100%) rename examples/{http-socket => websocket}/http-example.c (100%) rename examples/{http-socket => websocket}/project-conf.h (100%) rename examples/{http-socket => websocket}/websocket-example.c (100%) rename examples/{http-socket => websocket}/websocket-node/Makefile (100%) rename examples/{http-socket => websocket}/websocket-node/example-server.js (100%) diff --git a/examples/http-socket/Makefile b/examples/websocket/Makefile similarity index 100% rename from examples/http-socket/Makefile rename to examples/websocket/Makefile diff --git a/examples/http-socket/http-example.c b/examples/websocket/http-example.c similarity index 100% rename from examples/http-socket/http-example.c rename to examples/websocket/http-example.c diff --git a/examples/http-socket/project-conf.h b/examples/websocket/project-conf.h similarity index 100% rename from examples/http-socket/project-conf.h rename to examples/websocket/project-conf.h diff --git a/examples/http-socket/websocket-example.c b/examples/websocket/websocket-example.c similarity index 100% rename from examples/http-socket/websocket-example.c rename to examples/websocket/websocket-example.c diff --git a/examples/http-socket/websocket-node/Makefile b/examples/websocket/websocket-node/Makefile similarity index 100% rename from examples/http-socket/websocket-node/Makefile rename to examples/websocket/websocket-node/Makefile diff --git a/examples/http-socket/websocket-node/example-server.js b/examples/websocket/websocket-node/example-server.js similarity index 100% rename from examples/http-socket/websocket-node/example-server.js rename to examples/websocket/websocket-node/example-server.js diff --git a/tests/03-compile-arm-ports-02/Makefile b/tests/03-compile-arm-ports-02/Makefile index 8cc99d914..a4e1947e8 100644 --- a/tests/03-compile-arm-ports-02/Makefile +++ b/tests/03-compile-arm-ports-02/Makefile @@ -28,7 +28,7 @@ libs/logging/zoul \ 6tisch/etsi-plugtest-2017/zoul:BOARD=remote \ 6tisch/6p-packet/zoul \ 6tisch/sixtop/zoul \ -http-socket/zoul \ +websocket/zoul \ libs/timers/zoul \ libs/energest/zoul \ libs/trickle-library/zoul \