How to set up a raspberry pi to retrieve data from an SMA inverter over the network using SBFspot and its one line installer, upload the result to PVoutput and run periodical backups to a network share.
- Flash an SD with the reccomended Lite Distro for raspberry pi, in this case Stretch Lite
- Add an empty file called
ssh
to the boot partition of the SD - Boot the raspberry pi and wait
- Find the raspberry pi's IP address in the router at
192.168.1.1
, also find the IP of the Inverter - Assign it a static ip adress, in my case
192.168.1.125
- SSH into it at
192.168.1.125
and runsudo raspi-config
, expand filesystem, set locales and change password etc. - Reboot
- Run
sudo apt-get update && sudo apt get upgrade -y
- Reboot
- Run
curl -s https://raw.githubusercontent.com/sbfspot/sbfspot-config/master/sbfspot-config | sudo bash
- Progress through the steps using
space bar
to select options from lists andenter
to confirm - Use your apikey from PVoutput and your array ID from PVoutput, explore the other options as appropriate, in mycase we use speedwire, not bluetooth.
SBF spot should be set up now It will have automatically set up the following crontab (on the pi user)
## SBFspot
*/5 6-22 * * * /usr/local/bin/sbfspot.3/daydata
55 05 * * * /usr/local/bin/sbfspot.3/monthdata
To force a one off collection of historical data run /usr/local/bin/sbfspot.3/SBFspot -v -ad200 -am8 -finq
(8xmonthly data and 200 daily datas, unlikely that the inverter will have stored this much)
N.B PVoutput will only accept 14 days of historical data unless you have donated, in which case it will accept 90 days
mkdir /home/pi/DSmount
sudo cp /etc/fstab /etc/fstab.old
sudo nano /etc/fstab
- add this line
//192.168.1.122/homes/WeatherAndSolarData/piNew /home/pi/DSmount cifs credentials=/root/.fstabcreds,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=1,vers=3.0 0
sudo nano /root/.fstabcreds
username=<your diskstation username>
password=<your diskstation password>
sudo mount -av
to test the mounting process- now reboot and confirm automounting on start up
sudo crontab -e
then add55 22 * * * cp -r /home/pi/smadata/* /home/pi/DSmount/
to the root user's crontab
sudo nano /etc/rsyslog.conf
and add*.* @192.168.1.122
to the end
PV output will not recognise the new inverter's serial number The SBFspot upload daemon
sudo nano /usr/local/bin/sbfspot.3/SBFspotUpload.cfg
YYYYYY is the serial number of the old inverter and so must be updated to the serial number of the new inverted
Then restart the Pi
# For detailed configuration info, refer to SBFspotUpload.default.cfg
#
LogDir=/var/log/sbfspot.3
PVoutput_SID=YYYYYYYY:XXXXX
PVoutput_Key=
SQL_Database=/home/pi/smadata/SBFspot.db
# End of Config