Sign inSign up

solarexplorer/sbfspot-sqlite

By solarexplorer

•Updated almost 4 years ago

SBFspot image compiled with sqlite to run on raspberry pi or x86 os

Image
0

5.6K

solarexplorer/sbfspot-sqlite repository overview

⁠SBFspot multi-arch docker image

Supported architectures: amd64, arm64, arm v7 Raspberry PI

⁠1. Create a local user

sudo groupadd -g 2000 sbfspot
sudo useradd -m -u 2000 -g 2000 -s /bin/bash sbfspot

⁠2. Set your time zone

sudo dpkg-reconfigure tzdata

⁠3. Setup Bluetooth

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

⁠4. Setup Docker containers

⁠4.1 Test inverter connectivity
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
⁠4.2 Create SBFspot daily collector container
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
⁠4.3 Create SBFspot monthly collector container (optional)
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
⁠4.4 Run SBFspot PVoutput uploader (optional)
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

⁠5. Configure crontab on Docker host

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

Tag summary

Content type

Image

Digest

sha256:319d75345…

Size

110.6 MB

Last updated

almost 4 years ago

docker pull solarexplorer/sbfspot-sqlite