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

Bootstrap Write on client demo #699

Closed
beaniebag opened this issue Jun 12, 2019 · 4 comments
Closed

Bootstrap Write on client demo #699

beaniebag opened this issue Jun 12, 2019 · 4 comments
Labels
bug Dysfunctionnal behavior client Impact LWM2M client

Comments

@beaniebag
Copy link

I've been testing the Leshan client demo with a LwM2M Bootstrap server. The LwM2M Bootstrap server sends the Bootstrap write differently to the leshan Bootstrap server. Instead of the Uri-Path being /0/0 it sends it as /0 and puts the instance information in the TLV instead. I checked the OMA specifications 5.2.7.4 and this appears to be a valid case. This bootstrap write works on the wakaama client.

Here's a comparison:

LwM2M Server
Capture1

Leshan Server
Capture2

This is the error I'm getting from the leshan client demo

ERROR ObjectResource - Exception while handling request(CON-PUT    MID=57584, Token=4410C188A2C5321A, OptionSet={"Uri-Path":"0", "Content-Format":"application/vnd.oma.lwm2m+tlv"},
<Removed packets> ) on the /0 resource
java.lang.NullPointerException
        at org.eclipse.leshan.client.resource.ObjectEnabler.doWrite(ObjectEnabler.java:222)
        at org.eclipse.leshan.client.resource.BaseObjectEnabler.write(BaseObjectEnabler.java:211)
        at org.eclipse.leshan.client.californium.impl.ObjectResource.handlePUT(ObjectResource.java:231)
        at org.eclipse.californium.core.CoapResource.handleRequest(CoapResource.java:223)
        at org.eclipse.leshan.client.californium.impl.ObjectResource.handleRequest(ObjectResource.java:100)
        at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverRequest(ServerMessageDeliverer.java:108)
        at org.eclipse.californium.core.network.stack.BaseCoapStack$StackTopAdapter.receiveRequest(BaseCoapStack.java:193)
        at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
        at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
        at org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveRequest(BlockwiseLayer.java:391)
        at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveRequest(ReliabilityLayer.java:262)
        at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
        at org.eclipse.californium.core.network.stack.BaseCoapStack.receiveRequest(BaseCoapStack.java:133)
        at org.eclipse.californium.core.network.CoapEndpoint$1.receiveRequest(CoapEndpoint.java:240)
        at org.eclipse.californium.core.network.UdpMatcher$2.run(UdpMatcher.java:251)
        at org.eclipse.californium.elements.util.SerialExecutor$1.run(SerialExecutor.java:277)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
@sbernard31
Copy link
Contributor

You find a bug. Thx a lot for reporting this !

I create a PR #699 which should fix this, but it's not so easy to test for me. (As Leshan bootstrap server does not behave like this)

Could you check if this fix the issue ?

@beaniebag
Copy link
Author

Excellent, I've tested it with the LwM2M Bootstrap server and the client demo was successfully able to bootstrap. Thanks for the quick fix :)

@sbernard31
Copy link
Contributor

This PR is now integrated in master.

@sbernard31
Copy link
Contributor

Thx again @beaniebag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Dysfunctionnal behavior client Impact LWM2M client
Projects
None yet
Development

No branches or pull requests

2 participants