mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-07-12 06:39:00 +00:00
54cf0301e2
* feat(gat562): wire nrf52 board runtime and bluetooth stack
* refactor(chat): align shared BLE cores and nrf meshtastic routing
- extract Meshtastic and MeshCore phone/business flows into shared core_chat BLE cores with owner hook seams for ESP and nRF backends
- replace nrf-specific lite adapters with board/platform adapters that consume shared cores and shared storage contracts
- extend nrf Meshtastic radio path with packet history dedupe, flooding rebroadcast, route discovery/traceroute responses, routing ACK/error handling, observed relay learning, retransmit queueing, and next-hop persistence
- persist nrf device identity and node metadata more explicitly, including next-hop state and node-id initialization support
- move nrf chat/contact/blob storage further toward InternalFS-backed persistence and update contact/node store behavior accordingly
- wire gat562 protocol/app facade pieces to the concrete nrf stores/adapters and add supporting app time-sync hooks used by platform runtimes
- add owner-hook split files and planning/status docs to document the ongoing alignment with the reference meshtastic-firmware multi-platform structure
* Add NRF Fusion Pixel font and fix Meshtastic RX
Integrate Fusion Pixel 8px as the NRF mono UI font stack and switch the mono runtime to a dedicated MonoFont/TextRenderer path that can render ASCII, CJK, and symbols from one asset set.
Add the generated NRF font assets and generator script, including the compact font format with per-glyph advance support, and fix the BDF bitmap parsing bug that previously produced blank ASCII glyphs on device.
Move the LVGL Noto CJK font asset out of shared modules into the ESP-specific platform tree and update the related build/config references so the ESP-only font boundary is explicit and NRF does not compile the LVGL asset by accident.
Update the mono UI runtime to use the new renderer, normalize major menu and title labels to uppercase, and wire the GAT562 UI runtime to the Fusion Pixel font.
Fix the core mesh adapter router so Meshtastic and MeshCore backends can coexist without overwriting each other, and ensure active protocol selection is applied before mesh config changes are pushed into the runtime.
Improve GAT562 runtime diagnostics by mirroring debug output to both Serial and Serial2, logging startup radio configuration, and logging raw RX packets with RSSI/SNR so radio-path issues are visible during bring-up.
Relax SX1262 receive polling so it no longer hard-gates RX handling on DIO1 state alone, avoiding a failure mode where the board appeared alive but never delivered packets into the receive path.
Align the NRF Meshtastic adapter with the working ESP behavior for channel handling: use the default expanded public PSK for an unconfigured primary channel, compute channel hashes from the active preset name or Custom label instead of a hard-coded Primary string, and apply the same logic to self-announcement/NodeInfo packets.
Add protocol-layer Meshtastic RX diagnostics for parse, decrypt, decode, text queueing, app-data queueing, unknown-channel, and dedup events to make packet flow visible while validating interoperability.
Fix early duplicate handling for relayed packets so the first valid packet is still delivered into text processing while later relays are correctly suppressed, which restores Broadcast conversation creation and message visibility in the CHATS page.
* feat(gat562): align nrf ui and meshtastic behavior
* Refine mono UI GPS pages and board diagnostics
* refactor: align board runtimes, GAT562 app shell, and BLE integrations
- migrate ESP board-specific implementations and runtime adapters into boards/*
- continue GAT562/Tab5/UI runtime alignment across app and board layers
- sync BLE and runtime integrations, and apply repository clang-format rules
* Refine gat562 mono UI and persist UI settings
* Fix settings persistence and GNSS UI behavior
* Improve mono UI paging and Meshtastic RX fallback
* Align nRF52 Meshtastic BLE and PKI behavior
* Refine mono UI node and chat interactions
* Fix deferred config persistence on gat562 BLE
* Refine mono node compass and GPS layouts
* Include node position in Meshtastic phone info
* Refactor shared board contracts out of ESP platform layer
* Persist node positions across restarts
* Ignore local compile commands database
* Sync README acknowledgements updates
* Apply CI formatting
* Fix board ownership drift and restore pager walkie support
* Add APRS asset, expand System controls, and harden GAT562 self-position persistence
Bundle the current workspace changes into a single checkpoint covering the in-progress shared UI, settings, and GAT562 runtime work.
What this includes:
- add the APRS asset source and image resource currently used by the shared UI asset set
- extend the shared System/settings flow so vibration and screen brightness can be surfaced through the device runtime and settings UI plumbing
- update the mono 128x64 runtime and the GAT562 platform bindings so the new settings controls are available in the GAT562 experience
- wire the ESP runtime/startup helpers needed to support the same device-runtime settings path on the ESP side
- persist the GAT562 self GPS position into the node store during core service updates so a device that already obtained a fix can retain its own last known position across reboot
- add an explicit node-store flush interface and implement it in both the nRF52 and ESP Meshtastic node-store backends so critical self-position updates can be forced to persistent storage immediately instead of waiting for the normal debounce window
- keep the existing debounced persistence behavior for ordinary node-store churn while allowing targeted immediate flushes for data that would otherwise be easy to lose during restart or power loss
* chore: checkpoint current chat and contacts changes
* perf: reduce chat list and message handling latency
* Align Meshtastic phone sync and chat UI refresh
* Remove key verification UI and hide MC position exchange
* Add T-Deck Pro board bring-up and sync pending UI fixes
* Refactor GAT562 runtime and stabilize Meshtastic BLE
Refactor the GAT562 board runtime by extracting dedicated GPS and input runtime components and routing config application through a focused runtime apply service.
Narrow the nRF52 BLE manager dependencies, rework the Meshtastic BLE transport to better match the Android client handshake, and harden the FromRadio/FromNum flow with improved staging, read pacing, diagnostics, and stack-safe config snapshot generation.
Also repair repository text encoding issues in docs and UI comments, and add Meshtastic BLE timing documentation to capture the expected Android/firmware interaction model for future debugging.
* fix: gat562 settings
* Define LoRa tx power caps per board
* Refine mono conversation bubble focus
* Polish mono conversation and message info layout
* Harden Meshtastic BLE flow and cross-target builds
Adjust the Meshtastic BLE transport timing on nRF52, retain pending FROMNUM notifications, and defer local admin/self replies to reduce request/response races during Android settings flows.
Also make the shared chat/UI code compile across non-nRF targets by gating RTOS and Arduino-only helpers and by updating the team page layout to the current page profile fields.
Note: this does not resolve the gat562 Meshtastic Android settings progress bar issue yet; the BLE/admin response path is improved and instrumented, but the root cause of the stuck loading state remains unresolved.
* Fix GAT562 mono channel slot UI and screen timeout
* Revert Meshtastic BLE hardening changes
Revert b9e20b2662 because it causes app-side configuration reads to hang on GAT562.
This restores the previous Meshtastic BLE timing/notification behavior and also drops the cross-target compatibility adjustments that came with that commit.
* Refactor nrf52 fs helpers and show flash free space
* fix sync node info
* Harden Meshtastic BLE receive path
* Fix Meshtastic nodeinfo persistence
* Persist NodeInfo position updates
* Format files to match CI style
* Prepare 0.1.14-alpha docs and CI
* Fix watch chat build and CI formatting
* Format sources for CI clang-format-14
4.9 KiB
4.9 KiB
UI Shared / IDF 迁移计划
这份文档用于说明:如何把 UI 逻辑从各个 apps/* 中抽离出来,沉淀到可复用的 shared 层,并同时兼容 PlatformIO 与 ESP-IDF 两套入口。
1. 目标
1.1 总目标
- 把通用 UI 页面、shell、controller、runtime 接口集中到
modules/ui_shared - 让
apps/esp_pio与apps/esp_idf只保留各自平台入口、启动流程和适配器 - 避免 shared UI 直接依赖 Arduino 或 ESP-IDF 具体实现细节
1.2 迁移原则
- 页面结构、交互和状态逻辑优先沉淀到 shared 层
- 平台差异收敛到
platform/*和 app runtime adapter - 同一个页面不要在 PIO / IDF 各维护一份实现
- 对暂时无法共享的能力,用 capability-gated fallback 占位
2. 分层边界
2.1 modules/ui_shared
承载:
- page shell
- 页面组件
- controller / presenter
- runtime 抽象接口
- 通用 fallback 页面
不应直接依赖:
<Arduino.h><Preferences.h>nvs.h- 具体板级 API
2.2 apps/esp_pio / apps/esp_idf
承载:
- startup / boot
- menu / app catalog 入口
- loop 驱动
- 生命周期管理
- facade / runtime adapter 装配
2.3 platform/*
承载:
- 设备能力实现
- 屏幕 / 睡眠 / 音频 / GPS / 存储等平台 API
- Arduino 与 IDF 各自的 contract 实现
3. 当前状态(截至 2026-03-11)
3.1 已经共享的页面骨架
已经迁到 shared shell + runtime/components/controller 的页面:
SettingsChatGPS / MapGNSS Sky PlotContactsTeamTrackerPC LinkUSBSSTVEnergy SweepWalkie Talkie
3.2 apps 侧现状
apps/esp_pio/src 和 apps/esp_idf/src 已经逐步收敛到以下职责:
startup_runtime.cpploop_runtime.cppapp_runtime_access.cppapp_registry.cpp
其中 esp_idf 还包含:
runtime_config.cppapp_facade_runtime.cppidf_entry.cppidf_component_anchor.cpp
3.3 已完成的清理
- 一批旧的 IDF retired stub 已移除
modules/ui_shared里的ui_common_stub.cpp/ui_status_stub.cpp已显著收缩apps/esp_pio/src下保留的ui_*.cpp多数只剩 wrapper 职责
4. 分阶段计划
阶段 0:盘点与止血
目标
- 先明确哪些页面已经 shared,哪些还残留 app 私有实现
- 停止新增重复页面实现
交付
- 页面归属清单
- app 私有 wrapper 清单
- shared shell 缺口清单
阶段 1:apps 入口收敛
目标
把 apps/esp_pio 和 apps/esp_idf 收敛成“启动 + loop + runtime 接线”。
任务
- 把
app_catalog/menu/startup/loop对齐到 shared 模式 - 清理
apps/esp_pio中历史页面 wrapper / registry 特例 - 收敛
app_runtime_access的生命周期与运行时访问 - 统一
esp_pio/esp_idf的 startup / loop / event 驱动模式
完成标准
- 两端 app 目录不再承载具体 UI 逻辑
- app 入口能稳定驱动 shared app catalog / shared shell
阶段 2:页面共享完成
目标
把页面层真正统一到 shared:
- shell
- host
- fallback
- components / controller / runtime
任务
- 补齐 shared
shell + components/runtime - 移除 app 侧残留页面逻辑
- 统一 app catalog 与 shared page shell 的接线
- 对缺失能力使用 capability-gated fallback
完成标准
- 页面结构只在
modules/ui_shared维护 - fallback 行为一致
- app 侧不再复制页面实现
阶段 3:平台能力抽象完成
目标
把 shared UI 依赖的设备能力全部收敛到 adapter contract。
需要抽象的能力
- restart
- kv / config persistence
- screen sleep
- tone / audio preview
- GPS runtime control
- tracker recording hook
- hostlink / USB capability hook
- walkie / sstv / lora support
落点
- Arduino 实现在
platform/esp/arduino_common - IDF 实现在
platform/esp/idf_common与apps/esp_idf/*runtime
完成标准
modules/ui_shared不再直接包含 ESP 专有头文件- shared 只依赖平台 contract
阶段 4:配置与 profile 收敛
目标
把设备 profile、视觉尺寸、能力差异统一到 runtime config / page profile。
重点
tab5tdeckpager
要求
- topbar、高度、间距、图标卡片等由 shared profile 驱动
- 板级差异不散落在页面代码里
5. 风险点
- shared 页面已经完成结构迁移,但 runtime hook 仍可能带有平台耦合
- PIO / IDF 两套入口的生命周期节奏不完全一致,容易出现事件顺序差异
- fallback 如果设计过弱,短期内会掩盖真实缺口
- profile 还未彻底统一前,不同设备上可能继续出现布局分叉
6. 验收标准
modules/ui_shared成为页面 UI 的唯一事实源apps/esp_pio与apps/esp_idf主要负责启动和装配- 平台差异只出现在
platform/*与 runtime adapter - 新页面默认先落到 shared,而不是 app 私有目录