AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
188 stars 68 forks source link

Anjay + Coiote fails SET requests for Bootstrap-Awareness #37

Closed ThinkpadX200 closed 4 years ago

ThinkpadX200 commented 4 years ago

I'm seeing an issue using the bootstrap-awareness example in Anjay where a Coiote specified bootstrap server is unable to SET parameters on a registered device. Attached are logs from the bootstrap server.

The client says "received packet is not a valid CoAP message" in addition to "Bootstrap Server misused Security Object". The client will then time out of the Bootstrap Finish. Logs on the bootstrap server seem to show a proper BootstrapWrite command being sent to the client, but the client returns a "4.00 BadRequest". The server logs are attached.

I was seeing issues with other examples, getting 4.03 CoAP errors. I would assume this has something to do with an underlying CoAP mishap, but I figured I'd post here. If it matters, I'm using the master branch of Anjay compiled onto an Arm architecture.

kFYatek commented 4 years ago

Thank you for reporting the issue. Unfortunately, I'm not quite sure what might be the root cause. It would be very helpful if you could provide:

ThinkpadX200 commented 4 years ago

The client examples in Anjay seem to not have knowledge of "avs_log_set_default_level()". A grep for that function in the Anjay top level directory returns nothing. Is there a header file I'm missing, or perhaps a client that has that capability already?

Edit: After grepping around, I discovered that the logging function exists in log.h, which I will include and build with. I will update once the trace logs are coming through.

krwc commented 4 years ago

Please note that the examples are designed to illustrate certain points, and should be treated as an addition to Tutorials. They are by no means complete LwM2M clients. A more complete example is the demo.

Unfortunately, the log you've sent is not exactly what we asked for. We'd like to see the logs from the client side (not server side) + PCAP dumps to have a full picture of the underlying communication.

ThinkpadX200 commented 4 years ago

bootstrap.log

I understand that they are not complete clients. Here are the client side logs.

I am getting a specific error that the "Bootstrap Server misused Security Object" and I'm wondering why this error might occur? Unfortunately I would like to avoid using the tcpdump.pcap logs if possible, as this exposes a great deal of information surrounding my servers. I understand however if that is a prerequisite to understanding the issue.

krwc commented 4 years ago

I am getting a specific error that the "Bootstrap Server misused Security Object" and I'm wondering why this error might occur?

It seems that the Bootstrap Server created two Bootstrap Security Instances (i.e. two Security Instances which have the Bootstrap-Server resource (/0/*/1) set to true), which in LwM2M is illegal. I may only guess that the intention was to create an instance of a Management Server instead, and that there's some mistake in the task executed on the server.