In this guide I will show you, how you can create your own graph solution in a few easy steps, without in-depth knowladge of Linux.
Reasons
When you buy an electronic hydrometer, you need a system where you can store and visualize the gathered data. Most people uses already existing products for this, such as Ubidots. This is an easy and fast way to use your newly purchased device. The other route is to host your own data visualization solution, both of these systems has their pros and cons.
Softwre Services | Self Hosted | |
---|---|---|
Registration | Usually needed | Not needed |
Fee | Free with limitations/paid | No payment required |
Hardware requirements | Electric Hydrometer | Electric Hydrometer + Raspberry Pi 3 or newer |
Maintenance | No maintenance needed | Maintenance is needed |
Control | Limited by the license | Full control |
Backup | Backup is usually handled by the provider | You have to backup the data |
Getting the Pi ready
If you have a raspberry pi, with an already working raspberry pi OS system, you can skip this step.
First of all, we need to install the official OS to the raspberry pi. To do this, we need to insert the SD card to the computer we are using and download the Raspberry Pi Imager from the official site. With this tool we can install the Raspberry PI OS (32-Bit) to the SD card.
After the installation process is done, put the SD card into the raspberry pi and connect your preferd peripherals to the device.
Installing the Visualization Engine
First we need to open a terminal window, by clicking the icon on the system tray.
In the terminal window, we execute the following commands in order:
sudo mkdir ~/visualization_engine && cd ~/visualization_engine
sudo curl -L -o ~/visualization_engine/visualization-engine.tar.gz "https://github.com$(curl -s -L https://github.com/Akos-Kreutz/homebrew-visualization-engine/releases/latest | grep -o '/Akos-Kreutz/homebrew-visualization-engine/archive/refs/tags/.*.tar.gz')"
sudo tar --strip-components=1 -zxf visualization-engine.tar.gz
sudo chmod 755 visualization_engine.py visualization_engine.sh
This should resort in an output like this:
After this we need to start the installation process by starting the script. You need to provide your own password after the -p tag. This password will be used to access Grafana. It’s important, that we put the extra space before the sudo keyword. Example:
sudo ./visualization_engine.sh -p test123
The output should look like this:
We can check if the installation was succesfull by opening the browser and entering the following address: https://localhost:3000/login. The Grafana webpage should load. To enter the application, we need to enter the admin username and the password define during the script execution.
Configuring the engine
Only a few steps remaining before we can use the engine. First we need to create an admin user for the InfluxDB. To this we need to open a new terminal window. In this window we execute the following commands, here you will need to provide another password:
influx
show users
CREATE USER admin WITH PASSWORD <YOUR PASSWORD> WITH ALL PRIVILEGES
show users
After the last command you ned to press ctrl + d to leave the influxDB. The output should be similar to this:
Now we need to update the already created influxDB datasource with the admin credentials. On the Grafana admin page go to Configuration -> Data Sources and select InfluxDB.
Enable Basic auth, set the User admin and the password we added previously with the CREATE USER command.
After this press Save & test
And with that, we created our own system which can show the data provided by our electronic hydrometer, In the next guide I will show you how to connect an iSpindel to this system.