Skip to content

Companion UI: add compact 128x64 clock/date layout, RTC guard, and e-ink minute refresh - #3966

Open
cryptomaxsun wants to merge 2 commits into
meshcore-dev:devfrom
cryptomaxsun:feat/ui-compact-clock-date
Open

cryptomaxsun wants to merge 2 commits into
meshcore-dev:devfrom
cryptomaxsun:feat/ui-compact-clock-date

Conversation

@cryptomaxsun

Copy link
Copy Markdown

Part of #3955.

Summary

  • Add a compact HomePage::FIRST clock/date layout for screens with height() < 120 (128×64 OLED and ST7789 boards like Heltec T114), showing MSG:N + short date on row 1, HH:MM on row 2, and connection/PIN status on row 3.
  • Guard clock/date rendering against unsynced RTC (VolatileRTCClock initializes to May 2024), showing --:-- / --/--/-- until valid epoch time (>= 2025-01-01 UTC) is synced via BLE or GPS.
  • Align HomeScreen::render() refresh intervals on e-ink displays to minute boundaries when the clock is active (or 60s when inactive) instead of refreshing every 5 seconds.
  • Enable -D UI_SHOW_CLOCK=1 by default on Heltec T114 Companion (with display) builds.

Verification

  • Built cleanly with PlatformIO: Heltec_t114_companion_radio_ble and ThinkNode_M1_companion_radio_ble.
  • Hardware photo on Heltec T114 to follow after flashing.

@fdlamotte

Copy link
Copy Markdown
Collaborator

Oh thanks ... that's interesting as the job on clock had only been done for the thinknode M8 and not adapted to small screen

For the refresh rate on eink ... normally the GxEpdDisplayDriver checks if anything changed on the screen (with a crc) so refresh should only happen when clock value really changes ... there should be no need for a special case here. The only problem I have here is wether the battery icon can change too quick (between two values), I've not catched this but think this is possible ... and for that I think it would be good to "rate limit" the battery readings (to a minute for instance)

I get back to you as soon as I get some time to test your screen (sadly I don't have t114 anymore, but I have some nodes with small screens)

@cryptomaxsun

Copy link
Copy Markdown
Author

Thanks for the review and the context about ThinkNode M8 and the e-ink CRC check!

Good point — I checked GxEPDDisplay / E213Display and confirmed display_crc already avoids redundant refreshes when the frame hasn't changed. I've pushed a commit removing the display.isEink() refresh-rate special case so this PR stays focused on the compact 128×64 clock/date layout and the unsynced RTC guard.

Agreed on battery polling too: getBattMilliVolts() is read on every 5s render, which can bounce between adjacent values and trigger e-ink refreshes (especially with the numeric % in #3965). Would you prefer rate-limiting the displayed battery reading (e.g. ~60s cache, updating immediately when charging state changes) as part of #3965 or as a separate small PR?

Here is a photo of how the compact clock/date layout looks on my Heltec T114 (running my combined test branch with #3965 battery % and #3967 BLE icon + RF summary as well):
heltec_t114_home_ui

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants