Welcome to Sunportal! A visualizer for data stored in SBFspot. This tool was made for showing solar power statistics on a screen connected to a Raspberry Pi, although it will run on other systems as well. The interface is made for one screen height, this means that you don't need to scroll to see all content, perfect for creating a "status" monitor in your house or other place.
Sunportal was first made with bare PHP code but is now running on Flask, this makes it easier to setup and maintain.
You have a couple of choices regarding installation, you can try and run the Flask app that is in this repository yourself. This gives you full control over where and how to run it, alternatively there is a docker image available on docker hub. This allows you to run only the Flask application and connect a webserver to it (the docker container uses uWSGI). The last and most easy way to set up this application is using the docker-compose file in this repository, below are the instructions on how to do that.
Note that the files in this repository are made for running on a raspberry pi and the default locations that SBFspot uses on these machines. This means that if you are installing this software somewhere else, you might need to change some settings.
- Install SBFspot. A great guide for the installation of SBFspot can be found here.
- Install Docker, the most easy way to install docker is to use the following command:
curl -sSL https://get.docker.com | sh
. - Docker might ask to add the
pi
user to the Docker group, please do so by executingsudo usermod -aG docker pi
(this might be different on other systems). After executing this command, log out and log back in again. - First make sure
pip3
is installed:sudo apt install python3-pip
. - Now install
docker-compose
, this allows us to use the configuration file in theSunPortal
repository. Runpip3 install docker-compose
. - Now try to see if
docker-compose
works, rundocker-compose version
to see ifdocker-compose
is working. Ifdocker-compose
is not working, try to adddocker-compose
to PATH. Executeexport PATH=$HOME/.local/bin:$PATH
to add it for this session, executeecho 'PATH=$HOME/.local/bin:$PATH' >> $HOME/.profile
to add it permanently to PATH. If you use the last method you need to log out and log back in again. - The hard part is done! Now clone this repository
git clone https://github.com/KiOui/SunPortal.git
and go to the repository foldercd Sunportal
. - The
docker-compose.yml
file contains information about the containers we are about to start. The default settings are already inside thedocker-compose.yml
configuration file. If you need to adjust them, opendocker-compose.yml
(nano docker-compose.yml
) and adjust the settings. Particularly, the location of the database is stored underservices > sunportal > volumes > - /home/pi/smadata/SBFspot.db:/sunportal/db/database.db
. Adjust the/home/pi/smadata/SBFspot.db
part to the location of theSBFspot.db
database on your system if it is different. - Now, inside the
SunPortal
folder, rundocker-compose up -d
to start the docker containers. They will first start downloading and then begin running. If the command finished succesfully, check the raspberry pi server to see if it worked! The webserver should be running on port 80. - It might be that the docker image causes the permissions on SBFspot.db to change, in order to prevent SBFspot not being able to write to the database, you could add the
pi
user to thewww-data
group and change the permissions on SBFspot.db. Runsudo usermod -aG www-data pi
andsudo chmod 666 /home/pi/smadata/SBFspot.db
.