Repository navigation
Conversation
|
Just got one of those so I'll try it There are a lot of changes to the UI, so I'll probably have to do a proper review and some checks before merging ;) |
|
Here are my thoughts about this port Basic function works well, but UI is very slow. I think this was the same when I worked on T114, in the end we finished by switching to monochrome display which (even if not as colorfull) was way more faster (I think the t096 has the same issue, but I used mine as repeater (works great) so don't really care). A side question, does the ui refresh has an incidence on lora communication (can't we miss some packets ?) This was one of the issues that had been brought by @liamcottle and had triggered the change to mono) I've seen you already integrated with the new GPS framework. How did you find it ? If you have any comments on it you are welcome ;) I'll go deeper in this contribution, but I now have some other (less interesting) work to do ;) |
Thanks for testing and for the feedback! I've just updated the branch to increase the display SPI clock from 4 MHz to 8 MHz, which should help with transfer time, although I haven't measured the actual improvement yet. Regarding the UI performance, do you have any specific measurements or a reference for what would be considered an acceptable refresh time? Is the slowness mainly noticeable when switching pages, or during normal screen updates? I found the earlier T114 monochrome PR #237, but it doesn't seem to include specific timing measurements. There is also an interesting discussion in #3701 and #3724 about display refresh blocking the main loop. For MeshPocket V2, the display and LoRa radio use separate SPI buses, but since display operations are still synchronous, they could potentially delay radio processing. I'll run some tests to measure the actual display refresh time and see how it performs. The current driver still has room for optimization, particularly by batching pixel writes and avoiding unnecessary full-screen redraws. I'd prefer to investigate these before considering switching to monochrome. As for the new GPS framework, it's really nice! I like it a lot. :) Thanks again for taking the time to review this! :) |
|
Measured display refresh times on MeshPocket V2:
Collected 1,040 samples using a 4 → 8 → 8 → 4 MHz sequence. All 400 unchanged power-page checks produced zero display SPI transfers. LoRa packet loss has not yet been tested. |
|
refresh is much better now (and I think it should be ok regarding the fact that it blocks the loop) maybe the same strategy as with gxepddriver could be used ? (computing a crc to see if the screen content changed ?) to me this is mostly an issue when there is no change on the screen (on screen change, for instance, the redraw does not bother much) |
That makes sense, especially when the screen content has not changed. GxEPD draws into a RAM buffer and uses a CRC of the drawing commands and their parameters to decide whether to refresh the panel. The current NV3001B driver clears the screen in The power page already compares each displayed field with its previous value and redraws only the fields that changed. It does not use a frame CRC or a framebuffer. For ordinary pages, comparing the values and states actually shown on screen before drawing may be a better fit than a frame CRC. We could skip the redraw when those remain unchanged, while keeping the power page's existing partial updates. |
|
You're right, the crc works on eink because everything is done in a double buffer and the reason we don't want to redraw the screen is different ... sadly I don't think that we want a refactor of UITask right now to add some hierarchy in the display widget and screen damage for parts to update (which could be an interesting paradigm change but maybe overkill for the small screens that we have ...) There is clearly room for improvement here (maybe it's time to start working on a ui-new-new interface, which would better accomodate bigger screens and manage widget-damage ...) But let's first work on integrating this PR. I'll review the changes you propose for the src and example tree mostly (as all that is in the variant won't impact others ;)) edit: most problematic pages are gps and node discovery (while waiting for replies it updates every sec) ... I'll investigate how we can get a better user experience on that pages ;) |
|
Regarding this PR The most intrusive part is the introduction of BoardUI It seems it fills an important need for your device, as user of a powerbank needs a way to monitor closely its device and that is very nice. But I feel we should work together on a more generic way of adding pages to the UI, where the designer for a board or a custom firmware can benefit from the current infrastructure and add his own assets. The issue I see with the approach you've taken is that if someone wants to extend it it has to add more complexity to the base code, with the risk of ending with a spagethi plate It would be really nice if we had some ways of extending the UI without touching UITask, and let the user choose at buid time which screen (and potentially custom ones) he wants in his UI |
Summary
This PR adds complete MeshPocket V2 board support with four firmware targets:
heltec_meshpocket_v2_companion_radio_bleheltec_meshpocket_v2_companion_radio_usbheltec_meshpocket_v2_repeaterheltec_meshpocket_v2_room_serverAll targets share the same board definition, radio/display/GNSS configuration, ExtraFS layout, and the official HeltecMeshPocketV2Power 0.2.0 dependency.
Board support
The new variants/heltec_meshpocket_v2 implementation initializes and manages:
CSA defaults to LOW for every firmware role. USB Companion, Repeater, and Room Server can enable USB data mode from the power page, while BLE Companion does not expose that action.
Power monitoring
PowerBank owns all CW221X and HLT331 communication and keeps this hardware logic outside the generic UI.
It handles:
Communication interruptions preserve the last trusted state while displayed values independently expire when their source is no longer valid.
Power-bank page
PowerBankPage renders a dedicated 220×128 page showing:
The page uses field-level caching. Its static layout is drawn only when a full restore is required; stable readings generate no repeated pixel updates. Changed values only redraw their corresponding regions.
Normal MeshCore pages continue using the existing 128×64 logical coordinate system. Native 220×128 coordinates are enabled only while rendering the power page and are restored immediately afterward.
Reusable board UI interface
This PR adds an optional BoardUiExtension interface to MainBoard.
Boards without an extension continue using their existing page count and UI behavior. A board extension can:
Companion adds the optional board page as the final page. Repeater and Room Server use the shared BoardUiScreen helper to switch between their standard status screen and the board page.
Hardware-specific types such as the HLT331 snapshot, C1/C2 state, USB switching, and secondary-button handling remain in the MeshPocket V2 variant.
UI behavior
Compatibility
The existing HELTEC_MESH_POCKET_V2 build definition is retained for compatibility, but shared UI and display code no longer depends on board-name conditionals.
Unsupported displays keep their existing behavior because DisplayDriver::setNativePixels() has a default no-op implementation.
Validation
Follow-up validation