1

Last known sensor value

Topic: Last known sensor value

Hi there

Can anyone help us how we should request last known sensor values for a unit? There is 2 issue:

1. Some parameters are not available in all messages and we may create a sensor based on such parameters. We don't know when they parameter came to load messages for that time interval.
2. How we can receive Text type sensor value.

2

Last known sensor value

Re: Last known sensor value

hhamedk, there is no such opportunity in remote api for now to calculate sensor's value using last parameter value instead of parameter value from last message (or specified messages). We will try to find some solution for such case.

Head of Wialon Local Department
Gurtam
3

Last known sensor value

Re: Last known sensor value

deal, if we want to load messages for last one hour and get all messages for this interval how we should load messages? The strange part for me is load_count parameter (that is mandatory in all message request types), how we should set it when we don't know how many messages came from device in last one hour i.e. A way is to set a big number for this parameter (like 50K) to be sure that we get all messages. But this way doesn't seem logical and convenient way for long periods of time.

4

Last known sensor value

Re: Last known sensor value

hhamedk, load_count - is messages count to be returned after first request. This means that You can request messages for big interval and some count of messages will be returned at once. Also You'll get total messages count in response. And all other messages will be loaded to session on server side. They can be get using messages/get_messages requests by passing messages indices. This can be useful for some kind of paging interface.
If You want to get all messages for given interval at once just pass maximum 32 bit int value 4294967295 (0xffffffff).

Head of Wialon Local Department
Gurtam
5

Last known sensor value

Re: Last known sensor value

deal, We are using messages/load_last, would you please explain all  parameters ? (specially difference between lastCount and loadCount)
When we want to get all messages for example for last 3 hours why we should indicate quantity of messages? what you described for loadCount we got but regarding last count i don't understand it.

6

Last known sensor value

Re: Last known sensor value

hhamedk, messages/load_last request is for getting specified amount of messages from now down to lastTime.
lastCount parameter is for additional limiting of total messages count to be loaded in session on server side.
If You don't need to limit amount of messages to load and You want to get all messages from now down to lastTime at once with one request - just set lastCount and loadCount parameters with maximum 32 bit int value 4294967295 (0xffffffff)

Head of Wialon Local Department
Gurtam
7

Last known sensor value

Re: Last known sensor value

hhamedk, we added to unit/calc_last_message optional flag. If we set  flags = 1, then sensor is calculated by latest known parameters.

Tatsiana Shmihelskaya
Business Analyst, Gurtam
8

Last known sensor value

(edited by hhamedk 31/08/2017 08:35:12)

Re: Last known sensor value

tata, great work, thanks. It will make application development easier in many cases.