I. InfluxDB & Node-RED & MQTT Tutorial: How to install InfluxDB
Store your data with Influx by using Node-RED and the MQTT
23 September, 2021 by
I. InfluxDB & Node-RED & MQTT Tutorial: How to install InfluxDB
Boot & Work Corp. S.L., Fernandez Queralt Martinez

Introduction

InfluxDB is an open-source time-series database (TSDB), written in Go and optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics.

In this blog post, we are going to install InfluxDB and create an InfluxDB database in order to store data coming from MQTT through Node-RED.

Related links


How to install
Mosquitto

Read >>>


How to connect Raspberry PLC to WiFi

Read >>>


Raspberry PLC configurable

See >>>


MQTT & Raspberry PLC & Node-RED

Read >>>


How to find your perfect industrial PLC

Read >>>


Raspberry Pi based Panel PC products

See >>>

Requirements

What is Node-RED and how does it work?

Node-RED is a programming tool for wiring together hardware devices, APIs, and online services in new and interesting ways.

It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.

Know more about Node-RED >>>

What is InfluxDB used of?

InfluxDB is a time series platform that empowers developers to build IoT, analytics and monitoring software.

It is purpose-built to handle the massive volumes and countless sources of time-stamped data produced by sensors, applications and infrastructure.

What is 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 >>>

Install InfluxDB

Now we know a little bit more about the tools that we are going to use, we are going to install InfluxDB on our Raspberry Pi industrial PLC.

1. First of all, update the aptitude package:

sudo apt update


2. Then, add the InfluxDB repository key to our industrial Raspberry Pi PLC in order to allow the package manager on Raspbian to search the repository and verify the packages installed.

 wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -

3. Add the repository to the sources list

echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

4. Update the package list again.

sudo apt update


5. Install InfluxDB onto your open source PLC Raspberry Pi:

sudo apt install influxdb


6. Enable InfluxDB to start at boot on your Raspberry Pi automation.

sudo systemctl unmask influxdb
sudo systemctl enable influxdb
sudo systemctl start influxdb

Finally, start InfluxDB by typing influx in the commandline of your Raspberry PLC:

influx

Influx - I. InfluxDB & Node-RED & MQTT Tutorial: How to install InfluxDB

How to create an InfluxDB database

As InfluxDB comes without any database by default, we are going to create the first one, called test. Into this influx prompt, follow the next steps:

1. Create a database called test

create database test

2. Go into the database:

use test

3. Now , we will show everything from the database with the command below. We will see that obviously is empty. We just do this step in order to make sure what it contains right now.

select * from test


Now that you have been able to create your first database with InfluxDB, let's continue with inserting data from Node-RED!

Want to know how? 

Continue >>> 

I. InfluxDB & Node-RED & MQTT Tutorial: How to install InfluxDB
Boot & Work Corp. S.L., Fernandez Queralt Martinez
23 September, 2021
Share this post
Archive

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 >>>

Do you want more information?

Just fill the form!

Tell me more!