-
Notifications
You must be signed in to change notification settings - Fork 52
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
Reporting no known location through the Location object (/6) #570
Comments
Very nice summary! (0,0) coordinates are valid coordinates - period.
Partially agree: 5.03 fits, this should be expected by any server - not only for location object. If for any reason: error code is not meant to be used here then |
Just for completeness :
I guess that mean client will return NOT_FOUND ? if I guess right then you will face some issue with Observe Request too. |
For pure JSON, the RFC for number says :
but eventually you can consider to use null (but this is no more a Number from the RFC point of view) For SenML, I'm not sure we can do that.
Note that it seems also true for SenML-CBOR :
From SenML point of view, I guess the idea behind this is : "If you have no value just don't add the SenML record" ? |
I understand that this will lead to make all number (This remember me this old discussion about mandatory and |
I opened the issue #508 3 years ago, but we have never submitted any new object version proposal :-( Related to the sentence "this requires the server to query the Timestamp resource to check the location validity, even if it's only interested in the coordinates", I don't agree because the lat-long set of info without the timestamp is an incomplete meaning... |
So this has same drawback than using timestamp=0 or I missed something ? |
This can be generally true, but I can imagine use case where you just want to know "last known position" and so for this usecase it seems to me that timestamp is not really mandatory. |
Another option : Specify in Location Object, a specific value to which is not a valid latitude / longitude which means unknown. (I'm not an expert in GPS coordinate, so maybe this is not possible.) |
Mostly. It is arguably more elegant, because we wouldn't need to rely on 1970-01-01 being treated as "invalid time", so this would make it possible to report historical locations from the 1960s and 1970s if desired for any reason ;) Yes, I know it's little more than a weird hypothetical.
The latitude is in the range [-90, 90] and the longitude is in the range [-180, 180] (-180 is equivalent to 180 but there doesn't seem to be a clear standard on which to include). Using values clearly outside of those ranges is indeed an interesting idea, if a bit hacky. |
Yep, but maybe the solution with less concrete drawback ? and this looks like a bit what is done for
|
|
I'm not sure 🤔, I understand that a range is defined. The Location object says :
So I hope this refer to a kind of standard. I understand this is probably what is described here : https://en.wikipedia.org/wiki/Decimal_degrees ? (better source to real standard are welcome) If it's right, it is said :
(which matches #570 (comment)) |
As long as this is clearly defined in Location object that this kind of lenient notation is not allowed (if it exists), I don't see the issue. |
Even if I can agree using a constant is maybe not so elegant, the question is "which is the least bad solution". With current big picture, IMHO, defining a constant for unknown value solves all issue exposed above at cost of some elegance. |
Personally I'd be more for a "any value outside of the valid range is treated as no valid value" kind of definition, rather than defining a specific constant. Feels less random IMO, and makes the meaning of all possible values clear. If we designate e.g. 512 as a specific "null" constant, then what would 1024 mean? But the idea of using out-of-range values seems to indeed solve all the issues. What would be the compatibility implications? Are there any implementations known to use alternate ranges, e.g. [0, 360] instead of [-180, 180], or imperfect wraparounds (e.g. temporarily reporting 180.1 instead of -179.9 when travelling across the 180th meridian), that would be affected by explicitly defining all out-of-range values as "null"? |
I don't know if this is really random but yes this is arbitrary value.
Maybe acceptable with current and previous version of the object, but if implementer switch to last version they should adapt their code. (because range will be clarified) Maybe Arbitrary value could allow some server implementation to tolerate this kind of bad implementation more easily ? |
The advantage to use an
|
I feel that the discussion floated into abuse-the-value direction whereas there are other options. Particularly: what is so wrong about returning 5.03?
The GPS fix is yet to be acquired, which means that whoever tries to read it
|
This is explained by @kFYatek in the issue description :
|
I think we get your opinion and it can make sense. All option are bad but some resolve all concrete issues raised by @kFYatek.
About using 5.03, note that this is allowed by LWM2M v1.2.1 but not for LWM2M v1.0.x or v1.1.x. Just to be clear, I just try to help to find a solution but I'm not affected by this issue. |
The Location object (/6) in its current version 1.0, defines the Latitude, Longitude and Timestamp resources as Mandatory; however, the device may often not know its location, for example when it is still waiting for the first GPS fix since reboot.
What is the preferred way of reporting such condition by a LwM2M Client device?
Here are some possible solutions, none of them feeling "right":
Here are some possible proposed solutions that would require amending the LwM2M TS and/or the Location object definition:
nan
for Plain Text, and as thenull
value for JSON-based formats.What do you think about each of those?
The text was updated successfully, but these errors were encountered: