Skip to content

Vescape Sensors: BLE link to the ESP32 sensor module - #441

Draft
KacperKozak wants to merge 10 commits into
devfrom
hardware
Draft

Vescape Sensors: BLE link to the ESP32 sensor module#441
KacperKozak wants to merge 10 commits into
devfrom
hardware

Conversation

@KacperKozak

@KacperKozak KacperKozak commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Adds a Sensors screen that connects to a Vescape sensor module (ESP32-S3 running the vescape-hardware firmware) over Nordic UART, and shows what it reports live — distance readings as numbers, bars and scrolling charts, plus a console for talking to it directly. Android only for now.

Note

Risk: Low — a new settings screen and a self-contained native link; nothing existing reads from it.
Complexity: Medium — a high-rate native stream with its own buffering, decimation and BLE lifecycle.
DB: None — nothing is persisted; the history lives for as long as the link does.

Description

The module pushes a flat JSON frame per sensor read, at a rate the app can retune from the screen (1–30 Hz, the firmware clamps what it cannot hold). At the top of that range one JS callback per notification is enough to starve the JS thread on its own, so the pipeline is native-owned in the same shape as live telemetry: SensorLog parses, scales, clamps, keeps a 20-second window and decimates it, and publishes two events — live values ~10×/s that JS writes straight into shared values, and ready-made chart series 4×/s. JS holds no sensor logic; it adds labels, units and colors and renders. Nothing re-renders at the link's rate, so 30 Hz costs the same as 5 Hz on screen.

The readings a board can take are declared rather than discovered. A ranged sensor that reads nothing is reporting "further than its reach", not absence, so its row exists from the first frame, sits at its ceiling, and never moves when the sensor drops out and comes back — which the ultrasonic does constantly.

Scan and connect are automatic for the one Vescape-HW module; pressing Disconnect turns that off until Scan is pressed again.

There is no iOS peer: HardwareLink and SensorLog are Android-only, marked with TODO(ios parity).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:diagnostics Debug Recordings, replay tooling, Diagnostic Events, dev-mode debugging surfaces area:native Touches native side (modules/vesc-ble, Swift/Kotlin) complexity:medium Needs care, moderate integration surface. Use sonnet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant