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

Strange LwM2M registration response. #104

Closed
FRDavid opened this issue Jul 14, 2016 · 3 comments
Closed

Strange LwM2M registration response. #104

FRDavid opened this issue Jul 14, 2016 · 3 comments

Comments

@FRDavid
Copy link
Contributor

FRDavid commented Jul 14, 2016

Original issue from the lightweight-iotagent project moved to this project

Hello,

Note: This issue only appears in the grunt tests carried out by lightweigh-iotagent, not in the lwm2m-node-lib. Since the problem must be solved in lwm2m-node-lib, the issue has been opened in the lwm2m-node-lib project.

We have detected that the process of register a device is not carried out correctly due to the appearance of strange messages. They could appear also in other cases also. These messages are interspersed in the communications and produces problems since they are using the MID corresponding to the real response.

Seems libcoap is not waiting long enough for lightweight-iotagent and lwm2m-node-lib to send the response and we didn't find a way to disable this auto-response from libcoap.

This image shows the strange message using the correct MID for an "Empty response" generated automatically by libcoap, then the correct response using a different MID, so the correct response can not be correctly processed by the device.

avoidfastresponse1

A way to solve this issue is introduce the parameter "piggybackReplyMs" in the coap server creation, this is done in the lwm2m-node-lib library.

serverInfo.server = libcoap.createServer({
type: config.serverProtocol,
proxy: true,
piggybackReplyMs: 500
});

The piggybackReplyMs default value for libcoap library is 50ms and it seems too short for the processing time carried out by the lightweight-iotagent/lwm2m-node-lib set so I increased this value to 500 to ensure at least basic cases, but this should be evaluated in a future in other conditions such as overloaded.

Next image shows the communication after introduce this option. Now is clean from strange messages.

avoidfastresponse2

Tests are passed correctly in both lwm2m-node-lib and lightweight-iot agent.

BR,
David

@FRDavid
Copy link
Contributor Author

FRDavid commented Feb 23, 2018

Since this issue was already solved and merged. I will close this issue.

@FRDavid FRDavid closed this as completed Feb 23, 2018
@fgalan
Copy link
Member

fgalan commented Feb 23, 2018

The fix is not mentioned in https://github.com/telefonicaid/lwm2m-node-lib/blob/develop/CHANGES_NEXT_RELEASE. Maybe it should be.

FRDavid pushed a commit to HOP-Ubiquitous/lwm2m-node-lib that referenced this issue Feb 23, 2018
@FRDavid
Copy link
Contributor Author

FRDavid commented Feb 23, 2018

Should be, so @fgalan check the PR #119 recently added

fgalan added a commit that referenced this issue Feb 23, 2018
Add reference to the already solved and merged issue #104 in the CHANGES_NEXT_RELEASE file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants