-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add means for Sensors to indicate invalid or unavailable value #356
Comments
To indicate data validity, you can just set the Adding metadata in the SensESP internal pipeline would require a major overhaul of the ValueProducer and ValueConsumer classes and the propagated data types. The benefit would be questionable because, as said above, you can simply indicate invalid or missing data by not sending anything. I don't think this change is aligned with the goals of this project. I'll close this issue. |
@mairas - I tried the approach you suggest of using the Using either the So, it appears this is a situation where the intent of the Signal K spec is not being followed by both the instruments and SensESP, leading to a pitfall where a user can be looking at stale/invalid data without knowing about it. It can be fixed from either end, by either sending a I'm not going to wade into an argument whether this aligns with the goals of your project, but I do want to document this issue so others won't run across it unawares. |
Issue
Occasions arise when some sensors are unable to provide data, for example a depth sounder without a bottom fix, or a GPS sensor when satellite coverage is lost. There is also the rarer case when sensor hardware fails.
Solutions
In situations when data are unavailable, the Signal K spec (https://signalk.org/specification/1.5.0/doc/data_model.html) says:
The word may is used, indicating that this approach is not mandatory. The advantage of doing so is that compliant instruments will alert the user to the missing data. For example, the Signal K Instrument Panel (v 0.16.1) shows dashes in place of missing numeric values. Alternatives to providing a JSON null for invalid values are:
What Works on Multi-value Producers
I'm trying the JSON null approach (#349) for the Attitude parameter and it works well: the Signal K Instrument Panel displays -.---- for yaw, pitch, and roll during an interruption in orientation sensor operation (simulated by pulling the I2C SDA line off), and reverts to proper values when comms are restored. Implementing this for a multi-value parameter like attitude was easier than it will be for a single-value parameter like temperature. Yaw, pitch, and roll are passed to the
SKOutput
consumer in a struct; I merely had to add a struct memberis_data_valid
and in theas_signalk()
method output anull
instead of numeric value when appropriate.Is Different for Single-value Producers...
For single-value parameters that are passed using
NumericProducer
(i.e. ints, floats, booleans) I'm unsure how best to proceed. Some out-of-band signalling method of indicating data validity while keepingoutput
as a single variable is one thought. Another would be to switch to always useoutput
as a struct, and to permanently have one struct member beis_data_valid
, and have a second member contain the single-value output. Suggestions?The text was updated successfully, but these errors were encountered: