Observe request timeout - Leshan Server
See original GitHub issueHello,
I have been dealing with an issue on the server for the past two days. I have built my own LWM2M Server and I use your leshan-client-demo as “device”. My Java version is 11 and the leshan-server-cf is 1.3.1. Everything works as expected when I test it locally (Ubuntu 20). The client is able to register with the server over DTLS. Upon registration the server sends an Observe Request to the client. Code snippet below: However, in the scenario where my server is on AWS instance (Ubuntu 16) and the client is running on my laptop. The Observe Request timeouts and my client doesn’t receive it. Some logs below:
java[29570]: 14:43:59.468 [CoapServer(main)#1] DEBUG org.eclipse.leshan.core.californium.CoapSyncRequestObserver - Synchronous request cancelled CON-GET MID= -1, Token=null, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload
java[29570]: 14:43:59.468 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.stack.ReliabilityLayer - Exchange[L10] send request, failed transmissions: 0
java[29570]: 14:43:59.468 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.stack.ReliabilityLayer - Exchange[L10] prepare retransmission for CON-GET MID= -1, Token=null, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.BaseMatcher - registering observe request CON-GET MID=26251, Token=null, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.InMemoryMessageExchangeStore - [LWM2M Server-coaps://] Exchange[L10] added with KeyMID[{my_ip}}:4678-26251], CON-GET MID=26251, Token=B7BA9A3D0EF424D0, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.InMemoryMessageExchangeStore - [LWM2M Server-coaps://] Exchange[L10] added with token KeyToken[B7BA9A3D0EF424D0], CON-GET MID=26251, Token=B7BA9A3D0EF424D0, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.UdpMatcher - tracking open request [KeyMID[{my_ip}}:4678-26251], KeyToken[B7BA9A3D0EF424D0]]
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.Exchange - Exchange[L10, complete]!
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.InMemoryMessageExchangeStore - [LWM2M Server-coaps://] removing Exchange[L10, complete] for token KeyToken[B7BA9A3D0EF424D0]
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.InMemoryMessageExchangeStore - [LWM2M Server-coaps://] removing Exchange[L10, complete] for MID KeyMID[{my_ip}}:4678-26251]
java[29570]: 14:43:59.469 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.Exchange - local Exchange[L10, complete] completed CON-GET MID=26251, Token=B7BA9A3D0EF424D0, OptionSet={"Observe":0, "Uri-Path":["3","0"], "Accept":"application/vnd.oma.lwm2m+json"}, canceled no payload!
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.deduplication.SweepDeduplicator - add exchange for KeyMID[{my_ip}}:4678-45544]
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.deduplication.SweepDeduplicator - found exchange for KeyMID[{my_ip}}:4678-45544]
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.deduplication.SweepDeduplicator - found exchange for KeyMID[{my_ip}}:4678-45544]
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.deduplication.SweepDeduplicator - found exchange for KeyMID[{my_ip}}:4678-45544]
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.deduplication.SweepDeduplicator - found exchange for KeyMID[{my_ip}}:4678-45544]
java[29570]: 14:43:59.470 [CoapServer(main)#1] DEBUG org.eclipse.leshan.server.registration.RegistrationHandler - Updated registration org.eclipse.leshan.server.registration.UpdatedRegistration@460640 by RegistrationUpdate [registrationId=3VgTvlBbQ8, identity=Identity /{my_ip}}:4678[x509=darko], lifeTimeInSec=null, smsNumber=null, bindingMode=null, objectLinks=null]
java[29570]: 14:43:59.471 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.stack.ReliabilityLayer - Exchange[R11] send response null-2.04 MID= -1, Token=null, OptionSet={}, no payload, failed transmissions: 0
java[29570]: 14:43:59.471 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.Exchange - Exchange[R11, complete]!
java[29570]: 14:43:59.471 [CoapServer(main)#1] DEBUG org.eclipse.californium.core.network.Exchange - Remote Exchange[R11, complete] completed ACK-2.04 MID=45544, Token=B0357A177E9B7825, OptionSet={}, no payload!
java[29570]: device is still here: darko
Some more tests that were done:
- I tested your leshan-server-demo on AWS with UDP. Everything works fine, my client receives data.
- Modified the leshan-server-demo to match the functionality of my lwm2m server. (What I mean by functionality is calling the above
onRegistered
function from theRegistrationListener
) It still fails. - I ran the demo client on the AWS instance, too. My lwm2m server fails to send data again. Even though, the client runs on the same instance.
If something is not clear, let me know. 😃 Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Request timeout at server side #585 - eclipse/leshan - GitHub
i noticed that, for bootstrapped simulator with security communication, 10 min after simulator sent the reg update, the request sent by the ...
Read more >Getting Timeout error for Read/Write request in Leshan server
Leshan server has a timeout of 5 Sec. The client should acknowledge leshan server for any Conformable request sent within 5 sec, ...
Read more >Re: [leshan-dev] Request Timeout - Eclipse
Yes, I've seen that when the client registration updates, then the timeouts disappear. We need however to move to internal server, so no...
Read more >org.eclipse.leshan.server.californium java code examples
Sends a CoAP request synchronously to a registered LWM2M device. Will block until a response is received from * the remote client.
Read more >LESHAN PLATFORM LWM2M SERVER CONNECTION ...
1.5 LwM2M update the Binding Mode for Leshan Server . ... 2.2 Observe Operation . ... in leshan platform to 15min or longer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will do it myself to save you a few clicks. 😄
You’re welcome.
No problem 😉
Glad we find a solution and probably an explanation for you issue. Should we close it now ?