sl-android
|
814624045a
|
feat: Termux sensor dashboard (Issue #574)
Add phone/sensor_dashboard.py — publishes phone sensors to SaltyBot MQTT:
- IMU → saltybot/phone/imu @ 5 Hz (accelerometer + gyroscope via
termux-sensor -s <name> -n 1)
- GPS → saltybot/phone/gps @ 1 Hz (lat/lon/alt/accuracy/speed/bearing
via termux-location; GPS→network fallback on cold start)
- Battery → saltybot/phone/battery @ 1 Hz (pct/charging/temp/health/plugged
via termux-battery-status)
- paho-mqtt with loop_start() + on_connect/on_disconnect callbacks for
automatic reconnect (exponential back-off, max 60 s)
- Each sensor runs in its own daemon thread (SensorPoller); rate enforced
by wall-clock sleep accounting for read latency
- 30 s status log: per-poller publish/error counts + MQTT state
- Flags: --broker, --port, --imu-hz, --gps-hz, --bat-hz, --qos,
--no-imu, --no-gps, --no-battery, --debug
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-03-14 11:53:04 -04:00 |
|