Tutorial – Build a Kibana dashboard to monitor your LoRa gateways
You have your own LoRa gateways and want to supervise them ? You can build an entire dashboard on Kibana within a few minutes. Learn how with our tutorial.
In a previous tutorial, we explained how to make a Kibana dashboard that keeps track of LoRa devices’ KPI. In this step-by-step tutorial, we focus on building a dashboard to monitor LoRa gateways.
Devices’ uplinks are enriched with information about gateways, it allow us to build the following dashboard:
In this tutorial, we will explain how to create each panel, then we will show you how to assemble them on a dashboard. Finally we will talk about how to use your dashboard.
What you need
For this tutorial you need your private gateways and LoRa devices communicating to Live Objects through your gateways. Kibana is provided by Live Objects and your data can already be accessed through it, so you do not need anything else.
Step 1: Open Kibana
On the Live Objects portal, go to the “Data/Kibana” section and click on the “Kibana” button.
Kibana is an option of LoRa Premium offer. If you cannot access Kibana, please contact us so we can add this option to your account.
Step 2: Create a filter for LoRa messages
Gateway data is included in LoRa devices’ messages, however other messages can be present in Kibana such as events from the Simple Events Processing. In this step, we create a filter to base our dashboard on LoRa messages. This is the same filter as the one in the devices dashboard tutorial, so you can skip this step if you already set it up.
Enter the “Discover” menu.
By default it shows all messages received in the selected time window, however we only need messages from LoRa devices. So type “metadata.connector:lora” in the search bar to filter messages.
Then click on the “Save” button in the top right corner, type a name such as “LoRa messages” and click on Save.
In the next step, we will use this saved search in every panel.
Step 3: Create your panels
Enter the “Visualize” menu and click on the “+” button to create your first panel as shown in the following image.
Gateways and devices counter
For the first panel, we build a simple metric visualization that shows:
- the total number of gateways
- the number of gateways that were selected as “best”
- the number of communicating devices
Select the “Metric visualization. In the next page, click on the “LoRa messages” search that you saved earlier.
The left column allows you to configure the metric that appears on the right.
Select a “Unique Count” aggregation on the “metadata.network.lora.bestGatewayId” field and type a custom label such as “Gateways selected as best”.
Then click on “Add metrics” and configure a second “Unique Count” aggregation on “metadata.lora.gateways.id”, this is the total number of gateways.
Again, click on “Add metrics” to add a third metric, select the “Unique Count” aggregation on the “metadata.source” field, this is the number of communicating devices.
The configuration should look like the one in the following image.
In addition, you can change the visual aspect of the panel in the “Options” tab, here we set the Font Size to 37pt.
Click on the “Play” icon to apply the configuration.
Note that the panel’s resulting metrics are computed from the messages received in the time window shown in the page’s top right corner. Consequently, the number of gateways includes only gateways that received at least one uplink from a device in the time window.
As several gateways can receive the same uplink, the first one to receive it is selected as the “best gateway”.
To finish our panel, we need to save it:
- Click on “Save” in the top right corner
- Choose a name for the panel, it will help you find it later
- Click on “Save”
That’s all for the first panel, let’s build the second one.
Number of uplinks per gateway
For our second panel, we build a timeline showing the number of uplinks received by each gateway.
Enter the “Visualize” menu, click on the “+” button and choose the “Line” panel. Again, select the “LoRa messages” saved search as the source.
To create a timeline:
- under “buckets”, select the “X-axis” bucket type
- choose the “Date Histogram” aggregation
- set the field to “timestamp”
If you click on the play icon, you will see the timeline of the total number of uplinks. As we want our panel to show the details for each gateway, we will add another bucket.
Click on “Add sub-buckets” and “Split Series”. Then select the “Terms” sub aggregation and the “metadata.network.lora.bestGatewayId” field.
The “Size” configuration impacts the number of gateways that are shown for each timestamp, so you should set a value that is higher than the number of gateways that you own to make sure all gateways will appear in the panel.
After clicking on the play button, the graph shows one line per gateway.
Save your panel before building the next one.
Number of devices per gateway
We will now build a timeline of the number of devices communicating through each gateway. As this panel is very similar to the previous one, we suggest to copy it.
To do so, stay on the panel’s edition page and click on “Save”. Type a new name and select “Save as new visualization”. You now have a new panel with the same parameters as the previous one.
Modify the metric with a “Unique Count” aggregation on the “metadata.source” field.
Click on the play icon and save.
Most used gateways
This panel is a table showing the total number of uplinks received by each gateway and the number of devices communicating through it.
To build this panel, enter the “Visualize” menu, click on “+” and select the “Data Table” type.
The first metric is a “Count” aggregation. This is the number of uplinks so we suggest to type the Custom Label accordingly.
The second metric is a “Unique Count” agregation on the “metadata.source” field. Its Custom Label can be “Number of devices”.
For the bucket configuration, choose “Split rows” and select a “Terms” aggregation on the “metadata.network.lora.bestGatewayId” field. “GatewayId” can be used as the Custom Label.
Again, set the size to a value higher than the number of gateways you have so that all of them appear in this table.
Number of gateways per uplink on a map
We will build a map panel that will show where the uplinks come from and how many gateways received them. This map is useful to identify geographical regions with poor network coverage.
Enter the “Visualize” menu and create a new panel with the “Coordinate Map” type.
Configure the buckets from “Geo Coordinates” with a “Geohash” aggregation based on the “location.@geopoint” field. As a result, the map shows where the uplinks come from.
Now we modify the metric so the color of each point on the map corresponds to the number of gateways that received this uplink. To do so, select the “Average” aggregation on the “metadata.network.lora.gatewayCnt” field. Additionally, when you hover your mouse over the points the number appears, you can add a Custom Label such as “Number of gateways” to make it more understandable.
LoRa KPIs for each gateway
In this section we build 6 panels, one timeline for each KPI:
- Gateway count
- Signal level
- Signal Noise Ratio (SNR)
- Received Signal Strength Indicator (RSSI)
- Spreading Factor (SF)
- Estimated Signal Power (ESP)
These 6 panels are similar to the graphs shown in every LoRa device details page but are centered on gateways instead of devices.
As we already built two timelines, we can copy one of them to make our 6 new panels faster.
First, enter the “Visualize” menu and click on a timeline we built (Number of uplinks per gateway or Number of devices per gateway).
Then modify the metric with the following configuration:
- Aggregation: Average
- Field: metadata.network.lora.rssi
The buckets are already configured so we will not modify them.
Finally, click on “Save”, type a new name for the panel and select “Save as a new visualization” before saving.
Repeat these steps for the other KPIs, the corresponding fields are shown in the table below:
|Signal Noise Ratio (SNR)||metadata.network.lora.snr|
|Received Signal Strength Indicator (RSSI)||metadata.network.lora.rssi|
|Spreading Factor (SF)||metadata.network.lora.sf|
|Estimated Signal Power (ESP)||metadata.network.lora.esp|
Step 4: Assemble your dashboard
Configuring the panels was the hard part, assembling the dashboard is easier.
First, enter the “Dashboard” menu and click on the “+” button.
Then click on “Add” and select one of your panels, the panel will appear in the dashboard. Repeat this until all your panels are in the dashboard.
Finally, resize and move your panels to your liking. We recommend to place the panels that benefits the most to your business at the top of the dashboard so that you can see them at a glance.
Do not forget to save your dashboard.
Step 5: Use your dashboard to monitor your LoRa gateways
Any user of your tenant who is connected on the Live Objects’ portal can access Kibana and the dashboard you created. To do so they have to enter the “Dashboard” menu and click on your dashboard’s name.
Once they are on the dashboard’s page, they can select a time window in the top right corner or use the default one.
Besides, if there a lot of gateways and a user wants to supervise only one specific gateway, they can type the gateway’s ID in the search bar or click on the gateway in any panel.
You can help users who are not familiar with Kibana by providing instructions on the dashboard. To do so, create a “Markdown” panel and add it to your dashboard. In our example we placed this panel at the top.
In this tutorial, we built a Kibana dashboard to monitor LoRa gateways with 7 different panels.