Skip to content

Instantly share code, notes, and snippets.

@HarvsG
Last active June 22, 2020 12:32
Show Gist options
  • Save HarvsG/d8ded982f3e416c2cc199f1f45b6aa9e to your computer and use it in GitHub Desktop.
Save HarvsG/d8ded982f3e416c2cc199f1f45b6aa9e to your computer and use it in GitHub Desktop.
How to set up the solar data pi

SBFspot

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.

Set up SBF spot

  1. Flash an SD with the reccomended Lite Distro for raspberry pi, in this case Stretch Lite
  2. Add an empty file called ssh to the boot partition of the SD
  3. Boot the raspberry pi and wait
  4. Find the raspberry pi's IP address in the router at 192.168.1.1, also find the IP of the Inverter
  5. Assign it a static ip adress, in my case 192.168.1.125
  6. SSH into it at 192.168.1.125 and run sudo raspi-config, expand filesystem, set locales and change password etc.
  7. Reboot
  8. Run sudo apt-get update && sudo apt get upgrade -y
  9. Reboot
  10. Run curl -s https://raw.githubusercontent.com/sbfspot/sbfspot-config/master/sbfspot-config | sudo bash
  11. Progress through the steps using space bar to select options from lists and enter to confirm
  12. 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

Now set up fstab to automount network share on boot up

  1. mkdir /home/pi/DSmount
  2. sudo cp /etc/fstab /etc/fstab.old
  3. sudo nano /etc/fstab
  4. 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
  5. sudo nano /root/.fstabcreds
username=<your diskstation username>
password=<your diskstation password>
  1. sudo mount -av to test the mounting process
  2. now reboot and confirm automounting on start up
  3. sudo crontab -e then add 55 22 * * * cp -r /home/pi/smadata/* /home/pi/DSmount/ to the root user's crontab

Now set up syslog logging

  1. sudo nano /etc/rsyslog.conf and add *.* @192.168.1.122 to the end

Configuring for a new inverter

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment