Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ThinkpadX200 opened this issue Nov 20, 2019 · 5 comments
Closed

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

ThinkpadX200 opened this issue Nov 20, 2019 · 5 comments

Comments

@ThinkpadX200
Copy link

ThinkpadX200 commented Nov 20, 2019

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
Copy link
Contributor

kFYatek commented Nov 21, 2019

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:

  • PCAP of the communication with server, captured using e.g. tcpdump
  • Full client-side logs, preferably on the TRACE level
    • to set log level, please add a avs_log_set_default_level(AVS_LOG_TRACE); call before initializing Anjay
    • for the TRACE-level logs to work, you will also need to enable AVS_LOG_WITH_TRACE Anjay's CMake configuration option, i.e. add -DAVS_LOG_WITH_TRACE=ON to CMake command line

@ThinkpadX200
Copy link
Author

ThinkpadX200 commented Nov 21, 2019

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
Copy link
Contributor

krwc commented Nov 22, 2019

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
Copy link
Author

ThinkpadX200 commented Nov 22, 2019

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
Copy link
Contributor

krwc commented Nov 26, 2019

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.

@krwc krwc closed this as completed Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants