-
Notifications
You must be signed in to change notification settings - Fork 28
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
Very high frequency updates #107
Comments
It is fine to discuss this here. Like in the Generic Sensor API, at the sensor level there is sampling frequency, and reporting frequency. In this issue we are talking about the case when reporting frequency is [much] smaller than sampling frequency, and we want to notify a sequence of readings in one notification. The way I see it this should be possible now:
The question is what the Scripting API should support. I've been thinking to add optional options to the |
As a related thing, @mjkoster mentioned the The Series Transfer Pattern (STP). |
On the Of couse, some sense has to be put into where the For this, the event source device running the script with the The client running the In summary, this issue is already covered with what we have in the specs. |
@mkovatsc - whilst a thing description could define an event as an array of values, this hides the semantics as a time sequence of sensor readings with a given sampling frequency and latency. In my multichannel ECG demo, the client application drives a smoothly scrolling display of the sensor readings. The transfer of data from server to client is subject to jitter which needs to be allowed for in order to achieve smooth scrolling without drop outs when data isn't received in time. For this, I found it convenient to declare the frequency and buffering latency as part of the thing description, and use this information to manage the display buffer beyond the end of the display. Sometimes you want to stream updates from a client to the server where similar considerations apply. For this, it is desirable to have an API for pushing a sequence of updates to the WoT runtime. Streams may represent continuously changing values, in which case, the data transferred may be a piecewise polynomial approximation. A use case is continuously driving actuators, e.g. the direction of a light beam, or the joints of a robot arm. We thus have a need to support streaming from server to client and from client to server. The thing description declares the data type of the properties along with the metadata for the frequency of updates and the buffering latency, which determine how long you can expect to wait for the next bundle of updates. |
Maybe a piece of the puzzle that has to be brought up explicitly: When you use a TCP-based channel or CoAP's CoCoA -- which is very advisable for high frequency updates -- there is flow control available: The event source can learn that the subscriber cannot handle the current update frequency. The runtime can use this to throttle the frequency according to the communications metadata (e.g., by re-sampling or just dropping frames). To keep things simple, there should not be a specialized extension to the Scripting API for just this use case (but use the metadata mechanism instead). |
Delays may come from other sources than networking issues alone. @draggett wrote:
So the proposal would be to support such application hints by the Scripting API towards the Scripting runtime (from there on it depends on networking support). Such a use case/requirement makes sense IMHO. So we "leave space" in the API for such future API options (not necessarily WoT Interaction options). |
Scripting Call 2021-08-02 Does not seem to be limited to scripting but being rather a more generic (TD? )issue.. -> Propose Closing |
I would say that this is also protocol specific and can be abstracted by a |
That's exactly what we were discussing also. Hence (as pointed out by @ashimura) we need actual uses where you need such a functionality. |
Scripting Call 2021-08-09
|
Scripting API Call 2021-08-23
|
Note: not sure if this is the correct repository for this issue, please advise.
For some telemetry use cases, we may have very high frequency of updates for a thing's state. Each update can have multiple data values, e.g. where you want to transfer readings that were taken at the same time from multiple sensors. To handle this efficiently, it is desirable to bundle a sequence of successive updates into a single message. A related use case has a very high frequency of events, necessitating a means to bundle successive events.
Application developers shouldn't be concerned about the underlying protocols, but are certainly interested in ensuring that their use case is implemented efficiently by the Web of Things platform. For this purpose, there should be a means to request such bundling and to provide some hints to control this. I see value for exposing this control in the thing description as part of the communications metadata, but also through the scripting API, to allow applications to adapt to changing conditions.
The scripting API is also involved in that application developers may want to indicate that they are able to handle a bundle of state updates or events when they call the observe API.
My implementation experiments used a couple of metadata terms: frequency for the expected frequency of the updates (samples/second), and latency in seconds, which indirectly relates to the number of samples in each bundle. Please ask me for a demo.
The text was updated successfully, but these errors were encountered: