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
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
and after clicking on the menu on the right, choose to import the json from the clipboard
At the next screen, choose to import the json file into a new flow
Once 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
The connections to the dbs and mosquitto are shown
Below is the MySql setting, accessed by clicking the mouse twice on ESPMYSQL
Update button updates the node.
To make the flows operational click on 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