Firstly, let us create the Antares Uplink node as well as its adjacent nodes. Scroll down on the left panel node and drag out the the respective nodes to the workspace as seen below.

Next, double click on the mqtt node and enter in the Server name as Antares and click edit.

Enter in details for the server, port, client ID and click Update.
Below are the details for easier copy paste as well.

Detailed documentation can be found at https://antares.id/en/mqtt-push-data-to-device.html

|
Server: mqtt.antares.id
Port: 1883
Client ID: 974479dd27994a5d92f5e2bcfba9e710
|
Next, we have to add in the topic. First, we have to find our Antares account access key.
Login to your Antares account and click on Account on the left side.

Your access key will be shown at the bottom of the page. Copy this access key.

Go back to STM32CubeMonitor, double click on the Antares Uplink node, copy the Topic link below, paste your access key between the slashes /access-key/ and click done.

The detailed documentation on the Topic format can be found at https://antares.id/en/mqtt-push-data-to-device.html
 |
Topic: /oneM2m/resp/antares-cse/access-key/json
*Example: /oneM2m/resp/antares-cse/8e20a29a2d9eba86:915ebc2109865062/json
|
Next, we will rename the debug nodes as follows by double clicking each node and changing its name. The debug nodes are inserted so that we are able to debug and analyze the data that is received at the uplink as well as after the json conversion.

Next, we will also rename our json node to json converter as well as check the Format JSON string option. The function of the json converter is to convert the json data format we receive from Antares and convert it into an object format in order for us to extract the payload. (data)

Next, connect the nodes as follow:

Next, click DEPLOY on the top right of the interface.

Notice that the Antares Uplink becomes connected and ensure that the 2 debug nodes are turned on as seen below.

Click on the debug icon and notice the window of data below it.

Let us analyze the data. Firstly, take a look at the Payload at uplink and Payload after json from the same timestamp. For my case it is at 3:19:56PM. The Payload at uplink is debugged as a json string that contains data sent from Antares. After the json converter, the Payload after json node shows that the json string is converted into an object which we can extract data from using our function node later on.

Next, double click on the function node and add in the following:

Alternatively, you can copy paste the code below for easier referencing.
var LedState = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(34,36))}; var Pressure = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(36,40))}; var Temperature = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(40,42))} var Humidity = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(42,46))}; var Light = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(46,50))}; var Battery = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(50,52))};
return [LedState, Pressure, Temperature, Humidity, Light, Battery]; |
Let us now take a look at how this segment of code works. It parses the payload into a substring from a certain index to another index, adds in a 0x in front and stores it in a specific sensor data created variable.
For example, let us take a look at the payload we receive after json:

The data is extracted from the con inside of the payload using the function msg.payload["m2m:rsp"].pc["m2m:cin"].con
We then parse it through a substring by adding a .substring(index, index) to it.
How is the index determined?
Let us take a look at the temperature variable for example:

|
var Temperature = {payload: parseInt("0x" + msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(40,42))} |
The index 40 to 42 is established by counting from the first index.

(i.e. { → index 0, " → index 1, t → index 2, y → index 3, p → index 4, e → index 5, etc.)
After storing all these sensor data in different variables, we will return these values in the last line of our data decoder function.
Lastly, we will also increase the number of outputs to 6 as there are 6 variables in our sensor data.
Next, we will add in widgets for our sensor data. For the sample dashboard, we will be adding in gauges and charts. First, drag the widgets out as seen below.

*Note: The text node is from "text" widget, not "text input" widget.
Let us configure the first text node into a Time/Date node. Double click the node and change the following:

The value format has an added .ts as that is the timestamp function defined inside msg.payload.
Next, we would add a change function and connect it from the json converter to the Date/Time node as seen:

Double click the change function node and add in the following:

The code format can be copy paste from below.
| $now('[D01].[M01].[Y0001], [H01]:[m01]:[s01]', '+0800' ) |
This code just formats the timestamp to show the day month year followed by hours minutes seconds with respect to UTC+8 time region.
Next, double click the second text node and add in the following:
The Value format is: {{msg.payload["m2m:rsp"].pc["m2m:cin"].con.substring(24,25)}}
This format is as explained earlier to extract the port number out by parsing it through a string.

Next, double click on the led node and add in the following:

*Note: This toggles the LED state in the dashboard.
For example, if LED state is turned ON, payload 01 is received, LED turns on in RED.
Next, double click the text node on the right of the led node and add the following:

Overall, we should be having the overview as seen below.

Now we will configure the charts and gauges for our sensor data. There are a total of 4 charts and 5 gauges. 4 charts and 4 gauges will be used for pressure, temperature, humidity and light whereas the last gauge will be used for the battery level.
Let us configure the first set of chart and gauge nodes for pressure sensor data as seen below.

Next, let us configure the temperature chart and gauge nodes.

Next, let us configure the humidity chart and gauge nodes.

Next, let us configure the light chart and gauge nodes.

Lastly, let us configure the battery gauge node.

Since the battery data is an indication from value 0-254, we have to add in a range node to map the value 0-254 to 0%-100%.
So firstly, let us add the range node as seen below.

Double click the range node and configure it as seen below.

Next, we will connect all the nodes properly as follows:

*Note: Each output from the data decoder functions represents each data parameter.
Next, we will be adding a button for us to clear all the data from the dashboard.

*Note: Ensure that the button node does not join to any wires!
Double click on the button node and add in the following:

Next, connect the clear dashboard button node to all the nodes as seen below.

This clear dashboard button is added to clear all data from the dashboard if wanted by end user
Finally, we will proceed to organizing the layout of our dashboard.
Click on the arrow down under the deploy and dashboard buttons and click Dashboard.

Hover over the IoT Dashboard tab and click on layout.

The dashboard layout editor will appear. Click and move around the nodes to your preference.

Sample layout:

After organizing the nodes, click on done, deploy and dashboard button. The sample dashboard should appear nicely with data pushing into the dashboard as seen below.
