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
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
With Add data source you access the Data Source screen, from which you can choose InfluxDB and MySql
Below the settings for InfluxDB and MySql
MySqlThe two connections are listed in the datasource configuration
Below there is the export of the two Dashboards used in the article to be imported on your system with the Import button
Here is the ESPRealtime Dashboard screen with the data available on the InfluxDB
To view the data history, we use MySql data in the ESPHistory Dashboard