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

Adding support for epmin/epmax #18

Closed
asoloway64 opened this issue Apr 13, 2020 · 10 comments
Closed

Adding support for epmin/epmax #18

asoloway64 opened this issue Apr 13, 2020 · 10 comments

Comments

@asoloway64
Copy link
Contributor

@asoloway64 asoloway64 commented Apr 13, 2020

OMA LwM2M added support for additional attributes that should be reflected back into the dynlink draft to avoid fragmentation. Those attributes are called Minimum Evaluation Period (epmin) and Maximum Evaluation Period (epmax).

The current LwM2M Core Spec currently has this statement:
"The behavior of all Attributes SHOULD follow [DynLink] except epmin and epmax, which are only defined in this specification."

The goal would be to change that statement to:
"The behavior of all Attributes SHOULD follow [DynLink]."

Below is text to consider for the inclusion in the dynlink draft:
"The "Minimum Evaluation Period" (epmin) and "Maximum Evaluation Period" (epmax) values can be used to configure the device to perform reporting evaluations. After the expiry of epmin, the device MAY immediately perform an evaluation per the "Notification Conditions" above. After the expiry of epmax, the device MUST perform an evaluation per the "Notification Conditions". If both the epmin and epmax attributes are defined, the epmin must be less than the epmax."

These are the table entries from the LwM2M Core Specification:
Minimum Evaluation Period | "epmin" "=" 1DIGIT | Resource | Resource Resource Instance Object Object Instance | No | RW | Integer | - | Readable Resource
Notes: The Minimum Evaluation Period Attribute indicates the minimum time in seconds the LwM2M Client MUST wait between two evaluations of reporting criteria. In the absence of this parameter, the Evaluation Minimum Period is not defined.
Maximum Evaluation Period | "epmax" "=" 1
DIGIT | Resource | Resource Resource Instance Object
Object Instance | No | RW | Integer | - | Readable Resource
Notes: The Maximum Evaluation Period Attribute indicates the maximum time in seconds the LwM2M Client MAY wait between two evaluations of reporting criteria. When the Maximum Evaluation Period expires after the previous evaluation, a new evaluation MUST occur. In the absence of this parameter, the Maximum Evaluation Period is not defined.

@bsilverajan
Copy link
Contributor

@bsilverajan bsilverajan commented Apr 22, 2020

@asoloway64 This seems like a good addition to the other conditional attributes we have. I do think some additional clarifications would be necessary. How should the CoAP endpoint (an origin server, or the LWM2M client) handle an incoming Observe request which contains epmin/epmax query parameters, but does not have any other attributes present?

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented Apr 24, 2020

@bsilverajan These values only have context when other conditional attributes are present such that a measurement must take place and report potentially generated. If no report would ever be generated, then these parameters that guide when a measurement takes place provide no value. Would you like me to capture the above text somewhere? How about in each table entry: "This value is ignored if other conditional attributes are not provided".

@cabo
Copy link
Member

@cabo cabo commented May 12, 2020

I'm not sure we should be "configuring the device" using query parameters on a GET/observe.
But maybe the text above is not enough for me to understand what is being "configured".

@jaimejim
Copy link
Member

@jaimejim jaimejim commented May 12, 2020

Checking the content on the OMA spec, I am wondering if epmin/epmax make sense from REST pov.

Query parameters are used to operate on the state of a resource and not to modify the internal mechanisms nor behaviour of the sensor. Thus evaluation periods would be out of the scope of what a query parameter should do IMO.

I'll copy this comment in the OMA issue tracker too if that's OK.

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented May 12, 2020

I equate the definition of epmin/epmax to pmin/pmax as they control when a notification report is/can be generated and have noting to do directly with the behavior of the sensor. pmin/pmax have nothing to do with the state of a resource but only when that state is evaluated/reported. epmin/epmax is similar.

@ektrah
Copy link

@ektrah ektrah commented May 12, 2020

Do you perhaps have an example that shows the effects of epmin/epmax?

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented Jun 24, 2020

In the dynlink call yesterday, Klaus showed an example of where the device wakes up every second to check the value of an observed resource. How does the device know to wake up every second to read that sensor? That is how the epmin and epmax values are used.

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented Sep 23, 2020

I have created pull request #20 to address this issue.

I did not create an example as I wasn't sure the format that we would wish that example represented. Let's discuss during the interim meeting.

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented Sep 23, 2020

Here is text to consider for the example:
As an example of the use of the Conditional Control Attributes, we will detail an observation using pmin, pmax, gt, epmin and epmax. In this use case, we have a temperature sensor that will send a notification whenever the temperature goes above or below 100 degrees (gt>100). It cannot report more often than every 5 seconds (pmin=5). It must report at least every 60 seconds (pmax=60). In order to control how frequently the server measures the temperature sensor, the client configures the server to avoid measuring it more frequently than 5 seconds (epmin=5), but the server must measure it at least every 10 seconds (epmax=10). After a notification is generated (t=0), the device waits 5 seconds before another notification can be sent due to pmin. After that 5 seconds expires (t=5), the server decides to perform a measurement of the temperature sensor. If the temperature has not changed from its previous state (the temperature has remained above 100 or remained below 100), no notification is generated. The server must wait another 5 seconds (t=10) before doing another measurement of the temperature sensor due to the required expiry of the epmin. At that time (t=10), the server decides that it does not want to do a measurement of the temperature sensor (an implementation specific decision). After an additional 5 seconds (t=15), the server MUST perform a measurement of the temperature sensor due the expiry of epmax. If the temperature has changed (the temperature has gone above 100 or gone below 100), a notification is generated. If not, the server returns to the measurement cadence defined by the epmin and epmax attributes. If 60 seconds goes by prior to a notification, a notification is generated because of pmax.

@asoloway64
Copy link
Contributor Author

@asoloway64 asoloway64 commented Jun 10, 2021

This has been accepted into the draft, so the issue can be closed.

@asoloway64 asoloway64 closed this Jun 10, 2021
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

5 participants