how to store and visualize actility data with datacake and mqtt (part 3)

This guide explains how to forward data via MQTT to an InfluxDB database, visualize it in Grafana using Node-RED, and simulate network coverage for the RAK2560 Sensor Hub connected to a WisGate RAK7268V2 gateway.

This tutorial is the last part of the Actility guide series:

⚠️
IMPORTANT

Before you proceed, make sure your RAK gateway is connected to the Actility LoRaWAN server. If you haven’t completed the setup, refer to the Connect WisGate RAK7268V2 to Actility guide for step-by-step instructions. Once the connection is complete, move on to setting up the Sensor Hub.

 

Connect Actility to Datacake and MQTT Broker

Sensor data in the Actility LoRaWAN server represents only a small part of a complete sensor application. The data must be forwarded to visualization platforms or processing systems, eventually even triggering actions based on sensor values. 

Actility offers many various interfaces in the Connections section that allow sensor data to be exported from the LoRaWAN server. This guide uses connections to an MQTT broker and to Datacake as examples.

🗒️
NOTE

Detailed instructions for setting up connections to cloud services are found in the ThingPark documentation.

All integrations are configured in the Actility Console’s Connections section. To begin:

Connections-Datacake-1.png

Figure 1: Actility Connections Tab

 

1. In the Connections window, click on ADD CONNECTION.

Connections-General-1.png

Figure 2: Click the Add Connection Button

2. Then, select ThingPark X IoT Flow.

Connections-General-2.png

Figure 3: Actility Select Connection Type

3. A list of available connections will appear.

Connections-General-3.png

Figure 4: Actility Connections Available

Connect Actility to Datacake

Before setting up a connection, create a Datacake account. A free trial is available.

Once the account is set up, go to the dashboard and generate the API Token from your Datacake Account settings, since this token will be required during the connection setup.

Connections-Datacake-3.png

Figure 5: Datacake API Token

1. Open the connection overview, click on ADD CONNECTION, select ThingPark X IoT Flow, then choose the Datacake option.

Connections-Datacake-2.png

Figure 6: Actility Datacake Connection

2. In the next window, enter the information required to set up the connection to Datacake. Paste the API token retrieved from Datacake into the Access Token field. When finished, click Create.

🗒️
NOTE

The DownlinkAsId and DownlinkAsKey are only required if downlinks initiated by Datacake are needed.

 

Connections-Datacake-4.png

Figure 7: Actility Datacake Connection Access Token

3. After the connection is created, go to the Devices overview in the Actility Console and open the device details, then click on the ADD A CONNECTION button to link the Datacake integration.

Connections-General-4.png

Figure 8: Actility Console Add Connection

4. In the connections list, select Actility-Datacake and click the check button to confirm the selection.

Connections-Datacake-5.png

Figure 9: Select Actilty-Datacake on the connection list

5. Go to the Datacake account. Open Devices, click + Add Device, and select LoRaWAN as device type.

Connections-Datacake-6.png

Figure 10: Datacake Add LoRaWAN Device

6. In the Add LoRaWAN Device window, select New Product and enter a Product Name, then click Next.

Connections-Datacake-7.png

Figure 11: Datacake Add New Product and Product Name

7. Select Actility as the LoRaWAN server.

Connections-Datacake-8.png

Figure 12: Select Actility As the Network Server

8. In the next window enter the DevEUI of the SensorHub and a name.

Connections-Datacake-9.png

Figure 13: Datacake Add LoRaWAN Device

9. Add the device to select a plan. Datacake offers free plans with a limited number of devices and limited data retention time.

Connections-Datacake-10.png

Figure 14: Datacake Select the Free Bill Plan

10. Open the device in Datacake and go to Debug. If the connection is successful, the log will show the data received from Actility.

Connections-Datacake-11.png

Figure 15: Datacake Select Go to the Debug Tab

11. After adding a Payload Decoder in the Configuration, the decoded payload can be read on the screen.

Connections-Datacake-12.png

Figure 16: Datacake Add the Decoder

🗒️
NOTE

Check the Payload Decoder on the official RAK GitHub repository.

12. The payload decoder must be added in the device Configuration. Scroll down to the Payload Decoder and paste the decoder there, replacing the existing code.

Connections-Datacake-14.png

Figure 17: Payload Decoder Sensor Data

13. Next, the data fields have to be generated. The easiest way is to use an example payload (e.g., from the Debug output) and run it through the decoder by clicking Try Decoder.

Connections-Datacake-15.png

Figure 18: Datacake Try Payload Decoder

14. All sensor data fields are shown in the Recognized measurements field

15. On the first run, all data fields are marked red. Hover over a data field and left-click to automatically create a matching Datacake field.

Connections-Datacake-16.png

Figure 19: Add Field After Decoder Test

16. A pop-up window will appear where you can add the data field. Change the entries if needed, then click Add Field.

Connections-Datacake-17.png

Figure 20: Add Field Information

17. Repeat steps 15 to 17 for all sensor data fields from the decoder test run. At the end, all fields should be listed in the Fields view.

  • NAME: The sensor field name used for the dashboard creation.
  • IDENTIFIER: The data field name created by the decoder.

Connections-Datacake-18.png

Figure 21: All Fields Added on Datacake

18. Next, go to the Dashboard. It will be empty by default. Toggle the edit button on the right side to start the customization.

Connections-Datacake-19.png

Figure 22: Datacake Device Dashboard

19. Then click on the button Add Widget to add a new data widget.

Connections-Datacake-20.png

Figure 23: Datacake Device Dashboard Add Widget

20. Select a widget type from the pop-up window. Use the Chart for this example.

Connections-Datacake-21.png

Figure 24: Select Widget Type

21. Now the widget needs to be configured.

Connections-Datacake-22.png

Figure 25: Edit the Widget Selected

22. You can edit on the following tabs:

  • In the Basic tab, the widget name is defined. 
  • In the Data tab, the data field is selected.
  • The Field selector shows all data fields generated by the payload decoder. Choose Air Temperature.

Connections-Datacake-23.png

Figure 26: On the Dashboard, select the field created

23. For a basic dashboard, no other information is needed. Click on Add to close the window.

The new widget will be shown in the dashboard now.

Connections-Datacake-24.png

Figure 27: Save On Dashboard the Widget

24. Repeat these steps for each sensor value you want to display on the dashboard.

25. When you’re done, click the yellow button on the right side to save the new dashboard.

Datacake also offers many options to create and customize widgets. For more details, refer to the official Datacake documentation.

Connections-Datacake-13.png

Figure 28: Example dashboard in Datacake for the Soil Sensor

 

Connect Actility to an MQTT Broker and a Visualization Stack

For this connection, an active MQTT Broker is required. A Mosquitto MQTT Broker is installed on a VPS server with basic security settings. Depending on the setup of the used MQTT broker, additional configuration might be needed. Refer to the  ThingPark documentation for detailed instructions.

For sensor data visualization, an InfluxDB database and Grafana are used. Both are installed on the same VPS server.

 

Set Up the MQTT Connection in Actility

1. In the Actility console, open the Connections section and click ADD CONNECTION. 

2. Select ThingPark X IoT Flow, then choose MQTT. In the next window, click on MQTT.

Connections-MQTT-1.png

Figure 29: Actilty Create a MQTT Connection

3. In the next window, configure the connection to your MQTT broker. Enter the following details, then click CREATE to save the connection.

  • Name: Any descriptive name.
  • Hostname: Enter a name, any name is possible.
  • Port: Enter the host URL or IP address together with the port. Depending on the setup of the MQTT broker, the port number can be different.
  • Publish topic pattern: Leave unchanged. 
  • Subscribe topic pattern: Leave unchanged.
  • Protocol: Select the connection protocol (here TCP).
  • Authentication: Enter MQTT Username and MQTT Password (depending on the connection protocol, it might be required to enter different connection certificates here).
🗒️
NOTE

Connection settings will change depending on the MQTT Broker, the connection protocol, and security. This guide shows a basic TCP connection with username and password protection.

 

Connections-MQTT-2.png

Figure 30: Actility MQTT Parameters

4. After creating the MQTT connection, go to the devices overview page in the Actility console.

5. Click on ADD A CONNECTION, select the MQTT Broker connection, and confirm.

Connections-MQTT-3.png

Figure 31: Actility MQTT Broker Connection

6. Go to the Contabo MQTT Broker in the Connections tab of the Actility Console, the data can be seen now.

Connections-MQTT-4.png

Figure 32: Contabo MQTT Broker

7. Use an MQTT client (e.g.,  MQTTX) to view the published packets on the MQTT broker. As mentioned earlier, in a payload decoder, the payload is transmitted in its decoded format.

Connections-MQTT-5.png

Figure 33: Actility MQTT Payload Decoder

 

Visualize Sensor Data Using Node-RED, InfluxDB, and Grafana

For the visualization, three additional applications are used:

  • NodeRED: Subscribes to the MQTT Broker and receives sensor data
  • InfluxDB: Stores the received data
  • Grafana: Visualizes the data using dashboards

These tools were chosen because they are already available on the same VPS hosting the MQTT Broker, but other compatible applications may also be used as alternatives.

All components are installed using Docker containers. For installation instructions, refer to each application’s official documentation.

a. NodeRED flow

The NodeRED flow only requires three nodes to receive the packets from the MQTT broker and forward them to the InfluxDB database.

Connections-MQTT-6.png

Figure 34: NodeRED Flow for InfluxDB Database

1. Get Packets (forwarded from Actility) is the connection to the MQTT broker with a subscription to the packets sent from the Actility LoRaWAN server. It subscribes to the topics in mqtt/things/#.

2. The Server settings are set up for the local MQTT Broker on the VPS.

Connections-MQTT-7.png

Figure 35: NodeRED Chirpstack Settings

3. The parse payload extracts the sensor data from the MQTT packet and prepares it to be sent to the InfluxDB database.

The Javascript of the "Parse payload" node is only 4 lines:

var new_payload = [];
new_payload.push({ measurement: "TST-" + msg.payload.DevEUI_uplink.DevEUI, fields: msg.payload.DevEUI_uplink.payload, timestamp: new Date().getTime() - 1 });
msg.payload = new_payload
return msg;

4. Configure the Edit Influx batch node properties:

  • Name: To InfluxDB, serves as the connection to the database in the RAKwireless bucket.
  • Server: For the local InfluxDB installation on the VPS.
  • Bucket: RAKwireless, the target bucket for storing sensor data.

Connections-MQTT-8.png

🗒️
NOTE

NodeRED requires one additional node, which is not installed by default, for the connection to InfluxDB: node-red-contrib-influxdb.

 

b. Data in InfluxDB

In InfluxDB, the sensor data is stored in the RAKwireless bucket under the RAKwireless organization.

To explore the data:

1. Open the InfluxDB web UI and navigate to Data Explorer.

2. Select the correct bucket (RAKwireless), then apply filters to narrow down the data.

3. Filter using TST- prefix, which was set in the Node-RED Parse payload function. This will help isolate the relevant device data.

After filtering for "Tst" and selecting the device, we can already see the available data in the next filter.

Connections-MQTT-9.png

Figure 37: InfluxDB Data Explorer Tab

4. After selecting a device and data field, click SUBMIT to view the results in the graph. Since the connection is newly established, the available data will be limited.

Connections-MQTT-10.png

Figure 38: InfluxDB Data Explorer Configuration

5. Push QUERY BUILDER to get the Flux commands. A nice feature of InfluxDB is the option to convert this query into Flux commands that will be directly used later in Grafana for the visualization.

Connections-MQTT-11.png

Figure 39: InfluxDB Data Explorer Query Builder

6. Copy these Flux commands for later use in Grafana.

 

c. Visualization of the Data in Grafana

After the installation of Grafana and the basic setup, the connection to InfluxDB is required.

1. In Grafana, go to the  Connections section, and click Add new connection.

2. Search for and select InfluxDB

Connections-MQTT-12.png

Figure 40: Grafana Add New Connection

3. Follow the standard setup for the connection to InfluxDB.

Connections-MQTT-13.png

Figure 41: Grafana InfluxDB Settings

4. Once the database connection is working, a new Dashboard will be added to visualize the sensor data Dashboard section. Follow the Build your first dashboard documentation of Grafana to setup a dashboard.

Connections-MQTT-14.png

Figure 42: Grafana Dashboard

🗒️
NOTE

The required Flux commands to retrieve data from the InfluxDB database can be created directly in InfluxDB.

 

 

d. Example: Add a Sensor Data Graph

1. In the new dashboard, add a visualization.

2. Copy the Flux commands from InfluxDB into the Query.

3. Configure the remaining fields as needed.

Connections-MQTT-15.png

Figure 43: Grafana Flux Commands Into the Query

The finished dashboard for the soil sensor may look like this:

Connections-MQTT-16.png

Figure 44: Grafana Finished Dashboard

Summary

This guide demonstrated how to:

  • Use Actility's Connections feature to forward sensor data
  • Set up a sensor data visualization using Datacake
  • Build a custom visualization pipeline with MQTT Broker, NodeRED, InfluxDB and Grafana

It wraps up the Actility guide series, providing a complete workflow from LoRaWAN gateway setup to real-time sensor data visualization, ready for practical deployment and further extension.


bernd-giesecke.png

Bernd Giesecke

Bernd is an Electronics Engineer and Product Manager at RAKwireless with 23 years of experience in industrial and automotive hardware and software R&D. He has been supporting the Arduino open-source community since 2014.

 


Changelog

  • Version 1 - How to Store and Visualize Actility Data With Datacake and MQTT 
    • Author: Bernd Gieseck
    • Reviewer: Harold Duarte
    • Date Published: 06/09/2025

 


 

 

 

Updated