Create an IoT ThingsBoard Dashboard with Raspberry Pi PLC & MQTT

Add a GUI Dashboard to your IoT open-source projects and learn how to better manage your data
November 10, 2021 by
Create an IoT ThingsBoard Dashboard with Raspberry Pi PLC & MQTT
Boot & Work Corp. S.L., Fernandez Queralt Martinez

Introduction

The type of open-source license is becoming more and more common in industry 4.0. Whether they are open source projects, such as open-source hardware or open-source software, they turn out to be more and more searched words on Google.

In today's post, we will create a dashboard for open-source software, such as ThingBoard.io, through which we can visualize the data of our application with IoT through MQTT.

Latest Posts

Your Dynamic Snippet will be displayed here... This message is displayed because you did not provided both a filter and a template to use.

MQTT

MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT today is used in a wide variety of industries, such as automotive, manufacturing, telecommunications, oil and gas, etc.

Know more >

DASHBOARD

A dashboard is an information management tool used to track, analyze, and display key performance indicators, metrics, and data points such as sensor values, among others.

Dashboard - Create an IoT ThingsBoard Dashboard with Raspberry PLC & MQTT

THINGSBOARD

ThingsBoard is an open-source IoT platform for data collection, processing, visualization, and device management.

It enables device connectivity via industry standard IoT protocols - MQTT, CoAP and HTTP and supports both cloud and on-premises deployments. ThingsBoard combines scalability, fault-tolerance and performance so you will never lose your data.

Know more >

Tutorial

So, once we know what is the ThingsBoard open-source platform, let's follow these steps in order to create our dashboard:

  1. Install ThingsBoard on industrial Raspberry PLC >
  2. Install Docker:
    1. sudo apt-get update && sudo apt-get upgrade
    2. curl -sSL https://get.docker.com | sh
    3. sudo usermod -aG docker ${USER}
    4. groups ${USER}

  3. Start with ThingsBoard >
    1. Follow step 1
    2. Follow step 2
    3. Select MQTT
    4. Install Mosquitto in your industrial Raspberry Pi PLC
    From your Raspberry Pi industrial PLC with the Mosquitto installed, you will have to run the following command:

    mosquitto_pub -d -q 1 -h "IP-HOST-ADDRESS-HERE" -p "1883" -t "v1/devices/me/telemetry" -u "ACCES-TOKEN-HERE" -m MESSAGE-HERE

    If you go to "Devices", in the line where your device is, there is a shield at the right-side. If you select "Access token", you can modify it or get it from there in order to set it after the -u parameter.

    In the -h parameter, add the hostname. In our case, we will set the IP address of the open source PLC Raspberry Pi: 10.10.10.20.

    So:
    mosquitto_pub -d -q 1 -h "10.10.10.20" -p "1883" -t "v1/devices/me/telemetry" -u "is-access-token" -m {"temperature":23}
Thingsboard - Create an IoT ThingsBoard Dashboard with Raspberry PLC & MQTT

Go back to your PC and follow the steps until step 3.4, in order to add a chart widget with the incoming data from MQTT.

Chart widget - Create an IoT ThingsBoard Dashboard with Raspberry PLC & MQTT

👉Now, keep following the steps and create your own ThingsBoard application via MQTT & Raspberry PLC! >>> 

​Search in our Blog

Create an IoT ThingsBoard Dashboard with Raspberry Pi PLC & MQTT
Boot & Work Corp. S.L., Fernandez Queralt Martinez November 10, 2021

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>