Modem and Geolocation API¶
The Modem and Geolocation API supports devices implementing subsets of the Modem Protocol where the modem stack may be executed on a LoRa Edge™ chip or on the host MCU.
The Modem and Geolocation API supports the following functionality:
Add devices to, and remove devices from, the device owner account.
List/iterate/count the associated devices.
Get the device information for selected devices, including the history of log messages, uploaded files, and received streaming records.
Request and set attributes for devices, add and clear device requests, and query pending requests.
Forward LoRaWAN® messages transmitted by a device to the Cloud Service, and receive any device state updates. The results return the current state of the device, any file or streaming records completed by the message, and, optionally, a downlink message to be sent by the caller to the device.
Forward GNSS or Wi-Fi scans to the Modem and Geolocation Service and retrieve modem state updates containing the current, calculated positions of the devices.
Device clock synchronization for accurate GNSS positioning and seamless Almanac updates over-the-air for GNSS positioning.
Configure settings such as ports of individual devices or specify default settings.
Convenience functions, such as clearing device logs.
Request limits¶
Certain API endpoints limit request parameters. These limits are currently:
DEVICE_ADD_LIMIT: 256
DEVICE_LIST_LIMIT: 256
DEVICE_INFO_LIMIT: 128
DEVICE_REQUEST_LIMIT: 128
UPLINK_SEND_LIMIT: 128
REQUEST_LIST_LIMIT: 8
Device Management API¶
The basic device management functions allow adding, removing, listing, and moving devices, as well as getting device information. Note that devices are added to the modem management platform implicitly by uplink messages when those messages reference devices that do not already exist.
Add Devices¶
- POST /api/v1/device/add¶
Explicitly registers devices with the account of the caller. Note that devices are automatically provisioned when an uplink is presented to the service and the device specified in the uplink is not yet registered.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one device EUI, and may contain up to DEVICE_ADD_LIMIT.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required, list of device EUIs.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
If successful, the result field of the response points to a mapping of device EUIs to result objects. Each EUI result object carries either a Boolean value or an error. The Boolean value signals whether the device was created during the invocation (True) or existed prior to the invocation (False).
{ DEVEUI: { "error": STRING, // Optional. Per-EUI error "result": BOOLEAN // Optional. True if device has been created } // ... }
Example Request:
POST /api/v1/device/add HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "deveuis": [ "00-00-00-00-00-00-00-01", ... "00-00-00-00-00-00-00-05" ] }
Example Response:
{ "result": { "00-00-00-00-00-00-00-01": { "result": true }, // ... "00-00-00-00-00-00-00-05": { "result": true } } }
Remove Devices¶
- POST /api/v1/device/remove¶
Removes devices from the device owner referenced by the calling token.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain the EUI of at least one device to be removed, and may contain up to DEVICE_ADD_LIMIT EUIs.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required. List of device EUIs.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The request returns a mapping of device EUIs to response objects. If successful, each response object returns a Boolean value in the result field. A value of True indicates the device existed before and was deleted. A value of False indicates that the device did not exist before and still does not exist. If removal of the device failed, an error message is returned in the error field.
Example Request:
POST /api/v1/device/remove HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "deveuis": [ "00-00-00-00-00-00-00-01", ... "00-00-00-00-00-00-00-05" ] }
Example Response:
{ "result": { "00-00-00-00-00-00-00-01": { "result": true } } // ... }
Configure Device Ports¶
- POST /api/v1/device/set¶
Set the device port to protocol mapping for provisioned devices. The parameters dmport, gnssport, gnssngport, wifiport and streamport allow to specify the port on which LoRa Cloud expects the messages of the associated protocol to arrive. Specifying null for a port parameter resets the port to the default port setting of the system. If a port is omitted, that particular port is not updated. This API call should only be invoked after devices have been provisioned and before uplinks from these devices are forwarded.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one device EUI and one port specification.
{ "deveuis": [ DEVEUI, .. ], // Required. List of device EUIs. "dmport": UINT1, // Optional, 1 <= p <= 255: DM port to set, null: reset to default "gnssport": UINT1, // Optional, 1 <= p <= 255: GNSS port to set, null: reset to default "gnssngport": UINT1, // Optional, 1 <= p <= 255: GNSSNG port to set, null: reset to default "wifiport": UINT1, // Optional, 1 <= p <= 255: Wi-Fi port to set, null: reset to default "streamport": UINT1 // Optional, 1 <= p <= 255: STREAM port to set, null: reset to default }
deveuis: Required, list of device EUIs.
dmport: Optional, DM port. If null, the current setting is reset to the system default.
gnssport: Optional, GNSS port. If null, the current setting is reset to the system default.
gnssngport: Optional, GNSSNG port. If null, the current setting is reset to the system default.
wifiport: Optional, Wi-Fi port. If null, the current setting is reset to the system default.
streamport: Optional, stream port. If null, any stream session is reset and the default stream session based on modem messages is re-instantiated.
See Modem Service Protocol Payloads and Device Ports for protocol and port details.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a mapping of EUIs to response objects, where each response object points to a result object (DeviceInfo) or to an error.
Example Request:
POST /api/v1/device/set HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "deveuis": [ "00-00-00-00-00-00-00-01", ... "00-00-00-00-00-00-00-05" ], "dmport": 199, "gnssport": 198, "gnssngport": 192, "wifiport": 197 }
List Devices¶
- POST /api/v1/device/list¶
Lists devices. Returns up to the specified number of device EUIs. It is possible to specify which device EUI should be used as a starting point for the list.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain the field cnt and, optionally, the device EUI to be used as a starting point.
{ "cnt": INT, // Required. Number of EUIs to return, 1<=cnt<=DEVICE_LIST_LIMIT "deveui": STRING // Optional. The device EUI which should be used as a starting point for the list. }
cnt: Required. Number of EUIs to return
deveui: Optional. EUI to be used as the starting point.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
If successful, a list of device EUIs is returned. If there are errors, a list of error messages is returned.
Example Request:
POST /api/v1/device/list HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "cnt": 2, "deveui": "00-00-00-00-00-00-00-01" }
Example Response:
{ "result": [ "00-00-00-00-00-00-00-02" , "00-00-00-00-00-00-00-03" ] }
Count Devices¶
- GET /api/v1/device/count¶
Counts the devices associated with the caller token.
- Request Headers
Authorization – Required. Access token
Request Body:
Any request body is ignored.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
If successful, an integer specifying the number of devices associated with the caller token is returned. If errors are encountered, a list of error messages is returned.
Example Request:
GET /api/v1/device/count HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ }
Example Response:
{ "result": 2 }
Get Device Information¶
- POST /api/v1/device/info¶
Returns the device state for the specified devices.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one EUI.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required. List of device EUIs; may contain up to DEVICE_INFO_LIMIT EUIs.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a mapping of EUIs to response objects, where each response object points to a result object (DeviceInfo) or to an error.
Example Request:
POST /api/v1/device/info HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "deveuis": [ "00-00-00-00-00-00-00-01", "00-00-00-00-00-00-00-02" ] }
Example Response:
{ "result": { "00-00-00-00-00-00-00-01": { "result": { // DeviceInfo ... } // ... } }
Clear Device State¶
- POST /api/v1/device/clear¶
Clears the device state on the server including modem fields and stream and file upload sessions but with the exception of configured ports. Note that this endpoint is typically used only during device development. Otherwise partial session resets take place on “joining” messages of end devices.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one EUI.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required. List of device EUIs;
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a mapping of EUIs to response objects, where each response object points to a result object (DeviceInfo) or to an error.
Example Request:
POST /api/v1/device/clear HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "deveuis": [ "00-00-00-00-00-00-00-01", "00-00-00-00-00-00-00-02" ] }
Example Response:
{ "result": { "00-00-00-00-00-00-00-01": { "result": { // DeviceInfo ... } // ... } }
Iterate and Get Device Information¶
- POST /api/v1/device/list_infos¶
Iterates over all devices and returns device information for each. The invocation returns a map of device EUIs to device state objects. It is up to the caller to filter the returned EUIs for succeeding calls.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain the field cnt and, optionally, a starting device EUI.
{ "cnt": INT, // Required. Number of EUIs to return, 1<=cnt<=DEVICE_LIST_LIMIT "deveui": DEVEUI // Optional. The device EUI which should be used as a starting point for the list. }
cnt: Required. Number of EUIs to return
deveui: Optional. Device EUI to be used as the starting point for the list.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
If successful, the result field points to a list of objects in the following format, where the list is sorted by the deveui field. If errors are encountered, the errors field points to a list of error messages.
[ { "deveui": DEVEUI, // Required. Device EUI. "info": DEVICEINFO // Required. Device information. }. ... ]
deveui: Required. Device EUI.
info: Required. A DeviceInfo object.
Device Communication API¶
These calls relate to the communication with devices, the manipulation of device states, and the signaling of downlink messages.
The most important API calls, /uplink/send
and /device/send
, take uplinks
received by devices, update the internal devices states and return device information
and any completed files, streaming records or resolved positions. /uplink/send
accepts multiple device uplinks in a single request, /device/send
accepts
a single uplink.
Deliver Uplink Messages¶
- POST /api/v1/uplink/send¶
The uplink/send API is the entry point for all uplink messages originating from devices to drive the Modem Service protocols. Messages must be submitted in the order in which they were transmitted by the devices. uplink/send allows to specify messages from multiple devices at once whereas device/send accepts a single uplink message (device/send). Each uplink message may encapsulate a LoRa Cloud Protocol message of a certain type (Format specification). A LoRaWAN transport message for instance is signaled by a field msgtype with value updf and carries LoRaWAN destination port and payload. Each incoming message is validated and the associated protocol performed leading to state transitions of the internal device representation. The responses contains new device state, as well as the following:
The file data, if the uplink message led to the completion of a “file upload” session.
Data stream records, if the uplink message led to the re-assembly of stream records.
The next downlink message required to be transmitted to the device
All pending requests which have been completed with the uplink
Any new log messages issued by actions that occurred during the handling of the uplink
Position solutions resulting from the message payload
The “operation” field which signals whether the message was handled by the Modem Service or not
By default, the application should also submit all other uplinks, irrespective of the port. The advantage of this strategy is twofold:
It informs the Modem Service about application-level downlink opportunities, which the Modem Service can use to schedule modem specific downlinks. This helps to drive the Modem Service protocol with lower latency, resulting in faster response times and higher performance over all.
The metadata supplied to the Modem Service with such an uplink will be updated in the device state and will be made available to the application for further analysis. The payload of messages that do not use relevant ports for the Modem Service may be omitted if the application is intended to preserve data privacy. Additionally, the application does not rely on the most recent payload to be accessible in the device state object.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body contains a mapping from device EUI to UplinkMsg objects.
{ DEVEUI: UPLINK_MSG, .. }
DEVEUI: Required. Valid device EUI.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a mapping of EUIs to response objects.
If successful, each EUI response returns an UplinkResponse object in the result field. If errors were encountered, they are signaled in the error field of the response object.
{ DEVEUI: { "result": UPLINK_RESPONSE, // Uplink response object for this EUI "error": STRING // Error message in case of error }
DEVEUI: Required. A valid device EUI.
result: UplinkResponse instance which details the current device state, and which may also include information such as completed requests, files, stream records, and pending downlink messages.
error: The error message to be displayed if an error is encountered.
Deliver Uplink Message¶
- POST /api/v1/device/send¶
Similar to the uplink/send API endpoint, but accepting a single uplink message of a device. The source device is denoted by the deveui field, the message by the uplink field.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain the deveui and uplink fields.
{ "deveui": DEVEUI, // Required. Source device EUI. "uplink": UPLINK_MSG // Required. .. }
deveui: Required, a valid device EUI.
uplink: Required, UplinkMsg object.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The response adheres to the Base Response Format. If successful, the result field keeps an UplinkResponse object. If errors were encountered, they are signaled in the errors field.
{ "result": UPLINK_RESPONSE, // Uplink response object for this EUI "errors": [ STRING, .. ] // Error messages in case of error }
result: UplinkResponse instance detailing device state including information such as completed requests, files, stream records, and pending downlink messages.
errors: If set and non-empty, error message in case the operation did not succeed.
Add Device Requests¶
- POST /api/v1/requests/add¶
The Modem Service protocol allows a number requests to be triggered which are transmitted by LoRaWAN downlink messages to the device. The Modem Service allows you to queue such requests and manages the interaction between the back end and the device until the request has been fulfilled by the device.
Once a request is queued with the service, the service will generate the corresponding downlink message on each new modem uplink. The caller must schedule the downlink messages on the network server. Upon arrival of the next uplink, the service checks the completion status of pending requests. If any requests remain pending, a new downlink message is generated. If all requests have been completed, requests are cleared. The application must schedule the downlink messages in order, and must not re-transmit downlink messages.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body expects the EUIs of the destination devices and a list of requests. Each request includes the type field, denoting the request type and, optionally, a request-specific parameter.
{ "deveuis": [ DEVEUI, ..], // Required. List of device EUIs, up to DEVICE_REQUEST_LIMIT "requests": [ REQUEST, .. ] // Required. List of request objects, up to REQUEST_LIST_LIMIT }
deveuis: Required. List device EUIs (at least one must be provided). Up to DEVICE_REQUEST_LIMIT EUIs are allowed.
requests: Required. List of ModemRequest objects.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The response contains a mapping of EUIs to response objects.
If successful, each EUI response returns a DeviceInfo object in the result field if the request could be added to the device. The DeviceInfo object encapsulates the state of a device, including any pending requests. If errors were encountered, they are signaled in the error field of the response object.
Set Device Requests¶
- POST /api/v1/requests/set¶
Convenience function. Clears all requests before adding new requests.
- Request Headers
Authorization – Required. Access token
Request Body:
See Add Device Requests.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a map of EUIs to response objects. Each EUI response returns an DeviceInfo object in the result field if the request could be added to the device. The DeviceInfo object encapsulates the state of a device, including any pending requests. If errors were encountered, they are signaled in the error field of the response object.
Clear Device Requests¶
- POST /api/v1/requests/clear¶
Clears all pending requests.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one EUI, and may contain up to DEVICE_REQUEST_LIMIT EUIs.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required. Device EUIs.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
Invoking this API returns a mapping of device EUIs to response objects. Each EUI response includes an DeviceInfo object in the result field if the request could be added to the device. The DeviceInfo object encapsulates the state of a device, including any pending requests. If errors were encountered, they are signaled in the error field of the response object.
Fetch File Uploads¶
- POST /api/v1/uploads/fetch¶
The Modem Service caches the last few file uploads for a device, in case a back-end application may have missed a file response on an uplink request. The fetch call makes it possible to retrieve the file upload history and to clear the history in the device state on the server.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body must contain at least one EUI, and may contain up to DEVICE_REQUEST_LIMIT EUIs.
{ "deveuis": [ DEVEUI, .. ] // Required. List of device EUIs. }
deveuis: Required. List of device EUIs.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
The invocation returns a map of EUIs to response objects. If successful, each EUI response returns an object in the result field with two fields, “info”, a DeviceInfo object, and “files”, an array of FileObject objects.
Device Owner Configuration API¶
These API calls allow you to get and set device specific default settings for a device owner.
Get Device Owner Configuration¶
- GET /api/v1/devowner/config¶
Returns the current Device Owner configuration.
- Request Headers
Authorization – Required. Access token
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
{ "autoprovision": BOOL, // Required. True if device owner allows for devices to be provisioned on 1st uplink. "device_quota": UINT, // Required. 0 unlimited, > 0 the configured device quota. Tier quotas still apply. "device_defaults": { // Specification for defaults for created devices: "dmport": UINT1, // Optional. DM port to set for new devices, or NULL to indicate default system port. "gnssport": UINT1, // Optional. GNSS port to set for new devices, or NULL to indicate default system port. "gnssngport": UINT1, // Optional. GNSSNG port to set for new devices, or NULL to indicate default system port. "wifiport": UINT1, // Optional. Wi-Fi port to set for new devices, or NULL to indicate default system port. "streamport": UINT1 // Optional. Stream port to set for new devices, or NULL to indicate default system port. }
autoprovision: Required. True if the device owner allows for a device being provisioned on the first uplink.
device_quota: Required. Specifies the specific device quota of the device owner. Tier-specific device quotas always apply. Any port specifications must be larger than 0 and less then 256.
device_defaults: Required. Specifies the device ports as configured by the device owner.
See Modem Service Protocol Payloads and Device Ports for protocol and port details.
Update Device Owner Configuration¶
- POST /api/v1/devowner/config¶
Updates the current Device Owner configuration.
- Request Headers
Authorization – Required. Access token
Request Body:
The request body contains the configuration for the device owner.
{ "autoprovision": BOOL, // Optional. True if the device owner allows devices to be provisioned on 1st uplink. "device_quota": INT, // Optional. 0 unlimited, > 0 the device quota (in multiples of 1000) to be configured. Tier quotas still apply. "device_defaults": { // Optional specification for default settings for created devices: "dmport": UINT1, // Optional, DM port to set for new devices, null to reset to default system port "gnssport": UINT1, // Optional, GNSS port to set for new devices, null to reset to default system port "gnssngport": UINT1, // Optional, GNSSNG port to set for new devices, null to reset to default system port "wifiport": UINT1, // Optional, Wi-Fi port to set for new devices, null to reset to default system port "streamport": UINT1 // Optional, STREAM port to set for new devices, null to reset to default system port } }
autoprovision: Optional. True if device owner allows for a device being provisioned on 1st uplink. False if autoprovisioning is not supported.
device_quota: Optional. In case of zero, no quota is set by the device owner (but the upper limit of the tier quota applies). If positive, the quota to be set for the device owner, in thousands (1000s).
device_defaults: Optional. If a port is specified, a UINT1 or null is valid. An UINT1 overwrites the default port, null resets to the default port of the system.
Response:
- Status Codes
200 OK – OK
401 Unauthorized – Authentication failed
- Response Headers
Content-Type – ‘application/json’
Response JSON:
If successful, the result field is empty and no errors are returned.
Example Request:
POST /api/v1/devowner/config HTTP/1.1 Host: mgs.loracloud.com Content-Type: application/json
{ "autoprovision": true, // Enable auto-provisioning "device_quota": 5, // 5000 devices "device_defaults": { "dmport": 199, // Set DM port to 199 "gnssport": null, // Leave GNSS port untouched "gnssngport": null, // Leave GNSSNG port untouched "wifiport": null, // Leave Wi-Fi port untouched "streamport": null // Leave streamport untouched } }
Modem Service JSON Formats¶
Device Info¶
“Device Info” objects encapsulate the current state of a modem as known to the server.
DEVICEINFO = {
"fports": FPORTS, // Current device port settings
"info_fields": INFO_FIELDS, // Current view of modem fields by service
"pending_requests": {
"requests": [ PENDING_REQUEST, .. ] // List of pending requests
},
"log_messages": [ LOG_MESSAGE, .. ], // Service-level messages related to this device
"uploaded_files": [ FILE, .. ], // History of uploaded files
"uploaded_stream_records": [ STREAM, .. ], // History of uploaded records
"last_uplink": UPLINK_MSG // Most-recently handled uplink
}
fports: Required. Current DevicePorts settings.
info_fields: Required. List of InfoFields objects
pending_requests: Required. List of PendingRequest objects
log_messages: Required. List of log messages, LogMessage
uploaded_files: Required. History of uploaded files, FileObject
uploaded_stream_records: Required. History of uploaded records, StreamObject
last_uplink: Required. Last uplink, UplinkMsg
Uplink Response¶
UPLINK_RESPONSE = {
"operation": null | STRING, // Signals type of performed operation
"file": null | FILE, // Optional. Received file
"stream_records": null | [ STREAM, .. ], // Optional. Received stream records
"position_solution": null | POSITION_SOLUTION, // Optional. Solution of position calculation
"fulfilled_requests": null | [ PENDING_REQUEST, .. ], // Optional. Fulfilled requests
"dnlink": null | LORA_DNLINK // Optional. Downlink to issue
"fports": FPORTS, // Current device port settings
"info_fields": INFO_FIELDS // The updated device info fields
"pending_requests": {
"requests": [ PENDING_REQUEST, .. ] // List of pending requests
},
"log_messages": [ LOG_MESSAGE, ..] // Log messages generated during processing
}
An “Uplink Response” object reflects the current device state as well as new items resulting from the submitted uplink message. In addition to the info_fields and log_messages fields of the “DeviceInfo” object (DeviceInfo) it contains fields which signal the following state changes and completed items that are due to an uplink message:
operation: Required, one of “gnss”, “wifi”, “modem”, “other”. In case of “other”, the message is application specific and can be forwarded to the application. In case of “modem”, “gnss” and “wifi” the message may not be handled by the application.
file: Optional. FileObject. Contains the data of a file upload if the uplink message led to the completion of a file upload session.
stream_records: Optional. StreamUpdate. Contains a data stream update entry which signals re-assembled stream records. The array might be empty.
position_solution: Optional. PositionSolution. Contains the solution of a valid position calculation.
fulfilled_requests: Optional. List of PendingRequest objects. Contains all pending requests which have been completed by this uplink.
dnlink: Optional. LoRaDnlink. If set, the downlink which has to be scheduled with the network server.
fports: Required. Current DevicePorts settings.
info_fields: Required. List of InfoFields objects
pending_requests: Required. List of PendingRequest objects
log_messages: Required. List of log messages, LogMessage
INFO_FIELDS¶
This object contains the value of the various information fields and the timestamp of the last update.
INFO_FIELDS = {
"status": null | { "timestamp": FLOAT, "value": STATUS_FIELD },
"charge": null | { "timestamp": FLOAT, "value": UINT2 },
"voltage": null | { "timestamp": FLOAT, "value": FLOAT },
"temp": null | { "timestamp": FLOAT, "value": INT },
"signal": null | { "timestamp": FLOAT, "value": { "rssi": INT, "snr": FLOAT }},
"uptime": null | { "timestamp": FLOAT, "value": UINT2 },
"rxtime": null | { "timestamp": FLOAT, "value": UINT2 },
"firmware": null | { "timestamp": FLOAT, "value": { "fwcrc": HEX, "fwtotal": UINT2, "fwcompleted": UINT2 }},
"adrmode": null | { "timestamp": FLOAT, "value": ADRMODE }, // encoding see REQUEST
"joineui": null | { "timestamp": FLOAT, "value": DEVEUI },
"interval": null | { "timestamp": FLOAT, "value": REPINTV }, // encoding see REQUEST
"region": null | { "timestamp": FLOAT, "value": UINT1 }, // according to device manual
"crashlog": null | { "timestamp": FLOAT, "value": STRING },
"rstcount": null | { "timestamp": FLOAT, "value": UINT2 },
"deveui": null | { "timestamp": FLOAT, "value": DEVEUI },
"rfu": null | { "timestamp": FLOAT, "value": UINT2 }, // Reserved for future use
"session": null | { "timestamp": FLOAT, "value": UINT2 },
"chipeui": null | { "timestamp": FLOAT, "value": DEVEUI }
"streampar":null | { "timestamp": FLOAT, "value": STREAMPAR }.
"appstatus":null | { "timestamp": FLOAT, "value": HEX }.
"alcsync": null | { "timestamp": FLOAT, "value": ALCSYNC_FIELD }.
}
STATUS_FIELD = {
"brownout": BOOL,
"crash": BOOL,
"mute": BOOL,
"joined": BOOL,
"suspend": BOOL,
"upload": BOOL,
}
STREAMPAR = {
"port": UINT1,
"encmode": BOOL
}
ALCSYNC_FIELD = {
"token": UINT1, // Token, selected by modem
"time": UINT4 // Time reported by modem for time correction
}
timestamp: Required. Float. UTC timestamp.
Modem Request¶
This object encapsulates a modem request. Each request contains a field, type, denoting the request type and, optionally, a request-specific parameter.
REQUEST = {
"type": STRING, // Required. Request type.
"param": ANY, // Optional. Request specific parameter.
}
RESET_REQUEST = {
"type": "RESET", // RESET request
"param": UINT1 // 0x1, 0x2 or 0x3
}
REJOIN_REQUEST = {
"type": "REJOIN" // REJOIN request
}
MUTE_REQUEST = {
"type": "MUTE" // MUTE request
"param": UINT1 // Mute parameter
}
GETINFO_REQUEST = {
"type": "GETINFO", // GETINFO request
"param": [ FIELD, ..] // Required. List of field names given below
}
FIELD = [ "status", "charge", "voltage", "temp", "signal", "uptime",
"rxtime", "firmware", "adrmode", "joineui", "interval", "region",
"crashlog", "rstcount", "deveui", "session", "chipeui" ]
SETCONF_REQUEST = {
"type": "SETCONF", // SETCONF request
"param": { // Required. Map of SETCONF type to value
"adrmode": ADRMODE, // Optional. ADR mode
"joineui": JOINEUI, // Optional. EUI
"interval": REPINTV, // Optional. Reporting interval
"region": UINT1, // Optional. Regulatory region (according to device manual)
}
}
ADRMODE: UINT1
0x00: LNS controlled
0x01: Mobile Long Range
0x02: Mobile Low Power
REPINTV: UINT1
Bits 7-6: unit (sec=0x00, day=0x01, hour=0x10, min=0x11)
Bits 5-0: value (0-63)
FILEDONE_REQUEST = {
"type": "FILEDONE", // FILEDONE request
"param": {
"sid": INT, // Required. File session id
"sctr": INT, // Required. File counter
}
}
Pending Request¶
This object encapsulates a pending request.
PENDING_REQUEST = {
"id": INT, // Request ID
"cookie": ANY, // Value for request completion check
"timestamp": FLOAT, // Timestamp, UTC, of request generation
"request" : REQUEST // The request as generated by caller
}
id: Required. Integer. Request ID.
cookie: Required. Internal value for request-completion check.
timestamp: Required. Float. UTC timestamp.
request: Required. The associated ModemRequest.
STREAM Update¶
This lists both the signals and the fully-assembled streaming records that are received by the decoder. Each entry denotes an assembled packet with application data and record offset.
If some of the fragments of a stream record are lost during transmission, they will be reconstructed based on the following fragments. This may result in records being delivered to the application in a different order than sent by the device. The application can use the stream offset of each reconstructed record to re-establish the order.
[
[ UINT, // Required. Stream offset of the record
HEX // Required. HEX string, Stream record data
],
..
]
Position Solution¶
A Position Solution object contains the position solution calculated from GNSS or Wi-Fi observations.
The algorithm_type
field distinguishes between the two cases:
gnss: The Position Solution object is a GNSS position solution
POSITION_SOLUTION_GNSS
gnssng: The Position Solution object is a GNSS-NG position solution
POSITION_SOLUTION_GNSSNG
wifi: The Position Solution object is a Wi-Fi position solution
POSITION_SOLUTION_WIFI
POSITION_SOLUTION = POSITION_SOLUTION_GNSS | POSITION_SOLUTION_GNSSNG | POSITION_SOLUTION_WIFI
POSITION_SOLUTION_GNSS = {
"algorithm_type": "gnss", // Required.
"ecef": [FLOAT, FLOAT, FLOAT], // Required. Calculated position in ECEF coordinates [m, m, m]
"llh": [FLOAT, FLOAT, FLOAT], // Required. Calculated position in WGS84 llh coordinates [deg, deg, m]
"capture_time_gps": FLOAT, // Required. Calculated capture time in seconds GPST
"gdop": FLOAT, // Required. Geometric Dilution of Precision
"accuracy": FLOAT, // Required. Estimate of calculated position accuracy in meters
"timestamp": FLOAT // Required. Uplink message timestamp corresponding to position solution
}
ecef: Required. Calculated position in Earth-centered, fixed Cartesian coordinates in meters [X,Y,Z].
llh: Required. Calculated position in WGS84 latitude [deg], longitude [deg], altitude above reference ellipsoid [m].
capture_time_gps: Required. Calculated capture time in seconds GPST.
gdop: Required. Geometric Dilution of Precision in meters.
accuracy: Required. Estimate of calculated position accuracy. Values >0.0 are in meters. Value 0.0 means an accuracy estimate is not available.
timestamp: Required. Uplink message timestamp corresponding to position solution.
POSITION_SOLUTION_GNSSNG = {
"algorithm_type": "gnssng", // Required.
"ecef": [FLOAT, FLOAT, FLOAT], // Required. Calculated position in ECEF coordinates [m, m, m]
"llh": [FLOAT, FLOAT, FLOAT], // Required. Calculated position in WGS84 llh coordinates [deg, deg, m]
"capture_time_gps": FLOAT, // Required. Calculated capture time in seconds GPST
"capture_times_gps": [FLOAT|null, .. ], // Required. Calculated capture time in seconds GPST
"gdop": FLOAT, // Required. Geometric Dilution of Precision
"accuracy": FLOAT, // Required. Estimate of calculated position accuracy in meters
"timestamp": FLOAT // Required. Uplink message timestamp corresponding to position solution
}
The fields are identical to the POSITION_SOLUTION_GNSS object except for the additional field capture_times_gps.
capture_times_gps: Required. Calculated capture time of the most recent scan of the group which was considered in the solution calculation. In seconds GPST.
POSITION_SOLUTION_WIFI = {
"algorithm_type": "wifi" // Required.
"llh": [FLOAT, FLOAT, FLOAT], // Required. Calculated position in WGS84 llh coordinates [deg, deg, m]
"timestamp": FLOAT // Required. Uplink message timestamp corresponding to position solution
}
llh: Required. Calculated position in WGS84 latitude [deg], longitude [deg], altitude above reference ellipsoid [m]
timestamp: Required. Uplink message timestamp corresponding to position solution
Uplink Message¶
An Uplink_Msg object encapsulates the LoRa Cloud Protocol message sent by the device. It might have different types,
distinguished by the msgtype
field, namely:
updf: This is the default message type which is used to submit LoRaWAN messages. Based on the port, the execution of the corresponding protocol (including modem protocol Modem Protocol) is triggered.
joining: Joining / Session reset event message (msgtype:joining).
The updf message type expects valid LoRaWAN transport parameters (particularly port and fcnt) to be present for every supported protocol message. In case port and fcnt are not available (e.g. when non-LoRaWAN transport is used), the following geolocation message types are supported:
gnss: LoRa Edge GNSS positioning protocol messages over non-LoRaWAN transport (msgtype:gnss).
gnssng: LoRa Edge GNSS-NG (NAV-Group) positioning protocol messages over non-LoRaWAN transport (msgtype:gnssng).
wifi: LoRa Edge Wi-Fi positioning protocol message over non-LoRaWAN transport (msgtype:wifi).
UPLINK_MSG = MSG_JOINING | MSG_UPDF | MSG_GNSS | MSG_GNSSNG | MSG_WIFI
Whenever the msgtype
field is omitted, the default message type is updf.
Note
Further guidance on which msgtype to use in particular scenarios can be found in the Section ProtoMgmt.
msgtype:joining¶
The Modem Service protocol is a session-aware protocol. In LoRaWAN, a session reset corresponds to an OTAA join or re-join event. The joining message type shall be used to signal such session reset events.
MSG_JOINING = {
"msgtype": "joining" // Required.
"timestamp": FLOAT, // Optional. RX timestamp in seconds UTC
"dr": UINT1, // Optional. Data rate
"freq": UINT4, // Optional. Frequency
}
msgtype:updf¶
The updf message type is used to submit any LoRaWAN uplink message.
For updf messages with port
set to one of the configured protocol ports (modem, wifi, gnss,
gnssng, stream - see Configure Device Ports) the corresponding message type is inferred and the associated protocol performed.
An updf message may contain fields which are only evaluated by specific protocols and are ignored
by others. The port
and payload
fields can be omitted when submitting generic uplink events which
provide downlink opportunities for protocols specific to the Modem & Geolocation Services.
MSG_UPDF = {
"msgtype": "updf", // Optional. 'updf' is implied if not present
"fcnt": UINT4, // Required. Frame counter
"port": UINT1, // Optional. Port
"payload": HEX, // Optional. HEX string with LoRaWAN message payload
"dr": UINT1, // Optional. Data rate.
"freq": UINT4, // Optional. Frequency
"timestamp": FLOAT // Optional. RX timestamp in seconds, UTC
"dn_mtu": UINT4, // Optional. Downlink MTU
"gnss_capture_time": FLOAT, // Optional. Capture time estimate, GPST
"gnss_capture_time_accuracy": FLOAT, // Optional. Capture time accuracy, seconds
"gnss_assist_position": [FLOAT, FLOAT], // Optional. Assistance position WGS84, (latitude, longitude) [deg]
"gnss_assist_altitude": FLOAT, // Optional. Assistance altitude, (meters above WGS84 reference ellipsoid) [m]
"gnss_use_2D_solver": BOOL // Optional. True if the value gnss_assist_altitude is considered a precise altitude value. A fixed-altitude 2D fix is performed.
}
Description of generic uplink message fields:
fcnt: Required. 32-bit LoRaWAN frame counter for this message.
port: Optional. LoRaWAN message port.
payload: Optional. LoRaWAN message payload. Required if the uplink port is a configured protocol port.
dr: Optional. LoRaWAN data rate (0<=dr<=12).
freq: Optional. Frequency in Hz.
timestamp: Optional. RX timestamp in seconds, UTC. If omitted, the API request time is used.
dn_mtu: Optional. Maximum transmission unit for the downlink path, in bytes.
gnss_…: Optional fields only evaluated in case of gnss or gnssng protocol messages (msgtype:gnss/gnssng).
msgtype:gnss/gnssng¶
The message type gnss
signals LoRa Edge GNSS Positioning Messages conforming to the LoRa Edge GNSS positioning protocol. The
message type gnssng
signals LoRa Edge GNSS Positioning Messages conforming to
the LoRa Edge GNSS-NG (NAV-Group) positioning protocol.
Additional parameters provide means to control the position calculation in case a protocol
message triggers a position calculation.
MSG_GNSS = {
"msgtype": "gnss"|"gnssng",// Required.
"payload": HEX, // Required. HEX string with valid LoRa Edge GNSS positioning protocol payload
"dn_mtu": UINT4, // Optional. Downlink MTU
"timestamp": FLOAT, // Optional. RX timestamp in seconds UTC
"gnss_capture_time": FLOAT, // Optional. Capture time estimate, GPST
"gnss_capture_time_accuracy": FLOAT, // Optional. Capture time accuracy, in seconds
"gnss_assist_position": [FLOAT, FLOAT], // Optional. Assistance position WGS84, (latitude, longitude) [deg]
"gnss_assist_altitude": FLOAT, // Optional. Assistance altitude, (meters above WGS84 reference ellipsoid) [m]
"gnss_use_2D_solver": BOOL // Optional. True if the value gnss_assist_altitude is considered a precise altitude value. A fixed-altitude 2D fix is performed.
}
Description of the fields:
payload: Required. HEX string with valid LoRa Edge GNSS positioning protocol/LoRa Edge GNSS-NG (NAV-Group) positioning protocol payload
dn_mtu: Optional. Maximum transmission unit for the downlink path in bytes.
timestamp: Optional. Timestamp, in seconds UTC. If unspecified, current time on server.
gnss_capture_time: Optional. An estimate of the time when the GNSS observation has been taken, in seconds GPST. If no gnss_capture_time is given, timestamp is used as an initial estimate for the capture time.
gnss_capture_time_accuracy: Optional. Capture-time estimate accuracy, in seconds. This value is used to check the plausibility of the position solution. Position solutions, where the calculated capture time deviates from the estimated capture time by more than gnss_capture_time_accuracy, will be rejected. If no value for gnss_capture_time is given, gnss_capture_time_accuracy applies to the uplink timestamp. If this value is below 16, the capture time encoded in the binary payload is ignored and gnss_capture_time is used as the initial estimate for the iterative position solver. Default value: 300 seconds.
gnss_assist_position: Optional. Assistance position as latitude and longitude coordinates in degrees inside the WGS84 reference frame. In case payload is a U-GNSSLOC-NAV message, this position is used as a starting point for the iterative position solver. In case payload is a U-GNSSLOC-REQAID message, this position is used to generate the aiding position downlink and is hence required in that case. Examples:
[55.341414, 11.030974]
,[37.819222, -122.478521]
,[-33.852482, 151.210686]
gnss_assist_altitude: Optional, Precise altitude of the device at capture time, in meters above the WGS84 reference ellipsoid. Required if gnss_use_2D_solver is True.
gnss_use_2D_solver: If True, the value of gnss_assist_altitude is used as a fixed solution coordinate, reducing the required positioning algorithm to a 2D solution problem. gnss_assist_altitude should have an accuracy of 10 meters or better. Otherwise, the position solution quality is degraded.
Note
Timestamps in GPS time (GPST) are seconds passed since 00:00 UTC (midnight) of January 5th to 6th 1980, without leap seconds.
msgtype:wifi¶
LoRa Edge Wi-Fi positioning protocol messages directed at the Wi-Fi Location Solver shall be passed with msgtype
set to wifi.
MSG_WIFI = {
"msgtype": "wifi", // Required.
"payload": HEX, // Required. HEX string with valid LoRa Edge Wi-Fi positioning protocol payload
"timestamp": FLOAT, // Optional. RX timestamp in seconds UTC
}
Description of the fields:
payload: Required. HEX string with valid LoRa Edge Wi-Fi positioning protocol payload. Must contain at least two MAC addresses.
timestamp: Optional. Timestamp associated to the position solution, in seconds UTC. If unspecified, current time on server.
Downlink Message¶
A LoRa_Downlink specification for a modem device.
LORA_DNLINK = {
"port": UINT1, // Required. 0: undefined, >0: LoRaWAN FPort
"payload": HEX, // Required. HEX string with valid modem payload
}
FILE Object¶
A FILE object carries the contents of a file uploaded and de-fragmented by a modem to the service.
FILE = {
"sctr": UINT1, // Required. File counter.
"timestamp": FLOAT, // Required. UTC timestamp of the last message having led to a fully de-fragmented file
"port": UINT1, // Required. Target port for uploaded files; may be null on error
"data": HEX, // Required. Contents of an uploaded file; may be null on error
"hash": HEX, // Required. SHA256 short hash over plain data (8/4 bytes for plain/encrypted upload); may be null on error
"encmode": BOOL, // Required. File encrypted; may be null on error
"message": STRING, // Optional. May contain a log message of the service
}
STREAM Object¶
A fully-assembled record of the streaming session, stored in the stream record history along with the device state.
STREAM = {
"timestamp": FLOAT, // Required. UTC timestamp of the last message having led to a fully de-fragmented stream record
"port": UINT1, // Required. Target port for the uploaded stream
"data": HEX, // Required. Contents of the stream record
"off": UINT2 // Required. Application record counter (byte offset)
}
Log Message¶
A log message associated with a device.
LOG_MESSAGE = {
"logmsg": STRING, // Required. Log message
"level": STRING, // Required. "WARNING", "INFO" or "ERROR
"timestamp": FLOAT // Required. Timestamp, UTC, Float
}
Device Ports¶
The configured port settings for a device.
FPORTS = {
"dmport": UINT1, // Configured or default port for Modem messages
"gnssport": UINT1, // Configured or default port for GNSS messages
"gnssngport": UINT1, // Configured or default port for GNSSNG messages
"wifiport": UINT1, // Configured or default port for Wi-Fi messages
"streamport": UINT1 // Configured or default port for Stream messages
}
Note that streamport and dmport are the same by default as the DM port implicitly allows for a stream session tunneled through DM messages. If the streamport is explicitly set for a device, the Modem Service opens a stream session for the specified port and closes any existing session.
The default ports for devices are 199 for the DM port, 198 for the GNSS port, 197 for the Wi-Fi port and 192 for the GNSSNG port (Modem Service Protocol Payloads). The default port for Stream messages is the DM port where the DM protocol allows to stream records by using the tag U-APPSTREAMDATA (Modem Service Protocol Payloads). It is only necessary to configure the stream port explicitly when the device sends records on a port different from the DM port and without relying on the DM protocol for the stream.
The DM, GNSS, GNSSNG, Wi-Fi and stream ports must differ from each other in a device configuration. In general, LoRa Cloud does not support the multiplexing of different protocols over a single port besides the DM protocol allowing for embedding GNSS, Wi-Fi or stream records in tagged DM messages (Modem Service Protocol Payloads).
Modem Service Protocol Management¶
At the heart of the Modem Service is the exchange of protocol messages with the end device. Four protocols are defined which provide the device to cloud functionality available in LoRa Cloud MGS.
Note
More details on the specific protocols, their functions and defintions is available in Section Modem Service Protocol Payloads.
The main entry point for the protocol message exchange is the */device/send API (alternatively
the */uplink/send API for batch uplink delivery). The message payload is encapsulated
in the UplinkMsg API object where the port
and msgtype
fields are used to specify the protocol to which the delivered
payload belongs.
Almost all use cases of the protocols can be split into the following Scenarios.
Scenario 1: Modem Protocol over LoRaWAN
Scenario 2: LoRa Edge GNSS/GNSSNG/Wi-Fi positioning protocols over LoRaWAN
Scenario 3: LoRa Edge GNSS/GNSSNG/Wi-Fi positioning protocols transport agnostic
Scenario 1: Modem Protocol over LoRaWAN¶
The modem port is configurable in the modem firmware. The device configuration in LoRa Cloud has to be in sync with the configured modem port on device. If the device modem port configuration deviates from the default value, the modem port has to be set for the corresponding device in LoRa Cloud MGS using the */device/set API or globally for all newly created devices of a Device Owner using the */devowner/config API. The modem port is typically not changed during the device lifetime, so the configuration must be set just once.
Assuming a proper configuration of the modem port, the Application Backend logic is just expected to forward the payloads
of that port to LoRa Cloud MGS in msgtype:updf
uplink messages.
This scenario is suitable for all LoRa Basics Modem based devices. LoRaWAN is the implied transport layer for this protocol.
Scenario 2: LoRa Edge GNSS/GNSSNG/Wi-Fi positioning protocols over LoRaWAN¶
When LoRa Edge GNSS/GNSSNG/Wi-Fi positioning protocol messages are exchanged directly over LoRaWAN, the message exchange is very similar to the Modem Protocol described above. The application firmware on device assembles the protocol messages according to the definition in Section Modem Service Protocol Payloads using geolocation messages from a LoRa Edge chip’s SPI interface. The corresponding GNSS, GNSSNG and Wi-Fi ports in LoRa Cloud MGS have to be configured in sync with the device’s application firmware.
With proper configuration of the GNSS, GNSSNG and Wi-Fi ports, the Application Backend logic is just expected to forward the
payloads of these ports to LoRa Cloud MGS using msgtype:updf
and port:GNSS_PORT
/ port:GNSSNG_PORT
/ port:WIFI_PORT
. The downlinks of these protocols will be scheduled on
the respective ports, as well.
Note
The flow-chart depicts only the GNSS positioning protocol for conciseness. The same flow applies for the GNSSNG and Wi-Fi positioning protocol as well
Scenario 3: LoRa Edge GNSS/GNSSNG/Wi-Fi positioning protocols transport agnostic¶
The third scenario makes no assumption about the underlying transport layer with the drawback of more complex message handling in the Application Backend logic. This could be necessary in situations where
the GNSS/GNSSNG/Wi-Fi payloads are sent over a non-LoRaWAN link (e.g. LoRa, BLE, Sigfox, etc), or
the GNSS/GNSSNG/Wi-Fi payloads are encoded in an application specific way, or
the GNSS/GNSSNG/Wi-Fi payloads are sent over one of the Advanced Transport Services of the LoRa Basics Modem.
The Application Backend Logic has to extract the GNSS/Wi-Fi payloads from an application specific message (or set of
messages). The GNSS/GNSSNG/Wi-Fi payload has to be submitted with msgtype:gnss(ng)
/msgtype:wifi
in this case.
Conversely, the downlinks of the GNSS/GNSSNG/Wi-Fi position protocol has to be encoded according to the application
specific message definition.
Note
Note that port:0
in the downlink indicates the absence of any specific port. This field must be ignored.
In LoRaWAN, downlinks must not be sent on FPort 0.
Modem Service Protocol Payloads¶
The four protocols supported by Modem Service are distinguished by the msgtype field and/or the port.
The following default port-protocol-mapping applies unless otherwise configured via Configure Device Ports:
msgtype
Protocols
Default Port
updf
199
updf
198
updf
192
updf
197
The following msgtype-protocol-mapping applies for non-LoRaWAN transports:
msgtype
Protocols
gnss
gnssng
wifi
Modem Protocol¶
The modem messages are exchanged between a modem and Modem Service over the configured modem port. These messages are sent and processed directly by the modem. Applications control the modem functionality via the modem device API and the LoRa Cloud API and are not required to inspect messages to use of the modem management features.
LoRa Edge GNSS positioning protocol¶
The LoRa Edge GNSS positioning messages consist of a single tag-value pair per message in uplink and downlink direction. Their purpose is to deliver GNSS scan results to the geolocation solver and communicate aiding information adjustments back to the device.
LoRa Edge GNSS positioning uplink messages are generated directly by a LoRa Edge chip and can be retrieved using the GNSSReadResults command (See the LoRa Edge User Manuals for more details).
Note
The response to the LoRa Edge chip’s GNSSReadResults SPI command starts with a destination byte.
For successful GNSS scans, the destination byte is always 0x01
.
This destination byte is not part of the GNSS positioning message and must be removed before transmitting the message.
Uplink Message:
Downlink Message:
The following tag-value pairs are defined:
Direction |
Tag |
Value |
Value length |
Description |
---|---|---|---|---|
Uplink |
0x00 |
0 bytes |
Aiding position request |
|
Uplink |
>0x00 1 |
variable |
Navigation message (NAV1/NAV2/NAV3) |
|
Downlink |
0x00 |
3 bytes |
Aiding position update |
- 1
LoRa Edge GNSS positioning protocol uplink messages with non-zero tag byte are Navigation messages.
U-GNSSLOC-REQAID - 0x00: Aiding position request
The value of the REQAID message is empty.
All LoRa Edge GNSS positioning protocol uplink messages with non-zero tag byte are Navigation messages (NAV messages). They carry the signal measurements which are necessary to compute a position solution. Navigation messages come in three versions, NAV1, NAV2, and NAV3, depending on the microcode version which runs on LoRa Edge chipset.
Description of the fields:
- TAG
A NAV-internal tag byte. Depends on the internal structure of the NAV message. Non-zero.
- GNSS_SCAN_RES
GNSS scan result containing GNSS signal measurements.
D-GNSSLOC-AIDP - 0x00: Aiding position update
Description of the fields:
- POS
An estimate of the device’s position encoded in WGS84 latitude/longitude coordinates.
Description of the fields:
- LAT = LAT_LSB | (LAT_MSB << 8)
WGS84 latitude coordinate of the aiding position. Type:
int12
, unit:180/2^12 deg
- LON = LON_LBS | (LON_MSB << 4)
WGS84 longitude coordinate of the aiding position. Type:
int12
, unit:360/2^12 deg
Examples:
Min Value:
POS='000880': LAT = -2048*180/2**12 [-90.000 deg], LON = -2048*360/2**12 [-180.000 deg]
Max Value:
POS='fff77f': LAT = 2047*180/2**12 [ 89.9560 deg], LON = 2047*360/2**12 [ 179.912 deg]
LoRa Edge Wi-Fi positioning protocol¶
The Wi-Fi positioning protocol messages consist of a single tag-value pair per message in uplink direction. Downlinks are not defined for this protocol.
The following tag-value pairs are defined:
Direction |
Tag |
Value |
Value Length |
Description |
---|---|---|---|---|
Uplink |
|
N*6 bytes |
Wi-Fi AP list |
|
Uplink |
|
N*7 bytes |
Wi-Fi AP list with RSSI |
N: Number of scanned APs
U-WIFILOC-MAC - 0x00: Wi-Fi AP MAC List
Description of the fields:
- MAC
MAC address of scanned AP. See MAC Address Encoding.
U-WIFILOC-MACRSSI - 0x01: Wi-Fi AP MAC List with RSSI
Description of the fields:
- RSSI
RSSI associated to AP in dB. 8-bit signed integer.
- MAC
MAC address of scanned AP. See MAC Address Encoding.
MAC Address Encoding
A 48-bit MAC address denoted as M6:M5:M4:M3:M2:M1
is encoded in:
where
- M6
Most significant byte of MAC address.
- M1
Least significant byte of MAC address.