AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
189 stars 70 forks source link

Facing issues in compiling and running anjay simulator #14

Closed yogapreethi closed 6 years ago

yogapreethi commented 6 years ago

Followed the read me file to run the simulator but could not install clang-tools Attaching log for the same. clang installation issue.txt

Also tried running demo simulator faced some errors. Attaching log for reference. demo run error log.txt

Kindly look into it.

dextero commented 6 years ago

What version of Ubuntu do you use? 16.04?

The clang-tools package is optional, and should only be required for static analysis testing.

The error is there because client attempts to connect to LwM2M server on the same machine the client is running on, and there seems to be no such server running. Please either start a local LwM2M server, or connect to an existing one, e.g. coap://leshan.eclipse.org:5683. Note that you may need to specify a custom --endpoint-name to avoid collisions with other clients.

yogapreethi commented 6 years ago

yes, using 16.04.

I tried with my server, but getting the same error.

And also could you give me the entire command to run like how to define lifetime, binding mode, registration update time etc...

krwc commented 6 years ago

Please take a look at the result of ./output/bin/demo --help, as well as at our detailed documentation.

yogapreethi commented 6 years ago

Hi, I tried with leshan server, getting same error. PFA logs for reference. Kindly help here. leshan server.txt

dextero commented 6 years ago

To use DTLS, you need to configure the PSK on the server as well (https://leshan.eclipse.org/#/security).

yogapreethi commented 6 years ago

Yes, I did.

dextero commented 6 years ago

Demo client uses --endpoint-name abc-test112233, but there is no PSK configured for endpoint "abc-test112233".

yogapreethi commented 6 years ago

endpoint is test112233, manufacturer is abc. Do I need to give it combine?

yogapreethi commented 6 years ago

I created PSK with endpoint "abc-test112233" again tried its not working.

yogapreethi commented 6 years ago

Hi Team, Could you please check 'Could not stringify socket address' error, getting same error again

root@att-sim-ubuntu:~/Anjay# ./output/bin/demo --server-uri coaps://leshan.eclipse.org:5684 --security-mode psk --identity 6162636465666768 --key 6162636465666768 --endpoint-name abc-test112233 --bootstrap 2018-09-10 04:56:07.049839 INFO [anjay] [/root/Anjay/src/anjay_core.c:160]: Initializing Anjay 1.11.0 2018-09-10 04:56:07.049907 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /2 2018-09-10 04:56:07.049934 WARNING [demo] [/root/Anjay/demo/firmware_update.c:582]: Invalid data in the firmware state persistence file 2018-09-10 04:56:07.049941 INFO [demo] [/root/Anjay/demo/firmware_update.c:612]: Initial firmware upgrade state result: 0 2018-09-10 04:56:07.049946 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /5 2018-09-10 04:56:07.049950 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /0 2018-09-10 04:56:07.049954 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /1 2018-09-10 04:56:07.049958 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /6 2018-09-10 04:56:07.049962 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /11 2018-09-10 04:56:07.049967 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /10 2018-09-10 04:56:07.049971 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /4 2018-09-10 04:56:07.049975 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /7 2018-09-10 04:56:07.049981 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /12361 2018-09-10 04:56:07.049988 DEBUG [demo] [/root/Anjay/demo/objects/device.c:416]: manufacturer: abc; serial number: test112233 2018-09-10 04:56:07.049991 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /3 2018-09-10 04:56:07.049996 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /11111 2018-09-10 04:56:07.050000 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /12360 2018-09-10 04:56:07.050004 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /12359 2018-09-10 04:56:07.050008 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /1337 2018-09-10 04:56:07.050012 INFO [anjay] [/root/Anjay/src/dm_core.c:127]: successfully registered object /16 2018-09-10 04:56:07.050018 DEBUG [security] [/root/Anjay/modules/security/src/security_utils.c:64]: Invalid SMS Security Mode 2018-09-10 04:56:07.050022 INFO [security] [/root/Anjay/modules/security/src/mod_security.c:162]: Added instance 1 (bootstrap, URI: coaps://leshan.eclipse.org:5684) 2018-09-10 04:56:07.050028 INFO [demo] [/root/Anjay/demo/demo.c:567]: ANJAY DEMO STARTUP FINISHED 2018-09-10 04:56:07.052262 INFO [anjay] [/root/Anjay/src/servers/reload.c:203]: servers reloaded 2018-09-10 04:56:07.053437 DEBUG [anjay] [/root/Anjay/src/servers/connection_udp.c:152]: server /0/1: UDP security mode = 0 2018-09-10 04:56:07.053457 ERROR [avs_net] [/root/Anjay/avs_commons/git/net/compat/posix/net_impl.c:935]: Could not stringify socket address 2018-09-10 04:56:07.163203 WARNING [avs_net] [/root/Anjay/avs_commons/git/net/src/mbedtls/mbedtls.c:561]: Could not restore session; performing full handshake leshan key

yogapreethi commented 6 years ago

Hi Team,

Could you please re-open this issue, since the issue is still there.

Thanks, Yogapreethi From: Marcin Radomski notifications@github.com Sent: Friday, September 07, 2018 4:58 PM To: AVSystem/Anjay Anjay@noreply.github.com Cc: Sivakumar, Yogapreethi (EXT - IN/Chennai) yogapreethi.sivakumar.ext@nokia.com; Author author@noreply.github.com Subject: Re: [AVSystem/Anjay] Facing issues in compiling and running anjay simulator (#14)

Demo client uses --endpoint-name abc-test112233, but there is no PSK configured for endpoint "abc-test112233".

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AVSystem/Anjay/issues/14#issuecomment-419410994, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ApEavb0kYLArBGvDSa69gNznT5YlplA9ks5uYlhDgaJpZM4WeiEg.

krwc commented 6 years ago

The Could not stringify socket address is not that serious as the log level seems to suggest. I agree that it is unnecessairly confusing, and we intend to fix it sometime in the future. Please ignore it for now, that's not the real issue here.

Now, to the point: explaining how the Leshan server shall be used is absolutely outside of scope of this "Issues" list, although note that you're connecting to a management server (port 5684), and yet you try to do use it as a Bootstrap Server (--bootstrap flag), which is likely the root cause of your problem. Refer to the Leshan documentation for information on how to configure Bootstrap Server, if that's what you wanted instead.

Are there any problems with connecting to the server without the --bootstrap flag?

And, for the future, please report issues with the Anjay library itself. We only provide technical support on GitHub (bug reports). If that is not enough, and you are interested in getting commercial assistance, write a line at sales@avsystem.com, or use the form on our website https://www.avsystem.com/contact/.