feat: Termux sensor dashboard (Issue #574) #578
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-android/issue-574-sensor-dashboard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
phone/sensor_dashboard.py: publishes Android phone sensors to SaltyBot MQTT broker from Termuxsaltybot/phone/imutermux-sensor -s accelerometer/gyroscope -n 1saltybot/phone/gpstermux-location -p gps -r once(→ network fallback)saltybot/phone/batterytermux-battery-statusJSON payloads:
MQTT: paho-mqtt with
loop_start()+on_connect/on_disconnectcallbacks — automatic reconnect with exponential back-off (2 s → 60 s max), no message loss on transient disconnectsThreading: one
SensorPollerdaemon thread per sensor; rate enforced by wall-clock elapsed time accounting for termux-api call latencyStatus: 30 s log line with per-poller publish/error counts + MQTT state
Flags:
--broker,--port,--imu-hz,--gps-hz,--bat-hz,--qos,--no-imu,--no-gps,--no-battery,--debugTest plan
python3 -m py_compile phone/sensor_dashboard.py— syntax cleanpip install paho-mqttthenpython3 phone/sensor_dashboard.py --broker <IP> --debugmosquitto_sub -h <IP> -t 'saltybot/phone/#' -v— see all three topics publishingsaltybot/phone/imuwithaccel.z ≈ 9.8accuracy_mreasonablepctmatches phone status bar;chargingflips when plugged/unplugged--no-gps— only imu + battery topics appear🤖 Generated with Claude Code