View sensors position in realtime

38 views
Skip to first unread message

AUGUSTO HENRIQUE OSTAPECHEN

unread,
Nov 18, 2022, 6:18:41 PM11/18/22
to Sentilo
Hi Sentilo team,

I'm developing a web application with a leaflet to monitor a sensor in real time for my graduate final paper, but I'm stuck.

Basically I'm not sure how I get the last coordinate from Redis. The initial idea was to develop a web hook, but I think the right approuch is configure a alert or a custom agent. 

Can you help me with this question?

Sentilo IO

unread,
Nov 22, 2022, 4:26:54 AM11/22/22
to Sentilo
Hi,

I'm not sure why are you trying to obtain the location of the components from Redis...
You could retrieve the component location through the API, using the catalog service: https://sentilo.readthedocs.io/en/latest/api_docs/services/catalog/retrieve_authorized_entities.html
The only thing you have to keep in mind is that when you're creating a component you should provide its location if it's a fixed device. In retunr, if it's a mobile one you must inform its location when publishing the data after creating it.

Hope it helps.

Regards,
Sentilo team.

AUGUSTO HENRIQUE OSTAPECHEN

unread,
Nov 25, 2022, 5:40:45 PM11/25/22
to Sentilo

The application I'm trying to develop it has the follow flow: 

1. A sensor sends the location to sentilo.
2. The sentilo sends to application the new location.
3. The application update the location of the sensor in the map.
4. The flow restarts.

Q: Why I need this, if it's easier make a request to redis?
A: Because I'm trying not to make useless request, so it's nice if the sentilo tells me when a new location has stored, rather the app trying to guess.

But I'm guess that there's no way to make the sentilo works like a webhook

AUGUSTO HENRIQUE OSTAPECHEN

unread,
Nov 30, 2022, 5:11:54 PM11/30/22
to Sentilo

To make it even clearer: My web application needs to track a vehicle in real time. Inside the vehicle is a GPS sensor that periodically sends geographic coordinates to Sentilo over the LoRaWAN network. As far as I know, the coordinates are temporarily stored in REDIS, correct? I want my application to receive a new coordinate as soon as it arrives in REDIS How can I do that?

Sentilo IO

unread,
Dec 1, 2022, 2:17:38 AM12/1/22
to Sentilo
Hi,

The best approach for this use case is to subscribe to the sensor data: https://sentilo.readthedocs.io/en/latest/api_docs/services/subscription/subscription.html

We asume you publish the info using the API service and including its location: https://sentilo.readthedocs.io/en/latest/api_docs/services/data/publish_sensor_data.html
You will need and enpoint for the subscription in your site, a URL where Sentilo will publish the events. 
After that, each data received by the plaform will be published automatically to this URL and, if the location is filled in the original request, it will be included in the message.

Hope it helps...
Regards,
Sentilo Team.
Reply all
Reply to author
Forward
0 new messages