-
Notifications
You must be signed in to change notification settings - Fork 67
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
Issue by getting Observation from MQTT broker #55
Comments
What subscription did you use to get these Observations? The Datastream should not be expanded in the Observation, when getting it over MQTT. That would be a bug. As to 3, the spec states:
So the question would then be what exactly "a complete JSON representation" is. We've interpreted it as everything, including self and navigation links, since you can always turn those off using the $select parameter. |
I think it a BUG. I used 'paho.mqtt.client' to receive Observations. The received payload in msg is:
For sure I can get everything through REST. My point is that if it's worth it to put these links in the MQTT message instead of just expanding entities. When a user tries to get |
I agree it would be useful to be able to get the expanded datastream and feature of interest, but that would be a change to the standard, so that discussion should go on the Github page of the standard: https://github.com/opengeospatial/sensorthings Can you also give us the JSON of Observation you use in those create requests? did they contain a datastream and FoI entity? |
I created the Observation via HTTP. Its DataStream and FoI are created separately. The @iot.id of the DataStream is specified in the URL and the @iot.id of the FoI is packed in JSON.
|
It should be fixed in the latest master. |
Thank you for the quick fixing. You are right, now i convert the result to float before sending the Observation to the Frost-Server.
Now the question would be: how can i get FoI, if i want to fetch Observations via MQTT? |
Yes, currently there is no way to automatically get the FoI using MQTT, you'll have to fetch the FoI separately. If the Sensor is not moving, you can cache it and in that case it's not much of an issue. You don't want to repeatedly get the same data any way, so you'd just fetch the FoI when initialising. If the sensor is moving it's more of an issue, since you'd have to separately query the server for each Observation you receive. I guess that's an oversight when defining the standard. I'll open an issue about it on the SensorThings Github page. |
Hi,
I posted a
DataStream
and severalObservations
via Rest to the Frost-Server.Then i tried to get these Observations via MQTT broker.
The received JSON is as follows:
{ "phenomenonTime" : "2016-03-02T10:50:00.000Z", "resultTime" : "2016-03-02T10:50:00.000Z", "result" : "7.2", "Datastream@iot.navigationLink" : "http://localhost:8080/FROST-Server/v1.0/Observations('1f067586-604e-11e8-b7bf-c3302333d15c')/Datastream", "Datastream" : { "unitOfMeasurement" : { "name" : null, "symbol" : null, "definition" : null }, "@iot.id" : "t1edu.teco.wang/IBADENWR82/Datastreams/Air-Temperature-IBADENWR82" }, "FeatureOfInterest@iot.navigationLink" : "http://localhost:8080/FROST-Server/v1.0/Observations('1f067586-604e-11e8-b7bf-c3302333d15c')/FeatureOfInterest", "FeatureOfInterest" : { "@iot.id" : "t1edu.teco.wang/IBADENWR82/FoI/IBADENWR82/48.441/9.257" }, "@iot.id" : "1f067586-604e-11e8-b7bf-c3302333d15c", "@iot.selfLink" : "http://localhost:8080/FROST-Server/v1.0/Observations('1f067586-604e-11e8-b7bf-c3302333d15c')"}
,which seems not correct:
unitOfMeasurement
inDataStream
entity is not returned correctly. I checked this via Rest, it's inideed saved in Frost-Server, but not sent via MQTT.FeatureOfInterest
of anObservation
should also be completely packed in JSON? Just like its 'DataStream'Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: