-
Notifications
You must be signed in to change notification settings - Fork 407
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
Should sending timestamped data in an observation request response be a supported use case? #1616
Comments
I didn't get exactly what does your device. So Maybe #1610 will helps but this is not sure. So to answer more precisely, I should know what contains the first observe response which cause issue in your case.
If I would know exactly what does your device (which kind of response is sent), I can let your know (from my point of view) if :
|
I tested the PR but unfortunately the data I get doesn't work after those changes either. I'll see if I can share some sensible data from the device here. If not, I'll close this issue soon. |
This could be great because :
|
I've taken an example of a SENML_CBOR message that the device sends. As I mentioned in the opening message, parsing this payload fails if the device sends it as a response to an observe request but succeeds if it's sent as a notification of a changed value later. The raw payload in hex:
Which is then parsed to CBOR:
And when the parsing succeeds, the actual objects inside are:
If I debug the device server, LwM2mNodeSenMLDecoder fails the timestamp check for each item. Does this make any sense, or would you need more info? |
🤔 at first sight I think this should work ... I will try to investigate/test that more. |
I tried to decode the hex value you shared ☝️ with
I didn't face issue and works as expected. I also tried to adapt an integration test and I'm able to decode this payload when I do an So to be clear expected results are :
After testing, it seems to me that code works as expected. |
Well, this is embarrassing... Apparently I didn't checkout the PR branch after all before building the test version. 🙄 I thought I did, but it seems I concentrated so much on updating the version numbers in the POM files to make sure I'd get the correct version of Leshan libraries that I forgot to switch branches first. (Edit: Well, I seem to have checked out Jaroslaw's fork, but then used the I re-tested this now after the PR merge, and it indeed seems to work fine! 🎉 Thank you for the effort in digging into this! 🙇 And sorry for the extra trouble, caused by my mistake! I believe this will work great when M15 gets released, so I'm closing the issue. Thank you again! |
No problem 😉 |
@mjviljan there is discussion about #1610 PR. Discussion are :
Sorry this is maybe not so easy to follow. (but do not hesitate to share your opinion there ☝️) Anyway, if we revert it and this could impact you because your use case will not work anyway. |
Hi, Thanks for the ping! I've been following the discussion in Plan for 2.0.0-M15 🎯 but not the others. I was happy about the change as that would fix my use case nicely, but of course you must think of what works best for Leshan in general and go with that. I can definitely write a custom decoder for my case. And as I believe the payloads I receive will include the measurement timestamps in the actual data, losing the timestamp from the root node should not be an issue. 🤔 |
I forgot to thank you for your quick feedback. Just in case I try to clarify my mind about timestamp usage in LWM2M : #1623 For now, there is no decision about what we will do about "time fields" usage issue... 😬 |
(You probably already notice that but finally decide to integrate the timestamp feature, this is now available in 2.0.0-M15) |
I did, and immediately took that version into use. Works nicely. :-) Thank you again! |
Question
Hi,
I'm trying Leshan out with a water meter installed on an actual water pipe. The meter's manufacturer has specified that the device management server should register as an observer on the object instance resource
/10262/0/2
(the object being titled "Interval Data Delivery") which includes several instances of meter readings, all of those timestamped.Now, when I send an observation request from the server to the device, the device responds by sending a success response and the latest object value — which in this case is an array of several instances. The response is sent in SENML_CBOR format. The server fails to parse the response, giving an error
This seems to come from LwM2mNodeSenMLDecoder which has a specific check that there is no timestamp in the resolved record.
The actual request is accepted and when the device starts notifying the server of the resource's changes, the messages are parsed totally fine. Based on my investigation, this seems to happen because the notification messages are decoded using the LwM2MDecoder's method decodeTimestampedData, whereas the payload of the observation request response is using the decode method.
So, I get the notifications fine, but I miss the first values the device is sending, because those are sent already in the observation request response and decoding that fails. This is a problem especially if the connection between the device and the server has been down for some reason for a while, as then the device will send a bigger buffer of stored values in one go in the response, and those are now lost.
I've found these issues which I believe are related, as well as the PR and its comments (esp. about
ObserveResponse
):I've tried to investigate this further on my own but I'm unsure about the following:
ObserveResponse
also, would that fix my case also? (If so, you definitely have my vote on including that also. 😄)The text was updated successfully, but these errors were encountered: