Coder Social home page Coder Social logo

kioui / sunportal Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 5.36 MB

A web based visualization of information stored in the database of SBFspot (for raspberry pi).

Home Page: http://sunportal.nl

License: MIT License

Python 0.75% CSS 0.24% JavaScript 98.48% Dockerfile 0.15% Shell 0.12% HTML 0.25%
solar sbfspot raspberrypi raspberry-pi sma visualisation visualization sun sunportal solarpower docker web

sunportal's Introduction

Sunportal

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.

Installation on raspberry pi (and other systems)

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.

  1. Install SBFspot. A great guide for the installation of SBFspot can be found here.
  2. Install Docker, the most easy way to install docker is to use the following command: curl -sSL https://get.docker.com | sh.
  3. Docker might ask to add the pi user to the Docker group, please do so by executing sudo usermod -aG docker pi (this might be different on other systems). After executing this command, log out and log back in again.
  4. First make sure pip3 is installed: sudo apt install python3-pip.
  5. Now install docker-compose, this allows us to use the configuration file in the SunPortal repository. Run pip3 install docker-compose.
  6. Now try to see if docker-compose works, run docker-compose version to see if docker-compose is working. If docker-compose is not working, try to add docker-compose to PATH. Execute export PATH=$HOME/.local/bin:$PATH to add it for this session, execute echo '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.
  7. The hard part is done! Now clone this repository git clone https://github.com/KiOui/SunPortal.git and go to the repository folder cd Sunportal.
  8. The docker-compose.yml file contains information about the containers we are about to start. The default settings are already inside the docker-compose.yml configuration file. If you need to adjust them, open docker-compose.yml (nano docker-compose.yml) and adjust the settings. Particularly, the location of the database is stored under services > sunportal > volumes > - /home/pi/smadata/SBFspot.db:/sunportal/db/database.db. Adjust the /home/pi/smadata/SBFspot.db part to the location of the SBFspot.db database on your system if it is different.
  9. Now, inside the SunPortal folder, run docker-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.
  10. 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 the www-data group and change the permissions on SBFspot.db. Run sudo usermod -aG www-data pi and sudo chmod 666 /home/pi/smadata/SBFspot.db.

sunportal's People

Contributors

dependabot[bot] avatar kioui avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sunportal's Issues

Thanks and question regarding licence

Hi @KiOui,

I found your repo yesterday and it's just perfect for my needs. So many thanks to you for sharing your code!

I forked your repo and already made some adjustments for my needs like multi inverter support and some styling and naming things. I also plan to migrate your code to node.js to be able to load data in the background and just push updates via websockets. In this case I can trigger SBFspot from within the backend code and update the clients afterwards.

Anyways, I would like to share your code with my changes under an appropriate licence. In general I use the MIT licence, would this be okay for you?

Best regards,
Philipp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.