Skills are instructions for AI agents and step-by-step guides for people, for the tasks on this page. Give a skill's SKILL.md to your agent. The Skills page has all skills to download.
Select the Loriot connection, application, and device protocol, register a LoRa device on the Loriot network server, send a downlink command, and move the device to another Loriot application.
Select the device protocol, device profile, and connectivity plan, provision a LoRa device on Actility ThingPark, send a downlink command to it, and deprovision it.
This section details the mechanisms for integrating non-IP devices. Cumulocity provides native connectors for major LPWAN connectivity providers including Loriot, Actility. These connectors abstract the vendor-specific APIs required for device provisioning and data retrieval.
This section documents the configuration and operation of the LPWAN agent, which performs the following core functions:
Ingestion - Receives uplink messages from Loriot or Actility (ThingPark) backends.
Normalization - Decouples the connectivity provider from the device logic, allowing devices to be managed using standard Cumulocity interfaces.
Translation - Routes binary payloads through user-defined device protocols to extract measurements, events, and alarms.
Downlink management - Queues and forwards commands to the Network Server APIs for transmission to the device.
Loriot LoRa
Introduction
Cumulocity can interface with the Loriot Network Server through the Loriot agent microservice. You can:
Register the device in two ways:
Create a Loriot LNS connection and register the device using Cumulocity.
Configure the Loriot agent endpoint via Loriot Network Server and register the device via uplink message. In order to be able to send downlink messages, the devices created using this method must be re-registered via Cumulocity to be associated with a connection and device type.
Assign a device protocol for the LoRa device for payload processing.
Decode upstream payload packets using a web-based user interface.
Post-process raw device data through Cumulocity events.
Make use of existing Cumulocity features with LoRa devices, for example: connectivity monitoring, device management, data visualization with dashboards, real-time analytics and more.
The following illustration gives an overview of the Cumulocity Loriot LoRa integration.
Info
Your subscription must include this feature to be able to use it. If you do not see the functionality described in this document please contact product support.
Device registration via uplink message
Before using LoRa devices with Cumulocity, you must configure the Cumulocity Loriot agent endpoint details in Loriot Network Server.
Configuring the Loriot endpoint using basic authentication
In Loriot Network Server you can create multiple applications. Each application allows you to configure LoRa devices.
To specify the Loriot agent endpoint with user credentials, navigate to one of the applications in your Loriot Network Server account and select Output in the Application menu in the navigator.
Loriot Network Server forwards the LoRa device messages to the external applications using different connectors which are available in the Output section.
Use Cumulocity data forwarder for configuring the Loriot endpoint using basic authentication.
Info
In order to send an uplink request, the user configured in the Loriot Network Server must have ADMIN permission for the “Loriot” permission type in Cumulocity.
For details, see Assigning ADMIN permission for the Loriot.
Always keep the Gateway Information option enabled because the Loriot agent only processes “gw” (gateway information) messages.
The Loriot devices can now be registered in Cumulocity when uplink messages are received.
Device creation via Loriot uplink message
While processing the Loriot LoRa device request, the Loriot agent automatically creates the device in the Cumulocity platform, if it does not yet exist.
This means that you do not have to register the Loriot LoRa device explicitly.
The Loriot Network Server forwards two types of messages to the Loriot agent: “rx” (uplink message) and “gw” (gateway information).
The Loriot LoRa agent only processes “gw” messages to avoid duplicate measurements or events in Cumulocity, because most of the information matches with “gw” message whereas “gw” message also carries all gateway information.
Info
You must enable the “gw” message option on the Loriot Network Server while connecting to the Loriot LoRa agent, see Device registration via Cumulocity.
In the Loriot LoRa device message below, gws represents a list of gateways involved in the network:
The Loriot LoRa agent picks gw with the oldest timestamp for processing.
The Loriot LoRa agent maps the rssi value to the standard Cumulocity SignalStrength object and updates the device managed object with the lat and lon values.
In order to be able to send downlink operations, the devices registered via uplink message must be re-registered using Cumulocity (see Device registration via Cumulocity), to be associated with a connection and a device type.
Device registration via the Cumulocity platform
Creating a Loriot LNS connection in Cumulocity
Before using LoRa devices with Cumulocity, you must configure the Cumulocity Loriot agent endpoint details in the Administration application. Click the Connectivity tab in the Settings menu to create, edit, delete or update multiple Loriot connections.
To add a new connection
When you select Connectivity for the first time, you are asked to create a connection. Click Add Connection.
Enter the following information:
Name - the name of the Loriot connection being created
Base URL - the URL associated with the Loriot provider account
Username - your Loriot account username
Password - your Loriot account password
Click Save. If the information you have entered is correct, the message “Connection created” appears.
To add another connection, click Add Connection and follow the steps above.
Info
Always keep the Gateway Information option enabled because the Loriot agent only processes “gw” (gateway information) messages.
To update a connection
Select the connection to be updated, make your edits, and save the connection.
If there are devices associated with the connection, an error message appears, stating “Can not update the LNS Connection with <name of LNS Connection> as it’s associated with <number of devices>. Click the link to download the file with the details of the associated devices: /service/<agent-context-path>/lns-connection/<lns-connection-name>/device”.
To delete a connection
Select the connection to be deleted and click Delete.
If there are devices associated with the connection, an error message appears, stating “Can not delete the LNS Connection with <name of LNS Connection> as it’s associated with <number of devices>. Click the link to download the file with the details of the associated devices: /service/<agent-context-path>/lns-connection/<lns-connection-name>/device”.
Info
To create, update, or delete LNS connections, you must have the Loriot ADMIN permission assigned to your user. To view the LNS connections, the Loriot READ permission is sufficient.
Loriot device registration
To register a Loriot device in Cumulocity navigate to Devices > Registration in the Device Management application, click Register device at the top right and select Single device registration > Loriot LoRa from the dropdown.
Requirements
To register a device, you need WRITE or ADMIN permission for the “Inventory” permission type, or ADMIN permission for the “Loriot” permission type.
Info
If Loriot is not one of the available options, your tenant is not subscribed to the relevant applications, see information at the top.
In the next window, fill in the required information:
Title - title of the device to be registered.
Device EUI - this is the unique identifier for the device. It is a 16 character (8 byte) long hexadecimal number. You can find it on the device itself.
Application EUI - this is a global application ID in the IEEE EUI64 address space that uniquely identifies the application provider of the device. It is a 16 character (8 byte) long hexadecimal number.
Application key - this is an AES-128 application key specific for the device that is assigned to the device by the application owner and is responsible to encrypt. The application key is a 32 character (16 byte) long hexadecimal number.
Connection - lists all configured Loriot connections in the tenant. The Application name option (see below) is populated based on the selected Loriot connection.
Application name - select the appropriate application name under which the device must be registered in the Loriot provider.
Device protocol - select the appropriate device protocol from the dropdown list. For more information on how to create a device protocol refer to Creating device protocols.
Click Register to submit the device registration request and create the device.
You can verify that the device is connected by incoming events. Click on a device and open its Events tab. All events related to this device are listed.
For more information on viewing and managing your connected devices, also refer to the Device Management application.
In order to migrate the device from one LNS connection to another, the device must be re-registered:
Navigate to the LPWAN tab of the Device.
Click the Provider connection dropdown.
A prompt will appear stating that in order to migrate the device from one LNS connection to another, you must re-register the device. Click the Re-Register button.
You are directed to the device registration page where you can perform the re-registration following the steps above and selecting the desired LNS connection.
Assigning ADMIN permission for Loriot
In the Cumulocity platform, assign the Loriot admin role permission to the user configured in the Loriot Network Server.
In the Administration application, click Roles in the navigator and select the ADMIN checkbox for “Loriot”.
}
Creating device protocols
To process data from LoRa devices, Cumulocity needs to understand the payload format of the devices. Mapping payload data to Cumulocity data can be done by creating a LoRa device protocol.
During the device registration, you can associate this device protocol. The received uplink message for this device with a hexadecimal payload will then be mapped to the ones you have configured in your device protocol.
Info
Device protocol mapping only supports decoding for fixed byte positions based on the message type.
The length for the device payload parts, which is set in the Number of bits field, can be maximum 32 bits (4 bytes).
In order to create a device protocol, navigate to the Device Management application and select Device protocols in the Device types menu in the navigator. You can either import an existing device protocol or create a new one.
Importing a predefined device protocol
In the Device protocols page, click Import.
Select the predefined device type, for example “LoRaWAN Demonstrator” or upload from a file.
Click Import.
Alternatively, you may also load the device protocol from a file and import it.
Creating a new device protocol
In the Device protocols page, click New device protocol in the top menu bar. The following window will open:
Select LoRa as the device protocol type, provide a name for it and click Create.
Under Message types, specify the message types. LoRa devices can send messages of different types with different encodings per type.
Select the way the message type is encoded in the Source dropdown box:
FPort - if the message type can be determined by looking at the FPort parameter of a message.
Payload - if the message type can be determined by looking at the subset of the message payload itself.
In the following example payload structure, the first byte indicates the message type source (as highlighted).
In the user interface you can enter this type of message type source information as follows: In the Start bit field, indicate where the message type information starts in the payload and in the Number of bits field, indicate how long this information is, for example start bit = “0” and number of bits = “8”.
Click Add value to create the value configuration.
In the upcoming window, configure the relevant values as shown in this example.
New value window part 1
New value window part 2
The value configuration maps the value in the payload of a message type to the Cumulocity data.
Under Message type, configure the Message ID according to your device message specification and map it to the Cumulocity data. The message ID is the numeric value identifying the message type. It will be matched with the message ID found in the source specified on the device protocol main page (that is, Payload or FPort). The message ID must be entered in decimal numbers (not hex).
In this example payload structure the message ID is “1”.
Under General, specify a name for the value and the category under which it will be displayed in the values list. The associated name for this value will be displayed under the Display category given.
Under Value selection, define from where the value should be extracted. In order to do so, indicate where the value information starts in the Start bit field and how long this information is in the Number of bits field. The maximum value for the number of bits is 32 bits (4 bytes).
In this example the “Channel 1 Type” information starts in byte 2 (that means, start bit = “16”) and is 1 byte long (that means, number of bits = “8”).
The hexadecimal value is converted to a decimal number and afterwards a “value normalisation” is applied.
Under Value normalisation define how the raw value should be transformed before being stored in the platform and enter the appropriate values for:
Multiplier - this value is multiplied with the value extracted from the Value selection. It can be decimal, negative and positive. By default it is set to 1.
Offset - this value defines the offset that is added or subtracted. It can be decimal, negative and positive. By default it is set to 0.
Unit (optional) - a unit can be defined which is saved together with the value (for example temperature unit “C” for degree Celsius).
For detailed information on how to decode the payload, refer to the documentation of the device.
Info
“Little endian” support to decode the payload has been added.
Under Options, select one of the following options, if required:
Signed - if the value is a signed number.
Packed decimal - if the value is BCD encoded.
Under Functionalities, specify how this device protocol should behave:
Send measurement - creates a measurement with the decoded value.
Raise alarm - creates an alarm if the value is not equal to zero.
Send event - creates an event with the decoded value.
Update managed object - updates a fragment in a managed object with the decoded value.
You can also have a nested structure with several values within a measurement, event or managed object fragment. In case of a measurement all the properties of the same type will be merged to create a nested structure. In case of an event or a managed object all the properties with the same fragment are merged to create a nested structure. Also refer to the example of a nested structure for a “Position” device protocol below.
Click OK to add the values to your device protocol.
After clicking Save, your device protocol is created with the values you defined.
Example with single property
The following image shows an example for a message which sends a measurement when the battery level changes.
New value window part 1
New value window part 2
Example with nested structure
The following image shows an example of a nested structure for a device protocol reporting the current position of a GPS device. The display category is named “Position” and contains values for longitude and latitude.
The message ID should be the same for all the values. Enter the rest of the parameters according to the instructions above. Enter “c8y_Position” in the Managed object fragment field and create a new value for each: longitude and latitude.
New value window, Longitude
New value window, Latitude
This will be the result:
Using custom decoding
The Loriot agent also supports the decoding functionality by plugging in the custom microservice. Refer to LPWAN custom protocols for further details.
Assigning the Loriot LoRa device protocol
Once the Loriot LoRa device is available in the Cumulocity platform, you must assign a device protocol from the LPWAN tab.
Select the respective protocol from the dropdown list and click Apply. If successfully applied, the message “Device protocol set” will show up.
Sending operations
If the device supports sending hexadecimal commands, you can send them using shell operations. Note that these commands are not serial monitor commands.
In order to send an operation, navigate to the device you want to send an operation to in the Device Management application under All devices and switch to the Shell tab.
In the following screenshot you can find some examples of a device protocol’s predefined commands and their format:
Enter the shell command or view/edit the predefined command in the Command field.
If you enter the command without defining a port, it will be sent to the default target port (that is, port 1) of the device. If you enter the command and define a port (format “command:port”), it will be sent to the specified target port instead of the default port.
Click Execute. The operation is sent to the device. The timing depends on the Loriot platform.
The status of the operation is set to SUCCESSFUL when the operation has successfully been sent to the Loriot platform. The status of the operation is set to FAILED when a problem occurred with the validation of the command or after the operation has been sent to the Loriot platform.
Uplink message processing
On receiving an uplink message, the Cumulocity platform creates the following measurements and events, and updates the corresponding device managed object.
Unprocessed data - An event of type c8y_LoriotUplinkRequest is created with the unprocessed data.
Position - The c8y_Position fragment of the device managed object is updated to capture the latitude, longitude, altitude and accuracy information of the device. Also, an event is created with the position information.
Spreading factor - The c8y_SpreadingFactor fragment of the device managed object is updated to capture the spreading factor of the device.
Signal strength - A measurement is created with RSSI and SNR values of the device signal strength.
Troubleshooting
Device registration
No LoRa device registered in Cumulocity after configuring the Loriot agent endpoint in the Loriot Network Server account
The Loriot agent verifies if the user has appropriate permissions. Check whether the user configured in the Loriot Network Server has assigned the Loriot admin role.
Make sure that the Gateway Information is enabled in the Loriot Network Server since the Loriot agent only processes “gw” messages.
Device type error warning
The warning message “Device type error” shows up in the log if no device protocol has been assigned to the device.
To assign a device protocol refer to the section Assign the Loriot LoRa device protocol.
Actility LoRa
Introduction
Cumulocity can interface with LoRa devices through Actility’s ThingPark Wireless, Enterprise or Community edition. You can:
Provision and deprovision LoRa devices easily using the Cumulocity Device Management application. No interaction in the ThingPark user interface is required.
Decode upstream payload packets using a web-based user interface.
Debug and postprocess raw device data through Cumulocity events.
Send downstream data to the device using Cumulocity operations.
Make use of existing Cumulocity features with LoRa devices, for example, connectivity monitoring, device management, data visualization with dashboards, real-time analytics and more.
The following illustration gives an overview of the Cumulocity Actility LoRa integration.
Info
Your subscription must include this feature. If you do not see the functionality described in this document please contact product support.
Before using LoRa devices with Cumulocity, you must configure your ThingPark account details in the Administration application.
To add a new connection
Click the Connectivity tab in the Settings menu to create, edit, delete or update multiple Actility connections.
If you select Connectivity for the first time, you are asked to create a connection. Click Add Connection.
Enter the following information:
Setting name
Notes
Name
The name of the Actility connection being created.
Description
The description of the Actility connection being created.
Actility ThingPark URL
Base URL of the corresponding Actility DX API being used.
Profile ID
Your ThingPark account profile identifier.
Application server ID
Application server ID for TLS security between ThingPark platform and agent. Optional field. Leave empty to disable security. If enabled, the agent generates a token for all uplink and down-link messages.
Application server key
Application server private key for TLS security between the ThingPark platform and agent for uplink and downlink communications. Value should be in hex and 16 bytes. Optional field. Leave empty to disable security. If enabled, the agent generates a token for all uplink and down-link messages.
Admin API version
Version that the ThingPark admin API uses. By-default set to “latest”.
Core API version
Version that the ThingPark core API uses. By-default set to “latest”.
Username
Your ThingPark account username.
Password
Your ThingPark account password.
Connection type
The ThingPark account type that is being used (Enterprise or Wireless).
Environment-specific information
The following settings vary depending on your ThingPark environment:
Application server ID and key: Leave empty (HTTPS used internally)
Connection type: Choose Enterprise
Other environments (Enterprise/Wireless):
URL: Contact ThingPark support
Profile ID: Contact ThingPark support
Application server ID and key: Look up in your application server profile in ThingPark or contact ThingPark support
Connection type: Choose based on your environment (Enterprise or Wireless)
Important
Do not use the same ThingPark login (username and password) for other tenants.
The profile ID, username and password are used to retrieve an access token to send further requests to the ThingPark platform. It is possible to renew the access token by replacing the account credentials for a particular connection.
Click Save. If you have entered the correct information, you see the message “Connection created”.
To add another connection, click Add Connection and follow the steps above.
To update a connection
Select the connection to be updated, make your edits, and save the connection.
If there are devices associated with the connection, an error message will appear, stating “Can not update the LNS Connection with <name of LNS Connection> as it’s associated with <number of devices>. Click the link to download the file with the details of the associated devices: /service/<agent-context-path>/lns-connection/<lns-connection-name>/device”.
To delete a connection
Select the connection to be deleted and click Delete.
If there are devices associated with the connection, an error message will appear, stating “Can not delete the LNS Connection with <name of LNS Connection> as it’s associated with <number of devices>. Click the link to download the file with the details of the associated devices: /service/<agent-context-path>/lns-connection/<lns-connection-name>/device”.
Creating device protocols
To process data from LoRa devices, Cumulocity needs to understand the payload format of the devices. Mapping a payload data to Cumulocity data can be done by creating a LoRa device protocol.
During the device registration, you can associate this device protocol. The received uplink callbacks for this device with a hexadecimal payload will then be mapped to the ones you have configured in your device protocol.
The device protocol assigned during device registration can be changed from the LPWAN tab in the device details page.
Info
Device protocol mapping only supports decoding for fixed byte positions based on the message type.
The length for the device payload parts, which is set in the Number of bits field, can be maximum 32 bits (4 bytes).
In order to create a device protocol, navigate to the Device Management application and select Device protocols in the Device types menu in the navigator. You can either import an existing device protocol or create a new one or use the device protocols created by an LPWAN custom codec microservice.
Importing a predefined device protocol
In the Device protocols page, click Import.
Select the predefined device type, for example “LoRaWAN Demonstrator” or upload from a file. Click Import.
Alternatively, you may also load the device protocol from a file and import it.
Creating a new device protocol
In the Device protocols page, click New device protocol in the top menu bar. The following window will open:
Select LoRa as the device protocol type, provide a name for it and click Create.
Under Message types, specify the message types. LoRa devices can send messages of different types with different encodings per type.
Select the way the message type is encoded in the Source dropdown box:
FPort: if the message type can be determined by looking at the FPort parameter of a message.
Payload: if the message type can be determined by looking at the subset of the message payload itself.
In the following example payload structure, the first byte indicates the message type source (as highlighted).
In the user interface you can enter this type of message type source information as follows: In the Start bit field, indicate where the message type information starts in the payload and in the Number of bits field, indicate how long this information is, for example start bit = “0” and number of bits = “8”.
Click Add value to create the value configuration.
In the upcoming window, configure the relevant values as shown in this example.
New value window part 1
New value window part 2
The value configuration maps the value in the payload of a message type to the Cumulocity data.
Under Message type, configure the Message ID according to your device message specification and map it to the Cumulocity data. The message ID is the numeric value identifying the message type. It will be matched with the message ID found in the source specified on the device protocol main page (that is, Payload or FPort). The message ID must be entered in decimal numbers (not hex).
In this example payload structure the message ID is “1”.
Under General, specify a name for the value and the category under which it will be displayed in the values list. The associated name for this value will be displayed under the Display category given.
Under Value selection, define from where the value should be extracted. In order to do so, indicate where the value information starts in the Start bit field and how long this information is in the Number of bits field. The maximum value for the number of bits is 32 bits (4 bytes).
In this example the “Channel 1 Type” information starts in byte 2 (that means, start bit = “16”) and is 1 byte long (that means, number of bits = “8”).
The hexadecimal value is converted to a decimal number and afterwards a “value normalisation” is applied.
Under Value normalisation define how the raw value should be transformed before being stored in the platform and enter the appropriate values for:
Multiplier: This value is multiplied with the value extracted from the Value selection. It can be decimal, negative and positive. By default it is set to 1.
Offset: This value defines the offset that is added or subtracted. It can be decimal, negative and positive. By default it is set to 0.
Unit (optional): A unit can be defined which is saved together with the value (for example temperature unit “C” for degree Celsius).
For detailed information on how to decode the payload, refer to the documentation of the device.
Info
“Little endian” support to decode the payload has been added.
Under Options, select one of the following options, if required:
Signed - if the value is a signed number.
Packed decimal - if the value is BCD encoded.
Under Functionalities, specify how this device protocol should behave:
Send measurement: Creates a measurement with the decoded value.
Raise alarm: Creates an alarm if the value is not equal to zero.
Send event: Creates an event with the decoded value.
Update managed object: Updates a fragment in a managed object with the decoded value.
You can also have a nested structure with several values within a measurement, event or managed object fragment. In case of a measurement all the properties of the same type will be merged to create a nested structure. In case of an event or a managed object all the properties with the same fragment are merged to create a nested structure. Also refer to the example of a nested structure for a “Position” device protocol below.
Click OK to add the values to your device protocol.
After clicking Save, your device protocol is created with the values you defined.
Example with single property
The following image shows an example for a message which sends a measurement when the battery level changes.
New value window part 1
New value window part 2
Example with nested structure
The following image shows an example of a nested structure for a device protocol reporting the current position of a GPS device. The display category is named “Position” and contains values for longitude and latitude.
The message ID should be the same for all the values. Enter the rest of the parameters according to the instructions above. Enter “c8y_Position” in the Managed object fragment field and create a new value for each: longitude and latitude.
New value window, Longitude
New value window, Latitude
This will be the result:
Using custom decoding/encoding
The Actility agent also supports the decoding/encoding functionality by plugging in the custom microservice. Refer to LPWAN custom protocols for further details.
Registering Actility LoRa devices
To register a LoRa device in Cumulocity navigate to Devices > Registration in the Device Management application. Click Register device at the top right, and select Single device registration > Actility LoRa from the dropdown.
Cumulocity fully supports the LoRa device provisioning with Over-the-Air Activation (OTAA) which is the preferred and most secure way to connect with the LoRa network.
If Activation by Personalization (ABP) is required to be used, refer to LoRa device registration with ABP.
In the next window fill in the required information:
Connection: Lists all configured Actility connections in the tenant. The following device profile and connectivity plan option is populated based on the selected Actility connection.
Device profile: Select the Actility Thingpark device profile from the dropdown list that matches the device that you are registering.
The Actility ThingPark device profile allows to manage multi-RF profiles, ensures different LoRaWAN class compatibility (A, B or C) and allows application payload decoding for easy third-party application integration.
Device protocol: Select the appropriate device protocol from the dropdown list. For more information on how to create a device protocol refer to Creating device protocols.
Device EUI: This is the unique identifier for the device. It is a 16 character (8 byte) long hexadecimal number. You can find it on the device itself.
Application EUI: This is a global application ID in the IEEE EUI64 address space that uniquely identifies the application provider of the device. It is a 16 character (8 byte) long hexadecimal number. There can be only one application EUI for a tenant but multiple tenants can have the same application EUI.
Application key: This is an AES-128 application key specific for the device that is assigned to the device by the application owner and is responsible to encrypt. The application key is a 32 character (16 byte) long hexadecimal number.
JOIN communication. You can find this key on the device itself.
Connectivity plan: Select the appropriate connectivity plan from the dropdown list.
Click Register to submit the device registration request and create the device.
You can verify that the device is really connected by checking that events are actually coming in. You can do so by clicking on a device and opening the Events tab. All events related to this device are listed here.
The provision status is shown under Device data in the Info tab of the device.
For more information on viewing and managing your connected devices, also refer to the Device Management application.
In order to migrate the device from one LNS Connection to another, the device must be re-registered.
Navigate to the LPWAN tab of the device.
Click the Provider connection dropdown.
A prompt will appear stating that in order to migrate the device from one LNS connection to another, you must re-register the device.
Click Re-Register.
You are directed to the device registration page where you can perform the re-registration by following the steps above and selecting the desired LNS connection.
LoRa device registration process
A device is created based on the above workflow.
First it is checked, if the device already exists. If no device exists with the same device EUI in the ThingPark account, the device is first provisioned on the ThingPark platform and then created on the Cumulocity platform with a link to the device in the ThingPark platform. If the device exists in the ThingPark account, a validation will be applied to compare these devices based on application EUI (for OTAA activation) and device profile. If the validation is successful, the device is created only in Cumulocity with a link to the device in the ThingPark platform. If the validation fails, a failure message is shown and the device is not created in Cumulocity.
LoRa device registration with Activation by Personalization (ABP)
Activating the device by personalization is not recommended and not fully supported in Cumulocity LoRa device registration.
However, if you would like to create a device with this activation type in Cumulocity and use the LoRa features - such as sending operations to a device, deprovisioning a device and setting LoRa device protocol type with custom device protocol configuration - you must first provision the device in the ThingPark platform. Moreover you must create “AS Routing Profile” for Cumulocity using the destination http://actility-server.cumulocity.com as a “Third Party AS (HTTP)” and assign it to your devices manually. Afterwards, you can register this device using LoRa device registration. In this case, the Application key field in the LoRa device registration is invalid.
Limitations for LoRa devices created with general device registration
The general device registration for LoRa devices is no longer supported.
Existing LoRa devices that have been created in Cumulocity with the general device registration process have limitations. For those devices, it is not possible to send operations to the device, deprovision the device and set the LoRa device protocol type with custom device protocol configuration.
It is recommended to delete and re-register these devices using LoRa device registration to fully use the LoRa feature.
Deprovisioning LoRa devices
You can deprovision a LoRa device in the ThingPark platform. This means that the device is no longer connected to the network. Its history data is still available in Cumulocity, but the device is deleted in ThingPark.
To deprovision a device, navigate to the respective device in the Device Management application under All devices. Click More in the top right and select Deprovision device.
After confirming the deprovisioning, the device will be deprovisioned in ThingPark.
To provision the device again, the device must be deleted and re-registered using LoRa device registration.
Sending operations
If a LoRa device supports receiving hexadecimal commands, you can send them using shell operations. Note that these commands are not serial monitor commands.
In order to send an operation, navigate to the device you want to send an operation to in the Device Management application under All devices and switch to the Shell tab.
In the following screenshot you can find some examples of a device protocol’s predefined commands and their format.
Enter the shell command or view/edit the predefined command in the Command field.
If you enter the command without defining a port, it will be sent to the default target port (that is, port 1) of the device. If you enter the command and define a port (format “command:port”), it will be sent to the specified target port instead of the default port.
Click Execute. The operation is sent to the device. The timing depends on Actility ThingPark.
The status of the operation is set to SUCCESSFUL when the operation has successfully been sent to the ThingPark platform. The status of the operation is set to FAILED when a problem occurred with the validation of the command or after the operation has been sent to the Thingpark platform.
ThingPark API availability monitoring
The ThingPark API is monitored, and if it is not reachable, an alarm is created to notify all subscribed tenants using this feature. The alarm is cleared right after the ThingPark API is reachable again.
Uplink message processing
On receiving an uplink message, the Cumulocity platform creates the following measurements and events, and updates the corresponding device managed object.
Unprocessed data - An event of type c8y_ActilityUplinkRequest (this type is based on the event.uplink.type set in the configuration file) is created with the unprocessed data.
Position - The c8y_Position fragment of the device managed object is updated to capture the latitude, longitude, altitude and accuracy information of the device. Also, an event is created with the position information.
Spreading factor - The c8y_SpreadingFactor fragment of the device managed object is updated to capture the spreading factor of the device.
Signal strength - A measurement is created with RSSI and SNR values of the device signal strength.
Troubleshooting
Device registration
Access to device denied
This warning message shows up when there already exists a provisioned device in ThingPark with the same device EUI used for device registration and the validation comparing those devices based on application EUI (for OTAA activation) and device profile has failed.
To resolve this, provide the correct application EUI from the Connectivity application and device profile and try again.
No LoRa provider settings found
This warning message shows up when there are no credentials set up for the ThingPark account. To resolve this click Settings to navigate to the Administration application where the connections are configured.
This warning message shows up when the tenant’s access token to Thingpark becomes invalid. Invalidation of the token might happen when the same ThingPark credentials are used for another tenant.
This issue can be solved by reconfiguring the Actility ThingPark credentials to renew the access token. Refer to Configuring multiple ThingPark account connections for reconfiguration of the credentials.
No device protocols configured
This warning message shows up when no LoRa device protocol exists to be used for device registration. To resolve this, click Device protocols to navigate to the Device protocols page where the protocols are configured.
To resolve this, configure at least one device protocol in the Device database.
No connectivity plans with free slots available
This warning message shows up when the connectivity plan in Actility ThingPark has reached the limit for the device count.
To resolve this, either contact ThingPark on the device quota limits for your connectivity plans or remove unused devices from ThingPark and retry registering the device in Cumulocity.
Connectivity
Authorization to the LoRa platform failed
This warning message shows up if a provided profile ID, username or password is invalid.
To resolve this, provide correct credentials and try again.
Authentication to the Actility platform failed. Check if the base URL is correct
To resolve this, provide a correct URL and try again.
Authentication to the Actility platform failed with status code ‘400’. Check if the profile ID is correct
To resolve this, provide a correct profile ID and try again.
Authentication to the Actility platform failed with status code ‘401’. Check if the credentials are correct
To resolve this, provide a correct username and password and try again.
LPWAN custom protocols
Introduction
Cumulocity can interface with LPWAN devices through LPWAN network providers via Cumulocity LPWAN agents, such as Actility LoRa.
Our LoRa integration allows you to define device protocols in a self-service manner to create a binary mapping of the LoRa sensor data to the Cumulocity data model.
However, this approach does not work for LoRa devices sending dynamic payloads.
To integrate LoRa devices with dynamic payloads, a custom codec for payload decoding and command encoding can be created in form of a microservice.
This microservice will be referred to as a custom codec microservice.
A custom codec microservice is a typical Cumulocity microservice which conforms to a specific contract for decoding and encoding LoRa payloads and commands.
When an LPWAN agent receives an uplink message, it forwards the device data to a REST endpoint (such as /decode) exposed by the custom codec microservice for decoding.
Similarly, when the user executes a device command through the device shell, the LPWAN agent forwards the command text to a REST endpoint (such as /encode) exposed by the custom codec microservice for encoding.
Implementing a custom codec microservice
A custom codec microservice is a typical Cumulocity microservice, which can be implemented and enabled as follows.
Create a microservice which exposes the /encode and /decode REST endpoints conforming to the OpenAPI Specification, implementing the encoding and decoding functionality.
The microservice must create device protocols for each LPWAN device type it supports. If you use the lpwan-custom-codec library the device protocols will be created automatically for you.
Otherwise, you must use the Inventory API to create a new managed object describing the device protocol with the following JSON structure:
You must create a device protocol (with type and fieldbusType properties, and the c8y_LpwanCodecDetails fragment) as well as an external ID for every device manufacturer and device model combination that this codec microservice supports:
Based on the device protocol assigned to a device, the LPWAN agent automatically routes the request to the corresponding microservice.
For device downlink commands, the LPWAN agent forwards the device shell command request to the /encode endpoint only when a predefined command listed as “supportedDeviceCommands” in the c8y_LpwanCodecDetails fragment of the device protocol is executed.
You must create a predefined command template for every supported device command (supportedDeviceCommands) specified in the device type.
The following example shows the JSON structure for creating a predefined command template using the Inventory API:
{
"type": "c8y_DeviceShellTemplate",
"name": "<<Command name, matching the name of the supported command mentioned in the device protocol>>",
"deviceType": [
"<<Device Protocol Name>>" ],
"category": "<<Command Category>>",
"command": "<<Command string which gets copied to the device shell command prompt when the user chooses this Predefined command>>",
"deliveryTypes": [
"Default" ]
}
Using the LPWAN custom codec library
For convenience, Cumulocity provides the Java library com.nsn.cumulocity.clients-java:lpwan-custom-codec to develop the custom codec microservice in Java as a SpringBoot application.
When subscribed, such a custom codec microservice automatically creates the required device protocols and predefined command templates as described in Implementing a custom codec microservice.
To create a custom codec microservice using this library, do the following:
a. Implement the supportedDevices method of com.cumulocity.microservice.lpwan.codec.Codec to specify the device manufacturer, device name and the commands this custom codec service supports:
b. Implement the decode method of com.cumulocity.microservice.customdecoders.api.service.DecoderService to provide the decode functionality. The decode method receives the following input:
inputData- device payload to be decoded.
deviceId- device managed object ID.
args- a map which contains keys:
deviceManufacturer- device manufacturer.
deviceModel- device model.
sourceDeviceEui- device eui.
fport- fport (optional).
The library also provides the wrapper class com.cumulocity.microservice.lpwan.codec.decoder.model.LpwanDecoderInputData to extract the decoder inputs.
Add the following permissions in the microservice manifest file cumulocity.json. Note that the respective field in the manifest is called requiredRoles, but what you actually add is a list of required permissions strings.
Steps to build the example codec lora-codec-lansitec microservice.
Clone the https://github.com/Cumulocity-IoT//cumulocity-examples.git repository.
Build the microservice using mvn clean install. This creates a ZIP file of the lanitec codec microservice.
Deploy the microservice by uploading the ZIP file using the Cumulocity Administration UI.
Open the Device Management application. Under Device protocols, you should now see the device protocols with type “lpwan” created by the lansitec codec microservice.
The image below shows the device protocols option in the Device Management application.
The image below shows an example of the device protocols created by the custom codec microservice on subscription.
The created device protocols will be listed in the dropdown during the device registration of LPWAN with any of the LPWAN agents.
The Actility LoRa device registration is shown below.
You can also assign the device protocol from the LPWAN device tab.
To do so, navigate to a particular device.
Then, switch to the LPWAN tab and click New device protocol to view the device protocols created above.
Supported device commands are available in the Predefined commands option from the Device shell tab.