- Added lib/signal_reader.py with SignalGpsReader, SignalMeteoReader, and SignalDepthReader that use PropertiesChanged signal subscriptions instead of polling via GetValue(), reducing D-Bus overhead at steady state. - Each reader discovers its service dynamically, seeds its cache with a one-shot GetValue, then relies on signals for all subsequent updates. - Refactored dbus-tides, dbus-windy-station, dbus-no-foreign-land, dbus-lightning, and dbus-meteoblue-forecast to import from the shared library, removing ~600 lines of duplicated _unwrap() helpers and per-service GPS/meteo/depth reader classes. - Updated install.sh for all five services to deploy signal_reader.py to /data/lib/ on the target device. - Updated build-package.sh for all five services to bundle signal_reader.py into the .tar.gz package. - Updated README.md with the new lib/ entry in the project table and documented the shared D-Bus readers pattern. - Bumped version numbers in affected services (e.g. nfl_tracking 2.0.1). 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