- Status: ✅ Active
- Contributors: @scottsweb
- Description: Solar hosting with a Raspberry Pi Zero.
- Author: Scott Evans
- Author URI: https://scott.ee
This repo holds some code that will be useful if you wish to host a static website on a solar powered Raspberry Pi.
The compose.yaml can be used to re-create the hosting environment. The web server is Static Web Server and is perfect for a low powered device like the Pi. You'll need to add your Cloudflare tunnel key to the .env file where indicated. I use Podman, but Docker should be fine too.
The battmon folder contains a Python script that calculates the battery percentage, battery voltage, load, uptime and CPU temperature and then outputs it as JSON to be read by your website.
You'll need to initialise a Python venv and then install the required packages:
cd battmon
python3 -m venv .
./bin/pip install -r requirements.txtThe battmon.service file can be added to /etc/systemd/system/ and enabled with sudo systemctl daemon-reload, followed by sudo systemctl enable --now battmon.service.
The deploy.sh script is used to clone and deploy my website to two Raspberry Pi hosts (one solar, one backup).
This project is ongoing and a full write up and hardware requirements can be found on my website:
https://scott.ee/project/solar-hosting-raspberry-pi/
My site is the one being served from the solar Pi!
