-
Notifications
You must be signed in to change notification settings - Fork 68
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
Using 'demo' with *only* a bootstrap server #17
Comments
Unfortunately, I haven't been able to reproduce your problem locally - your configuration works fine when pasted into the demo client and ran normally on Linux. Even the logs look the same as what you pasted - but the client connects. There might be some problem with your integration code with the embedded platform, or with some modifications you might have done in seemingly unrelated parts of the code. I'd advise you to try running the demo client with such configuration on a proper OS (e.g. Linux), and compare the execution between that and your embedded version using a debugger. If you find some place in our code to be the cause of the problems, we'll be happy to fix it. Also you may want to note that embedded platforms sometimes fail to keep the necessary invariants. We had an experience working with a build of ThreadX that did not align thread stacks to 8-byte boundaries, which in turn caused some standard library functions to behave erratically. You may want to double-check that nothing of the sort is happening in your code. |
Thanks for the feedback and suggestions. I have it built and running on Linux now, so I can hopefully start trying to trace the problem. It may be the way I have implemented my 'client thread'. The area where the log from my platform begins to differ is when it reports: My cmake options have to be different; at the moment I am using Do any of these jump out as a possible cause? |
Ok, I think I see the problem. |
Thank you for your investigation! Frankly speaking, we did not check what happens when precision of either of the clocks is as low as a second. We will look into it and investigate how can it be improved.
Also you definitely want to make sure that such "hacked" not-really-realtime clock is not used by the DTLS library, because otherwise you won't be able to properly check certificate validity. |
Thanks. Cert validity was certainly a possible problem area that I had thought of. |
Anjay will be OK in this case. AFAIK absolute times are never passed from Anjay to the DTLS library. |
I have found a problem with using 'time since reset' - avs_time_real_now is used to seed the PRNG. This means that if I run and then reset/re-run, the same Token and Message ID are used in the CoAP message and are ignored by the server for being a 'duplicate'. |
Since Anjay 2.3, cryptographically-safe PRNG from the TLS library, with an option to specify user-provided entropy source, is used. I hope that this solves this issue, especialy now that it has not been updated for over a year. Please open another one if you still have questions. |
I am working on an embedded system (STM32F7 + ThreadX + lwIP + mbedTLS) into which I am integrating Anjay.
I've adapted the 'demo' to become my LWM2M client thread. Because it is an embedded system, I don't use demo_args.c but instead I am just hard-coding values into DEFAULT_CMDLINE_ARGS.
I am using Leshan servers (192.168.10.86), just for simple connection testing. I can set .servers[0] with URI for my server, and it connects and communicates correctly.
Now I want to try bootstrap server functionality (again, using the Leshan bootstrap server).
What I have found is that if I configure with a 'fictional' server then Anjay tries it, fails, and falls back to the bootstrap server. It can then get the real server info from the bootstrap, and can connect as before.
BUT I can't configure DEFAULT_CMDLINE_ARGS with only the bootstrap server.
In other words this succeeds [using info given by bootstrap server]:
But this - servers[0] only - doesn't:
The rest of the config is
I'm puzzled why it can't be given just a bootstrap server, and work from there?
Watching in Wireshark, I see nothing being sent to the bootstrap server; and the client logs only report:
With the fictional server included:
The text was updated successfully, but these errors were encountered: