pkg/wakaama: add DTLS support#16233
Conversation
c150779 to
5c0e1b7
Compare
|
Rebased, now that #16179 is merged |
|
Successfully tested this using the Below is a screenshot of the LwM2M server dashboard showing the device and DTLS connection info. Additionally the console output for the lwm2m client: |
5c0e1b7 to
5e4b2f1
Compare
There was a problem hiding this comment.
Just going though a runthrough and noticed some things:
diff --git a/examples/lwm2m/README.md b/examples/lwm2m/README.md
index dc13c58c46..7849691962 100644
--- a/examples/lwm2m/README.md
+++ b/examples/lwm2m/README.md
@@ -41,7 +41,7 @@ Router, you might want to specify:
java -jar ./leshan-server-demo.jar -lh fd00:dead:beef::1
ESCAPE BACKTICK```
-In the security section click 'Add new client security configuration', select the security mode
+In the security section click 'Add Security Information', select the security mode
'Pre-Shared Key', and enter the Client endpoint name and the security information
(Identity and Key).
@@ -73,8 +73,8 @@ BS_COAPSPORT=5686
BS_WEBPORT=8888
# run the server
-java -jar ./leshan-bsserver-demo.jar --coapport ${BS_COAPPORT} \
- --coapsport ${BS_COAPSPORT} --webport ${BS_WEBPORT}
+java -jar ./leshan-bsserver-demo.jar --coap-port ${BS_COAPPORT} \
+ --coaps-port ${BS_COAPSPORT} --web-port ${BS_WEBPORT}
ESCAPE BACKTICK```
To set up the configuration of the node and the server:I don't know how much knowledge we ca assume of the target audience... but if it is very little I think I can help refine the documentation a bit more.
TODO: Figure out how to escape backticks :D
|
So far testing has not gone that well. Further investigation is needed before we can proceed. It is crashing on both the |
|
Some documentation additions I will just throw here as well: Running with securityIn the security section click 'Add Security Information', select the security mode Then Assuming The final field, the Bootstrap server (optional) |
|
Looks like something changed in the meantime, and the stack size of the event thread was not big enough now. I updated this in the example Makefile now. Tested with the feather-nrf52840-sense board. |
|
I just tested with a master rebase, aside from documentation updates I think this looks good, I would also like to try on the samr21-xpro maybe... |
|
oi oi oi, also some native64 fixes are needed I guess |
|
Let's see if the prints are fixed now |
|
Looks like I finally got it right |
Can you squash and just update the args? |
36e5b53 to
c4dd829
Compare
|
Done |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
ACK, tested the pre-squash and it worked. Looking at the code (quite a bit) looks OK too.
c4dd829 to
17a3125
Compare
|
Updated Makefile.ci |
|
Thanks for the review! Nice to see this merged 😃 |

Contribution description
This PR adds support for DTLS connections when using LwM2M. The LwM2M client implementation has been rewritten to allow both CoAP and CoAP over DTLS to be used at the same time. An own implementation of the Security Object is introduced, as it needs to handle the interaction with the Credential Manager (credman).
For now only Pre-Shared Key mode is supported.Pre-Shared Key and Raw Public Key modes are supported. DTLS is supported during the communication with LwM2M server and during bootstrapping.Update: Raw public key mode is added now as well.
The example application has been modified to use DTLS connections by default. Finally, documentation has been improved.
Testing procedure
The best way to test this is using the
example/wakaamaapplication. If you use Eclipse Leshan as your LwM2M Server implementation, you should see an indication that the connection is done over DTLS:The example can be modified to use plain CoAP connection to the server. That should also work as usual.
Issues/PRs references
Depends on #16179(merged)Depends on #16203(merged)Depends on #16709(merged)