Location [Draft]

Location service #

Service namespace: location

Responsible for reporting location.

Configuration #

Config json schema available on api/v1/device/<dev_id>/service/location/config/schema:

curl -H "X-API-Key: <api key>" \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/service/location/config/schema
Field Type Description
enable bool Enable position retrieval
interval_s int Interval in seconds between retrieving position
timeout_s int Timeout in seconds trying to get position fix
movement object Movement triggered position retrieval
movement.enable bool Enable movement triggered position retrieval

Read config with status:

curl -H "X-IOTREADY-CONFIG-NEXT-GEN: true" -H "X-API-Key: <api key>" \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/service/location/config

Configure interval of 10 minutes:

curl -H "X-API-Key: <api key>" -X PUT \
    -d '{"enable":true,"interval_s":600}' \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/service/location/config/value

Messages #

Event #

Message name: event

Field Type Description
time timestamp UTC time of event
position object Position event
position.longitude string Longitude in decimal degrees
position.latitude string Latitude in decimal degrees
position.altitude int Altitude in meters
position.speed float Speed in km/h
position.numsv int Number of satelites
position.dt int Delta time to fix
position.origin object Origin of request
position.origin.interval object Position retrieval triggered by interval
position.origin.moving object Position retrieval triggered by starting movement
position.origin.stationary object Position retrieval triggered by stopped movement

Read message:

curl -H "X-API-Key: <api key>" \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/service/location/message/event