solarcene_community_setup/custom_50x
smallsolar 723b21084f Update custom_50x/readme.MD 2024-12-04 09:38:57 +00:00
..
example_custom_50x.html Add custom_50x/example_custom_50x.html 2024-12-03 19:41:07 +00:00
nginx.setup Add custom_50x/nginx.setup 2024-12-03 19:40:13 +00:00
readme.MD Update custom_50x/readme.MD 2024-12-04 09:38:57 +00:00
solar_monitor.py Add custom_50x/solar_monitor.py 2024-12-03 19:45:53 +00:00
solar_monitor.service Add custom_50x/solar_monitor.service 2024-12-03 20:08:49 +00:00
solarcene_50x.jpg Upload files to "custom_50x" 2024-12-04 09:35:43 +00:00

readme.MD

Introduction

When the main solarcene.community server is offline a custom 50x html error page is served by the gateway NanoPi so that a visitor doesn't just get an error page. The custom page is generated by the solar monitoring script (solar_monitor.py) and is written every 10 minutes. The page itself contains some general stats and a bit of information to explain the situation.

Design

In the solar_monitor.py script the write_html() function grabs the latest solar data (from the vedirect serial connection to the Victron SmartSolar MPPT Charger) which are stored in the redis database. It then simply overwrites the custom file with hardcoded html. I've got a scheduler that just runs this job every 10 minutes.

Installation

  • Install the requirements for the solar_monitor.py script (redis, vedirect, apscheduler), recommended to be put in venv environment.
  • Add the code from nginx.setup to your nginx file
  • Setup solar_monitor.py to run, I use a systemd setup (see solar_monitor.service)

Example

example_image