Partial data in messages is a common pain point in fleet management since it compromises accuracy and timeliness of related operations. Oftentimes, status messages and events from sensors, panic buttons, etc. come without position data.
Flespi has come up with the solution to fix this inconsistency — you create a pipe-cache-params channel, specify the source channel (or channels) where messages will come from, say which parameters have to be present in each message, and flespi will be filling the gaps as new messages arrive.
Flespi can complement any parameters (not just position data) that are presupposed in the message provided that at least one previous message from the given device (ident) sent non-empty values for these parameters.
One prerequisite to using the pipe-cache-params channel is having at least one other active channel that receives messages from devices.
Once you have it, create a new channel and pick the pipe-cache-params protocol_id.
Then check the configuration item and populate the Channel IDs, Token (either ACL type with access to the listed channel messages or Standard; avoid using Master token here — it's excessive), and Parameters to cache fields with valid values.
Pay special attention to the “Generate messages only when ALL listed parameters are cached” toggle — this one can dramatically affect the behavior of the channel. With this option enabled, if the cache is cleared either because it expires or our servers are rebooted or you disable and enable the channel, all listed parameters in it will be lost. Consequently, newly received messages will be discarded until ALL listed parameters are cached again.
Note: the caching of parameters is performed on a per-ident basis, which means that if earlier messages for a given device (ident) contained certain non-empty parameters, the pipe-cache-params channel will be able to inject their values into subsequent messages in place of the missing values.
As you can see on the screenshot below, our Dataflow channel sometimes gets messages with the position data missing:
While our Pipe channel has this issue fixed seamlessly:
You can specify several channels as sources for the pipe channel. In this way, you need can fix missing values for the same parameters across multiple device types (and manufacturers) since they have common names.
Note: Avoid having devices with the same ident in different channels — this will corrupt your cache for this ident and will lead to wrong position data being pasted.