Files
JC3636W518EN/12-OBD-Speed/README.md
T
patriandClaude Opus 5.5 66f70c0cc1 Add 12-OBD-Speed: ELM327 speed over BLE on a GIF background
- speed page: 120 px antialiased number (lv_font_conv) + 0-200 km/h arc
  gauge over ezgif-5-cb56986bc7.gif (embedded via board_build.embed_files)
- swipe-left menu: scan, OBD-like adapters first, tap to select; adapter
  remembered in NVS, auto-connect at boot and reconnect every 3 s
- ELM327 init ATZ/ATE0/ATL0/ATS0/ATH0/ATSP0/0100, then 010D polling
- shared ini: -DLV_LVGL_H_INCLUDE_SIMPLE for generated fonts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:49:37 +02:00

30 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OBD Speed (JC3636W518)
Vehicle speed from an ELM327 over BLE, shown as a big number + arc gauge on top of an animated GIF.
Uses the shared board library and LVGL 9.6 (`../shared`), NimBLE-Arduino 2.5.1.
## Use
- **Speed page** — speed in km/h (`--` = no data: not connected, or ignition off), arc gauge 0–200 km/h,
status at the bottom (adapter name when running, otherwise what it is doing).
- **Swipe left → adapter menu** — scans while open. OBD-like adapters (name OBD/ELM/…, or service FFF0/FFE0/18F0)
are listed first in green. **Tap one** to select it: it is remembered (NVS) and connected immediately.
**Forget** clears the remembered adapter, **Done** (or swipe right) returns to the speed page.
- On power-up the remembered adapter is connected automatically; if the link drops or the adapter is not
there (car off), it retries every 3 s. With no adapter remembered, the device starts on the menu page.
## How it talks to the ELM327
Service `FFF0`, notifications + commands on `FFF1` (verified with the user's "OBDII" adapter, see
`../11-BLE-Scanner/results/2026-10-23_car_test.txt`); other adapters: first notify+write pair.
Init: `ATZ`, `ATE0`, `ATL0`, `ATS0`, `ATH0`, `ATSP0`, `0100`; then `010D` (speed) is polled continuously.
Serial (115200) prints status changes as `[obd] ...`.
## Files
| File | What |
|---|---|
| `src/main.cpp` | LVGL UI (tileview: speed page + menu page) |
| `src/obd_link.cpp/.h` | BLE scan, connect/reconnect, ELM327 init and speed polling (background task on core 0) |
| `src/font_speed_120.c` | Montserrat Medium 120 px, digits and `-`, 4 bpp (generated with `lv_font_conv`, see header) |
| `data/bg.gif` | Background (`ezgif-5-cb56986bc7.gif`, 360×360), linked into the firmware via `board_build.embed_files` |
Replace `data/bg.gif` with any 360×360 GIF to change the background (keep it under ~3 MB).