Skip to content

scottsweb/solar-host

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Host

Solar Host

About

This repo holds some code that will be useful if you wish to host a static website on a solar powered Raspberry Pi.

Web Server

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.

Battery Monitor

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.txt

The 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.

Deployment

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!

About

✅ Solar hosting with a Raspberry Pi Zero.

Resources

License

Stars

Watchers

Forks

Contributors