eclipse-wakaama / wakaama

Eclipse Wakaama is a C implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).
BSD 3-Clause "New" or "Revised" License
503 stars 374 forks source link

Some question about time-related attribute of a client. #636

Open Asher9977 opened 3 years ago

Asher9977 commented 3 years ago

Hi, I'm new here and use the wakaama client and server for testing lwm2m.

Now I'm trying to add time-related attributes(PMIN/PMAX) to get notify on server.

Some problems I don't understand: (1) If I set the time attribute to /5, it doesn't sending the notify of all the resources under the /5 object. (2) If I set the time attribute to /5/0/1 then it is not possible to set time attribute to /5. (But it works in reversed way. (3)If I set /5 to 100/200(PMIN/PMAX) and /5/0/1 to 10/20(PMIN/PMAX), what should be the correct behavior for observing /5 ?

BTW, how do I set the timeout of writing command on server ? Thanks in advance.

sbernard31 commented 3 years ago

I don't know how it behave in wakaama. But at a LWM2M specification point of view, I understand that :

(1) I'm not sure I get you but if you mean that "if pmin/pmax is set at /5 level then those attributes are applied to all resources under /5" then it's correct to me. (2) it should be possible to set pmin/pmax at both level, object (/5) and resource(5/0/1) level in any order. (so looks like a bug) (3) 100/200(PMIN/PMAX) should be used for /5.

See for more details : http://www.openmobilealliance.org/release/LightweightM2M/V1_1_1-20190617-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_1_1-20190617-A.html#5-1-1-0-511-Attributes-Definitions-and-Rules

Asher9977 commented 3 years ago

Hi, it is so happy to get your response. : )

(1) I use the time to set PMIN/PMAX to object 5 then observe /5, but it doesn't send the notify of all resources value under object 5 (/5/0/1, /5/0/3...) as I expected.

One more question, is it possible to clear the time-related attribute of a client ?

Thanks a lot!

sbernard31 commented 3 years ago

Still from a specification point of view (I don't know if this is implemented in wakaama), this is possible using an empty attribute with WRITE-ATRIBUTES request.

See : http://www.openmobilealliance.org/release/LightweightM2M/V1_1_1-20190617-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_1_1-20190617-A.html#6-3-4-0-634-Write-Attributes-Operation

Parameter Required Default Value Notes
<NOTIFICATION> class Attributes Yes   Indicates which Attributes are concerned. When an Attribute is specified without value, it means this Attribute value is unset at the level specified in the operation (Object, Object Instance, Resource, or Resource Instance levels).
sbernard31 commented 3 years ago

Just in case that was not clear, to remove pmin/pmax on /5, send : Write-Attributes /5?pmin&pmax

Asher9977 commented 3 years ago

Just in case that was not clear, to remove pmin/pmax on /5, send : Write-Attributes /5?pmin&pmax

Thanks. It seems no way to do that on Wakaama now ? (with which operation ?)

sbernard31 commented 3 years ago

I don't know. We must wait from active committers to get more details about Wakaama behavior.

But there are some hint (toClear) which show that maybe this is possible :

Asher9977 commented 3 years ago

Noted, thanks for your reply.

tuve commented 2 years ago

@sbernard31 Maybe I have misunderstood but I am not sure about "(3) 100/200(PMIN/PMAX) should be used for /5." since pmin pmax are attached on resource level even thou they can be assigned on object level.

In the example given by @Asher9977 all resources under /5 except /5/0/1, i.e., /5/0/3, /5/0/5 ... will have 100/200(PMIN/PMAX) attached, whereas /5/0/1 will have 10/20(PMIN/PMAX) attached. So wouldn't an observe on /5 have 10/20(PMIN/PMAX) since one resource will trigger the update more frequently?

sbernard31 commented 2 years ago

@tuve to be honest, I'm not sure I still agree with my "me from the past". At least I'm very much less confident. I totally understand your point and it makes sense.

I try to summarize my confusion here. Let's agree on some wordings :

(At least this is my understanding)

Following this :point_up:, I would say "yes" to :point_down:. because the assignation level is at object level but should be applied (attachment level) at resource level.

In the example given by @Asher9977 all resources under /5 except /5/0/1, i.e., /5/0/3, /5/0/5 ... will have 100/200(PMIN/PMAX) attached, whereas /5/0/1 will have 10/20(PMIN/PMAX) attached. So wouldn't an observe on /5 have 10/20(PMIN/PMAX) since one resource will trigger the update more frequently?

But reading this : https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/478 I'm now confused again...

I'm not sure if you understand this like me but it seems that :

  1. pmin/pmax attribute assigned to resource level MUST NOT be used for observation relation established at object instance level.
  2. pmin/pmax attribute assigned at object instance level MUST be used for observation relation established at object instance level.

Eventually, I can vaguely understand the 1, but that seems to imply that attributed are never used for observation at Object or Object instance level. (because all have resource attachment level)

The 2 seems to say that the pmin/pmax is applied to object instance level. (but the spec says that pmin/pmax are only attachable at resource level)

So currently, I'm lost... :sweat_smile: Did I missed something ?

tuve commented 2 years ago

I have the same understanding of observation, assignation, and attachment. Maybe I have misunderstood assignation and attachment. If the attachment is the same as assignation then the expected behavior would be as described in https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/478 but my understanding is that it is not.

"So currently, I'm lost... 😅", me too

sbernard31 commented 2 years ago

@tuve there is some news at https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/478 (but still not clear to me for now), maybe you should watch the issue.

(Maybe already done but) In a more general way, I think it could be a good idea that the whole Wakaama team (@rettichschnidi, @mlasch , @qleisan) watch those github repositories :

I think those are good place to discuss about the specification all together (Wakaama, Leshan, OMA and probably other devs)