This post is dedicated to graphing the data logged by the Electrodacus SBMS0, so if that interests you, please continue.
I’ve had some feedback from others after the first post 1 and wanted a bit more automation myself, so what I have done to help out with getting data logging up and running more quickly was develop a simple python script to install and configure all pieces on the Raspberry Pi.
I’ve only had the chance to test this out on a single new Raspberry Pi and these were the manual steps needed to get things going:
- Get Raspbian Lite installed on a microSD card (I found it needs >2Gb for everything, I think 4Gb would be fine), other versions should also work. I use the Raspberry Pi Imager https://www.raspberrypi.org/downloads/
- Either plug in a network cable or connect to Wifi, I recommend wifi for ease of install, but you will need to configure it: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md
- Enable SSH on the Pi so you can get into it remotely (you will also need an SSH client like Putty), https://www.raspberrypi.org/documentation/configuration/raspi-config.md
- Once you are able to log in to your Pi you will want to run the following commands:
sudo mkdir /home/SBMS0
cd /home/SBMS0
sudo wget -O SBMS_Pi_install.py https://raw.githubusercontent.com/Burtond/Electrodacus/master/SBMS_Pi_install.py
sudo python SBMS_Pi_install.py
The above code does the following:
Line 1-2: Creates an SBMS folder for storing config files and scripts
Line 3: Gets the install code from my GitHub repo
Line 4: Runs the install code that installs: Pi updates, InfluxDB, Grafana, Python script as a service for SBMS0 data parsing. This step takes a while due to all of the Raspberry Pi updates.
The next step is to create a dashboard! The script should remind you what URL you need to hit to log in, but it should be https://<Pi IP address>:3000. The default username and password for Grafana at the time of this post is admin/admin. I wasn’t able to find a quick way to get the dashboard imported, but the dashboard is meant to be custom for your needs anyway. I have posted a version of mine with some examples to help folks get going and it’s really easy to Import a dashboard in Grafana and simple paste the JSON content from my example dashboard here: https://raw.githubusercontent.com/Burtond/Electrodacus/master/SBMS-Grafana%20Dashboard.json
Steps for dashboard import:
- Hover over Dashboards icon on right, select Manage
- Select Import
- Copy the text from the above URL and paste it into the “Import via panel json”
- Select Load
At this point you should have a dashboard with a number of metrics, but it will only populate if you have data coming from SBMS0 plugged into the SBMS via USB. You will also need UART enabled (USART Data Log = 1). I left the baud rate and Log interval at their default. More details on the manual: https://electrodacus.com/SBMS0/SBMS0.pdf