Tag Archives: chronograf

Sensors Monitoring – Grafana Configuration

After configuring nodered to forward the data to the databases, temperature and humidity sensors are used with ESP8266, as already seen in the previous articles

Mqtt with Beaglebone and ESP8266 – Articles List

Below is the firmware used and the code for sending data from the ESP8266 nodes

ESP8266 Firmware

ESP8266 Temp-Hum

Inside the zip file there is a script to upload the firmware to the COMX port (to be modified with your COM port) on windows.

In the LUA code instead it is necessary to enter the settings of your wireless router, the mqtt ip address, the room settings, replacing roomx, with room1, room2,etc.

You can then set Grafana, accessing the Dashboard, adding Mysql and InfluxDB as data sources

grafanaSourceWith Add data source you access the Data Source screen, from which you can choose InfluxDB and MySql

grafanaAddSourceBelow  the settings for InfluxDB and MySql

InfluxDB

InfluxDBESPMySqlMySqlESPThe two connections are listed in the datasource configuration

AllDataSourceBelow there is the export of the two Dashboards used in the article to be imported on your system with the Import button

importDashboards

Dashboards

Here is the ESPRealtime Dashboard screen with the data available  on the InfluxDB

RealTimeGrafanaTo view the data history, we use MySql data in the ESPHistory Dashboard

HistoryGrafana

 

 

Sensors Monitoring – Nodered Configuration

At this point we set nodered to read the messages on Mosquitto and insert the data into InfluxDB and MySql.

Below the json file to be imported into nodered

Nodered Json

This flow is functional to the explanation of the functioning of the architecture as a whole; the flow must be optimized by programming nodered so as to automatically generate the information of the nodes from which the data arrives without resorting to different nodes for each sensor.

To execute the import proceed as follows, after accessing nodered

http://dashboardora.local/nodered

and after clicking on the menu on the right, choose to import the json from the clipboard

importFlowsAt the next screen, choose to import the json file into a new flow

flowOnce imported, set the credentials to access MySql and InfluxDB, selecting Configuration nodes from the menu on the right and setting the user account and password

configureNodesThe connections to the dbs and mosquitto are shown

configureNodesDBBelow is the MySql setting, accessed by clicking the mouse twice on ESPMYSQL

MySqlSettingUpdate button updates the node.

To make the flows operational click on Deploy

deploy

Now, with nodered we take the contents of the various mqtt topics and insert them into MySql and InfluxDB.

In the next article we display these data in Grafana

Sensors Monitoring – Grafana Configuration

Sensors Monitoring – InfluxDB Configuration

After MySql tables creation

Sensors Monitoring – MySql Configuration

we have to create a database  on InfluxDB.

The first step is to activate an administrative user on the system, as described in the link

Authentication and Authorization

InfluxDB  is accessed from the local client by running the influx command from a shell

Run

In the file /etc/infuxdb/influxdb.conf, using the root user or the sudo command, the auth-enabled parameter is set from false to true

Restart influxdb

Using a command shell on Debian  create the database DATAESP with the following commands

Enter the admin credentials to the auth command and proceed to create the database

Below is the result of the commands listed above

datainfluxdb

For the management of the Influxdb database, it is possible to use Chronograph

Chronograph

The Chronograph download is available at the link

Chronograph Download

Installation can be performed in two ways.

Application start

Log in with the monitor user and in a command shell

Start the chronograf application

 

Start as a Service

Log in with the monitor user; use a command shell to execute

In the /opt/chronograf/usr/lib/chronograf/scripts folder there are scripts for the automatic start of chronograf.

Here are the operations performed in our system:

  • Copy /opt/chronograf/usr/lib/chronograf/scripts/init.sh into /etc/init.d/chronograf and assign execution permissions

  • Copy /opt/chronograf/usr/lib/chronograf/scripts/chronogaf.service  into /etc/systemd/system/chronograf.service

Change in both files the user and path of the various chronograf components, i.e. change the user to monitor and the paths that point to /opt/chronograf

Below is the link to the modified files

Automatic Startup Chronograf

After the modifications run

To enable it at startup and start it run

After starting chronograf in one of the ways described above, it can be accessed via browser and port 8888

http://dashboardora.local:8888

ChronografPress Get Started and set the connection and the credentials of the admin user with relative password defined before

Chronograf2conSet up the Influxdb dashboard

ChronografDashboardDo not set the Kapacitor component

Chronograf3Complete the configuration and by clicking on View All Connections

Chronograf4we access to the newly created connection

ChronografConnections

This component can be useful later to manage and monitor InfluxDB.

In the next article, we ‘ll define the rules on Nodered to populate MySql and InfluxDB databases with the data sent by the sensors

Sensors Monitoring – Nodered Configuration