- Standardize multilog to s25000 n4 (~100KB cap) to prevent filling /data - Use VeDbusService register=False + deferred register() in dbus-generator-ramp and dbus-vrm-history - Add @exit_on_error decorator to template GLib callback - Document best practices in README and template README Made-with: Cursor
dbus-lightning
Venus OS D-Bus service that monitors real-time lightning strikes from the Blitzortung community lightning detection network.
Features
- Connects to Blitzortung WebSocket servers for real-time strike data
- Filters strikes by configurable radius from current GPS position
- Analyzes 15-minute windows for storm intensity tracking
- Detects approaching storms via linear regression on distance trends
- Estimates storm arrival time (ETA)
- Publishes all data to D-Bus for display in the venus-html5-app dashboard
Architecture
| Module | Purpose |
|---|---|
lightning.py |
Main controller, D-Bus service, GPS reader |
config.py |
Service configuration (servers, radii, thresholds) |
blitzortung_client.py |
WebSocket client with LZW decoding and auto-reconnect |
strike_buffer.py |
Thread-safe strike buffer with haversine distance/bearing |
analysis_engine.py |
Windowed analysis, approach detection, ETA calculation |
Installation
./build-package.sh
scp dbus-lightning-*.tar.gz root@<cerbo-ip>:/data/
ssh root@<cerbo-ip>
cd /data && tar -xzf dbus-lightning-*.tar.gz
bash /data/dbus-lightning/install.sh
D-Bus Service
- Service name:
com.victronenergy.lightning - Key paths:
/StrikeCount15m,/NearestStrikeMiles,/StormApproaching,/StormEtaMinutes,/Settings/Enabled
Service Management
svstat /service/dbus-lightning
svc -t /service/dbus-lightning # restart
tail -f /var/log/dbus-lightning/current | tai64nlocal