[riot-notifications] [RIOT-OS/RIOT] pkg/wakaama: Add basic LWM2M client implementation (#11036)

Ken Bannister notifications at github.com
Mon Mar 4 05:36:39 CET 2019


kb2ma commented on this pull request.

@leandrolanzieri, it will be great to have an LwM2M client example! I have started by testing against only a registration server, with no bootstrap server. I was able to run the client and server, manipulate the LEDs, and interact with the Leshan demo server. See the inline comments and question below on issues that arose.

How did you set up the tap interface on native? I usually assign a ULA on the tap interface, like fd00:dead:beef::1. I then add the native instance to that network, at fd00:dead:beef::2, via RIOT's ifconfig command. The Leshan server was able to receive CoAP messages in this case. However, to send a message to read a value, the Leshan server used a different local address on the same network, like fd00:dead:beef::919f:e3c:0:2721, which the RIOT native instance did not respond to. I found that I had to set the local address of the server via the --coaphost option, like '--coaphost [fd00:dead:beef::1]' to get this to work.

> +To run the demo server:
+```shell
+wget https://hudson.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/leshan-server-demo.jar
+
+java -jar ./leshan-server-demo.jar
+```
+It will output the addresses where it is listening:
+```
+INFO LeshanServer - LWM2M server started at coap://0.0.0.0/0.0.0.0:5683 coaps://0.0.0.0/0.0.0.0:5684
+INFO LeshanServerDemo - Web server started at http://0.0.0.0:8080/.
+```
+
+#### Bootstrap server
+LWM2M provides a bootstrapping mechanism to provide the clients with information
+to register to one or more servers. To test this mechanism both the previous server and a bootstrap server should be running. Eclipse Leshan also provides a bootstrap server demo.
+

Might be worthwhile to mention here that the bootstrap server is off by default. I had to check the value of LWM2M_SERVER_IS_BOOTSTRAP in lwm2m.h to be sure.

> +
+To set up the configuration of the node and the server:
+1. Click the `Add new client bootstrap configuration` button.
+2. Fill in the name of the device, it **should** match the one set in
+   `sys/net/lwm2m.h` as `LWM2M_DEVICE_NAME`.
+3. Using the `LWM2M Server` tab enter the address where the LWM2M server is
+   listening. For now only `No security` mode can be used.
+
+### Running the client
+The address set in `sys/net/lwm2m.h` as `LWM2M_SERVER_URI` should be reachable
+from the node, e.g. either running on native with a tap interface or as a mote
+connected to a
+[border router](https://github.com/RIOT-OS/RIOT/tree/master/examples/gnrc_border_router).
+Also, if a bootstrap server is being used the option `LWM2M_SERVER_IS_BOOTSTRAP`
+should be set to 1.
+

Might want to mention use of the environment variable SERVER_URI to work with a different server address. For example, I used `SERVER_URI=\\\"coap://[fd00:bbbb::1]\\\"` when compiling.

> +2. Fill in the name of the device, it **should** match the one set in
+   `sys/net/lwm2m.h` as `LWM2M_DEVICE_NAME`.
+3. Using the `LWM2M Server` tab enter the address where the LWM2M server is
+   listening. For now only `No security` mode can be used.
+
+### Running the client
+The address set in `sys/net/lwm2m.h` as `LWM2M_SERVER_URI` should be reachable
+from the node, e.g. either running on native with a tap interface or as a mote
+connected to a
+[border router](https://github.com/RIOT-OS/RIOT/tree/master/examples/gnrc_border_router).
+Also, if a bootstrap server is being used the option `LWM2M_SERVER_IS_BOOTSTRAP`
+should be set to 1.
+
+#### Compile and run
+To compile run:
+

Might want to mention some switches for debugging, like ENABLE_DEBUG in lwm2m_client.c and addition of LWM2M_WITH_LOGS to CFLAGS to see Wakaama's internal logging.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11036#pullrequestreview-209968414
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190303/d7b1ce86/attachment.html>


More information about the notifications mailing list