SolarNest is an open-source solar panel production and battery monitoring system built for Raspberry Pi, written in Go, with a React dashboard frontend.
- Real-time solar + battery monitoring
- Lightweight Go backend
- React-based local web dashboard
- Runs fully offline
- Designed for small solar setups, RVs / Caravans / Off-Grid
- Backend: Go (Golang)
- Frontend: React + Vite
- Hardware: INA219, Victron VE.Direct (in progress)
- Raspberry Pi ready (Zero W, 3, 4)
- Raspberry Pi (e.g. Pi Zero 2 W)
- SIM7028 NB-IoT HAT (e.g. Waveshare SIM7028)
- Go 1.23+
- MQTT broker (self-hosted or Fly.io)
- PostgreSQL database (local or Fly.io)
- Enable UART in
/boot/config.txt:sudo nano /boot/config.txt # Add: enable_uart=1 - Build the agent for ARM:
GOARCH=arm GOARM=6 GOOS=linux go build -o solarnest main.go
- Create config file:
Example config:
mkdir -p ~/.config/solarnest nano ~/.config/solarnest/config.json
{ "mqtt_server_url": "SERVER_URL", "mqtt_topic": "vedirect/data", "client_id": "mqtt", "serial_name": "/dev/serial0", "serial_baud": 115200, "interval_minutes": 15 } - Move the binary to a system path:
sudo cp solarnest /usr/local/bin/
-
Create the service file:
sudo nano /etc/systemd/system/solarnest.service
And paste this:
[Unit] Description=Solarnest MQTT Client After=network.target [Service] ExecStart=/usr/local/bin/solarnest Restart=always User=pi [Install] WantedBy=multi-user.target
-
Reload and start:
sudo systemctl daemon-reload sudo systemctl enable solarnest sudo systemctl start solarnest -
View logs once started:
journalctl -u solarnest -f
Run via a Go-based Gin server.
| Endpoint | Description |
|---|---|
GET /api/ping |
Health check |
GET /api/devices |
List all devices and statuses |
flyctl postgres create --name iot-dbflyctl postgres attach --app solarnest-app --postgres-app iot-dbflyctl deployMIT — use freely, contribute openly 💚
PRs and contributions are welcome! Feel free to fork, test, and suggest improvements.
