[Feature request] Make Companion home screen more informative (battery %, clock/date, status icons, RF summary)

未关闭
#3,955 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
c
领域
embedded-iot

调研方向

Start with examples/companion_radio/ui-new/UITask.cpp, especially renderBatteryIndicator() and HomeScreen::render(), then read examples/companion_radio/NodePrefs.h for timezone settings. The request spans battery, clock synchronization and refresh timing, connection and GPS status, RF data, and optional sensors across different displays and build targets. Done means the requested home screen information fits supported layouts and the listed validation cases pass.

由索引模型根据 Issue 内容生成。

描述

Use case

When using a MeshCore Companion device in the field without constantly unlocking a phone, the main home screen (HomePage::FIRST) currently gives very limited at-a-glance information—especially on standard 128×64 OLED boards. Making the header bar and home screen more informative would make standalone use significantly more practical.

Current limitations
  • No numeric battery percentage: renderBatteryIndicator() in examples/companion_radio/ui-new/UITask.cpp already calculates batteryPercentage, but only renders the graphical battery fill bar.
  • No clock or date on 128×64 displays: Clock and date rendering already exist behind #ifdef UI_SHOW_CLOCK in UITask.cpp (using NodePrefs::tz_offset from NodePrefs.h), but the layout uses setTextSize(3) at y=60, date at y=80, and connection status at y=110, which only fits tall screens (≥128 px height).
  • Status and RF info require cycling pages: Checking GPS fix state, recently heard nodes, or RF signal quality currently requires switching away from the home page.
Proposed improvements
  1. Numeric battery percentage (and optional voltage) in the header bar

    • Display the computed percentage (e.g., 85%) alongside the battery icon in renderBatteryIndicator().
    • Use drawTextEllipsized() for the node name in HomeScreen::render() with the remaining available header width so long names do not overlap the percentage, charging/plug icon, muted buzzer icon, or new status icons.
    • Optionally support showing voltage (V) or switching between % and V (since linear 3000–4200 mV estimation is approximate for LiPo cells).
  2. Compact clock & date layout for 128×64 and larger screens

    • Add a compact layout on HomePage::FIRST so time (HH:MM) and date (e.g., DD/MM or DD/MM/YY) fit cleanly on 128×64 OLEDs alongside the unread message counter, while keeping the larger layout on tall displays.
    • Guard against an unsynced RTC: show --:-- (and hide/placeholder the date) until RTC time has been synced via BLE/app or GPS, instead of showing an invalid default date.
    • E-ink friendliness: avoid 5-second redraw flicker (return 5000 in HomeScreen::render()) on e-ink panels by refreshing clock updates on minute boundaries.
    • Optional follow-ups: 12h/24h format toggle and sub-hour tz_offset support (currently whole hours in NodePrefs).
  3. Compact BLE / Wi-Fi and GPS icons in the header bar

    • Replace (or supplement) the full-width < Connected > line on HomePage::FIRST with a compact BLE / Wi-Fi connection icon in the status bar, freeing vertical space on 128×64 screens.
    • Add a small GPS indicator icon (e.g., active/fix status when ENV_INCLUDE_GPS == 1) so users can verify GPS fix at a glance without navigating to the GPS page.
  4. Compact RF / network summary on the home screen

    • Show a compact summary line on HomePage::FIRST with recently heard node count (the_mesh.getRecentlyHeard(...)) and/or last received packet SNR/RSSI (or current noise floor via radio_driver.getNoiseFloor()), providing quick field visibility into link quality.
  5. Optional external-sensor snippet (related to #3878)

    • When an external environmental sensor (e.g., BME280/BME680) is present, optionally show a compact one-line reading (such as 22.4°C 48%) on the home screen, complementing the dedicated Sensors page requested in #3878.
Compatibility & configurability
  • Keep ui-tiny minimal and ensure 128×64 OLED layouts remain uncluttered.
  • Gate optional home-screen widgets behind build flags or NodePrefs settings where appropriate so flash-constrained targets or users who prefer a minimal home screen can opt out.
Validation
  • Verify header layout on 128×64 displays with long node names, 100% battery, charging icon, muted buzzer icon, and BLE/GPS icons (no overlap).
  • Verify clock/date rendering both before and after RTC sync (phone BLE sync and GPS sync) and with non-zero tz_offset.
  • Verify e-ink targets do not refresh every 5 seconds solely for the clock.
  • Verify RF summary updates after receiving packets and handles the empty/startup state cleanly.
主要语言
C
星标
3.9k
派生
1.5k
平均合并
2 天 19 小时
30 天内合并 PR
61

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

meshcore-dev/MeshCore 的其他 Issue

查看 meshcore-dev/MeshCore 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。