GroveStreams

needing to know location of a device420

ctmorrison private msg quote post Address this user
I'm helping someone on a project in which they'll have several components. They'd like to be able to see the components on a Grovestreams map (dashboard, I assume) and would also like to know if the devices are moved (should not happen). We're currently sending lat and lon to the server as stream data (latitude and longitude data types).

It appears the map capability is driven by the "location" property of the component.

So...if we want to see where the component is on a map widget, do we need to update the location property of the component via a POST?

If we want to alert if the location changes, should we also have latitude and longitude streams and utilize an alert to know if that streams changes more than a specified amount?
Post 1 IP   flag post
MikeMills private msg quote post Address this user
Quote:
Originally Posted by ctmorrison
do we need to update the location property of the component via a POST?
Yes, just upload the Latitude and Longitude stream samples via Feed PUT API calls just like you would for any other streams. I would define them as Regular streams since, I'm guessing, you're not uploading the location on a regular sample rate cycle.

Ensure you've defined the component's Location Disposition to be 'Mobile'.

Quote:
Originally Posted by ctmorrison
If we want to alert if the location changes, should we also have latitude and longitude streams and utilize an alert to know if that streams changes more than a specified amount?
If your device is just sending up the location when it changes, then you can just setup a "Value Arrived" event to detect when the device moves. Otherwise, setup a derived stream that compares the LAST_VALUE with the current value to determine if the device moved.
Post 2 IP   flag post
ctmorrison private msg quote post Address this user
So...I'm still confused about what we're sending up. Should I be naming the streams (give them an ID of "Latitude" and "Longitude" and use those in the PUT? If not, how does the map widget know the latitude and longitude streams to use?

If this is in the API docs, please just point me there if I'm being dense.

It's a battery powered application. The device is waking and recording sensor readings and GPS location every hour and then sending to GS every 6 hours as a series of 6 PUTs. I realize we could be a bit smarter about the # of calls, but we're just trying to get the basics working now and refine as we go forward.

I'm OK with the second part of your response about alerting.
Post 3 IP   flag post
ctmorrison private msg quote post Address this user
OK. I think I understand now. If I have a stream of type latitude and one of type longitude, the most recent values (which have to arrive in the same PUT) are considered the most recent location for the component when it's configured as "mobile". The names and IDs are irrelevant. Correct?
Post 4 IP   flag post
MikeMills private msg quote post Address this user
Right. The GS maps look to see if a component is configured as Mobile and then looks for streams with types Latitude and Longitude.

They can have any Name or ID.
Post 5 IP   flag post
ctmorrison private msg quote post Address this user
Nice! Thanks for the clarification and confirmation. As I looked very close at the data we've been pushing and the coordinates shown on the map widget, it became apparent how the system is working.
Post 6 IP   flag post
2965 6 6
Log in or sign up to compose a reply.