AVSystem / Anjay

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

Connecting to Leshan fails #47

Closed yassine-amraue closed 4 years ago

yassine-amraue commented 4 years ago

When I try to connect to the public Leshan server (https://leshan.eclipseprojects.io) with the example in examples/tutorial/read-only I can see the device registered in the Leshan Server successfully and the Server also acknowledges the registration with an ACK message but still the LOG outputs show "Failure while receiving Register Response: timeout":

INFO [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/anjay_core.c:176]: Initializing Anjay 2.6.1
INFO [anjay_dm] [/Users/a80482327/CLionProjects/Anjay/src/core/anjay_dm_core.c:119]: successfully registered object /0
INFO [security] [/Users/a80482327/CLionProjects/Anjay/src/modules/security/anjay_mod_security.c:181]: Added instance 0 (SSID: 1, URI: coap://leshan.eclipseprojects.io:5683)
INFO [anjay_dm] [/Users/a80482327/CLionProjects/Anjay/src/core/anjay_dm_core.c:119]: successfully registered object /1
INFO [server] [/Users/a80482327/CLionProjects/Anjay/src/modules/server/anjay_mod_server.c:141]: Added instance 0 (SSID: 1)
INFO [anjay_dm] [/Users/a80482327/CLionProjects/Anjay/src/core/anjay_dm_core.c:119]: successfully registered object /1234
INFO [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_reload.c:175]: servers reloaded
INFO [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_connections.c:161]: reconnected
INFO [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_register.c:712]: Attempting to register with LwM2M version 1.0
INFO [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_register.c:680]: Register sent
WARNING [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_register.c:593]: failure while receiving Register response: timeout
WARNING [anjay] [/Users/a80482327/CLionProjects/Anjay/src/core/servers/anjay_register.c:544]: could not register to server 1

I can see the messages arriving in Wireshark but still Anjay does not seem to handle the Register response. Am I doing something wrong?

Bildschirmfoto 2020-10-15 um 15 02 37

Thanks for the help!

kFYatek commented 4 years ago

I was not able to reproduce your problem locally. Everything works fine on my local machine, both using macOS and Linux.

I suspect that maybe you are using some kind of firewall on your system that prevents received packets from being properly forwarded to the application.

Also, what compilation options are you using? Could you also send the actual PCAP file with this communication attempt instead of just a screenshot?

yassine-amraue commented 4 years ago

Thanks for the quick reply. Here is the pcap:

anjay_test.pcap.zip

In the meantime I'll check my firewall settings.

yassine-amraue commented 4 years ago

PS: I am not using any specific compile options. I am building everything with the included CMake config from the repo.

kFYatek commented 4 years ago

Everything in the PCAP looks fine as well. Unfortunately, I have no idea what is going on. My guess is still firewall settings, or some other problem on the operating system layer. If everything else fails, you may want to try on another machine, or perhaps using some kind of a VM.

yassine-amraue commented 4 years ago

I am going to try that later and keep you updated. Thanks for the support so far

yassine-amraue commented 4 years ago

It was a firewall/network configuration issue on my machine. It's working fine with another machine. Thanks for the help!