Docker image for SBFspot. For more documentation about this project see https://github.com/SBFspot/SBFspot.
Typically you create a container which is run every x minutes to collect data from your inverter. Next you (optionally) create another container which will upload data to pvoutput.org.
Supported architectures: amd64, arm64, arm v7 Raspberry PI
sudo groupadd -g 2000 sbfspot
sudo useradd -m -u 2000 -g 2000 -s /bin/bash sbfspot
sudo -iu sbfspot
mkdir config
mkdir data
sudo dpkg-reconfigure tzdata
Note: these instructions were tested on ubuntu 20.04 for pi.
Install bluetooth (if not done already)
sudo apt install bluetooth pi-bluetooth
sudo reboot
sudo bluetoothctl [-a]
[bluetooth]# default-agent
[bluetooth]# agent on
[bluetooth]# scan on
<... note MAC address of SMA inverter>
[bluetooth]# pair <MAC address>
[bluetooth]# trust <MAC address>
[bluetooth]# exit
Install docker (if not done already)
sudo apt install docker.io
sudo docker pull solarexplorer/sbfspot-sqlite
docker run -it --rm \
-v /etc/localtime:/etc/localtime:ro \
-v ~sbfspot/data:/var/smadata \
-v ~sbfspot/config/SBFspot.cfg:/opt/sbfspot/SBFspot.cfg \
--device=/dev/tty \
--net=host \
solarexplorer/sbfspot-sqlite /opt/sbfspot/SBFspot -v -finq -nocsv -nosql
docker create -t \
-v /etc/localtime:/etc/localtime:ro \
-v ~sbfspot/data:/var/smadata \
-v ~sbfspot/config/SBFspot.cfg:/opt/sbfspot/SBFspot.cfg \
--device=/dev/tty \
--net=host \
--name sbfspot-daydata \
solarexplorer/sbfspot-sqlite /opt/sbfspot/SBFspot -v -ad1 -am0 -ae1
docker create -t \
-v /etc/localtime:/etc/localtime:ro \
-v ~sbfspot/data:/var/smadata \
-v ~sbfspot/config/SBFspot.cfg:/opt/sbfspot/SBFspot.cfg \
--device=/dev/tty \
--net=host \
--name sbfspot-monthdata \
solarexplorer/sbfspot-sqlite /opt/sbfspot/SBFspot -v -sp0 -ad0 -am1 -ae1 -finq
docker run -dt --restart=unless-stopped \
-v /etc/localtime:/etc/localtime:ro \
-v /home/sbfspot/data:/var/smadata \
-v /home/sbfspot/config/SBFspotUpload.cfg:/opt/sbfspot/SBFspotUpload.cfg \
--name sbfspot-uploader \
solarexplorer/sbfspot-sqlite /opt/sbfspot/SBFspotUploadDaemon
If you want the SBFspot collector container to be run automatically you can use standard crontab functionality to run it at set intervals;
Run the following command as root:
(crontab -u sbfspot -l 2>/dev/null; echo "*/5 5-23 * * * docker start -a sbfspot-daydata > /dev/null 2>&1") | crontab -u sbfspot -
or:
sudo -iu sbfspot
crontab -e
and edit the crontab file by adding the following line:
*/5 5-23 * * * docker start -a sbfspot-daydata > /dev/null 2>&1
Setup QEMU
docker run --rm --privileged tonistiigi/binfmt:latest --install all
Build image and load into local docker.
docker buildx create --name all --platform linux/amd64,linux/arm64,linux/arm/v7
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm/v7 -t solarexplorer/sbfspot-sqlite --load .