Skip to content

Add ui-lvgl, a standalone touch UI for the Wio Tracker L2 Pro - #3529

Open
Hacuchino-hash wants to merge 4 commits into
meshcore-dev:devfrom
Hacuchino-hash:wio-tracker-l2-ui-lvgl
Open

Hacuchino-hash wants to merge 4 commits into
meshcore-dev:devfrom
Hacuchino-hash:wio-tracker-l2-ui-lvgl

Conversation

@Hacuchino-hash

Copy link
Copy Markdown
Contributor

Add ui-lvgl, a standalone touch UI for the Wio Tracker L2 Pro

Builds on #3381 (the variant); the first two commits here are that PR and
the last two are new. Adds examples/companion_radio/ui-lvgl/, an LVGL 9
interface for boards with a touch panel, and the
Wio_Tracker_L2_standalone_lvgl environment that uses it (Bluetooth
compiled out, USB CLI only).

It is a full node interface, not a status screen, so the board can be used
without a phone: chats with history and delivery state, contacts with a
manual path picker and repeater path trace, on-device repeater
administration (login, status, CLI), an offline map from SD with pan and
zoom, radio and node settings, and a first-boot region and name wizard.

How it fits after #3431

The UI is a MyMesh::Listener and takes everything through that interface:

  • Incoming messages, CLI replies, ACKs, adverts and trace results arrive
    via onMessageRecv, onChannelMessageRecv, onACKRecv,
    onDiscoveredContact, onTraceRecv and onQueueSizeChanged.
  • Login and status go out through BaseChatMesh::sendLogin and
    sendRequest. The replies come back in onUnhandledResponse and are
    consumed there: status is matched on the request tag, login on the sender,
    because a login reply carries the server's clock in the tag field rather
    than the request tag.
  • Trace uses createTrace and sendDirect; sending uses sendMessage,
    sendGroupMessage and sendCommandData.

I read the "still a fair ways to go" note in #3431 and take it at face
value. This is built on the Listener as it stands today, to show what a
standalone UI actually needs from it, not to lock anything in. When the
abstraction moves I will move the UI with it. The two MyMesh changes below
are the spots where there is no public path yet (a scoped flood advert,
and saving contacts and channels), which may be useful input for that
work either way.

Shared files touched

File Change
examples/companion_radio/MyMesh.h advert() gains a flood flag (default false); saveChannels, saveContacts and isValidClientRepeatFreq move to the public section so the settings screen can reach them
examples/companion_radio/MyMesh.cpp +8: the flood branch of advert(), doing what CMD_SEND_SELF_ADVERT does with the default scope

Existing advert() callers are unaffected. Nothing else outside the new
directory changes, apart from the variant's own README, envs and map tools.

Layout

One translation unit per screen: UIThread.cpp, UIContacts.cpp,
UIRepeater.cpp, UIOverlays.cpp, MapView.cpp, SettingsUI.cpp, with
UITask.cpp holding the shell, the settings rows, the mesh events and the
main loop. UICommon.h is the internal header they share; UITask.h is
the only interface main.cpp sees.

Dependencies

lvgl @ 9.2.2, pinned and pulled only by the standalone env. The UI builds
on the existing wrappers: LGFXDisplay, ESP32Board,
MicroNMEALocationProvider, EnvironmentSensorManager, rtc_clock,
StrHelper.

Offline maps

The map reads the usual /maps/{z}/{x}/{y}.png layout from a FAT32 card,
so a tile folder prepared for any other device works unchanged. It also
understands packed tile columns and an optional /maps_dark/ night set;
both are documented in the variant README and neither is required.

Testing

Builds: Wio_Tracker_L2_standalone_lvgl and the four variant envs, plus
Heltec_v3_companion_radio_ble and RAK_4631_companion_radio_ble from the
matrix (they compile the touched MyMesh files). The last commit adds the
standalone env to the PR build matrix; drop it if unwanted.

On hardware, this revision: boot and touch, direct messages both ways with
delivery ACK, hashtag channel messages, notification banner, repeater
administration (saved password, login, status, action buttons, CLI
replies), path trace with per-hop SNR over a two-byte-hash path, flood
advert, and the first-boot wizard. Earlier revisions also covered speaker,
wake button, GPS fix, offline maps in the loose tile layout and client
repeat mode on 918 MHz; none of that code changed in the rebase.

Packed tiles and the night tile set are not yet verified on hardware.

ESP32-S3 with SX1262, a 3.2" 320x240 touch LCD, an L76K GNSS module and an
SD slot. Everything except the radio hangs off a TCA9535 expander, so the
board brings up power and reset lines in Seeed's documented order before
the display and GNSS are usable.

Companion (BLE and USB), repeater and room server environments run on the
existing shared code. Pre-release hardware: the pin map may change on
production units.
An LVGL 9 interface for boards with a touch panel, used by this variant's
standalone environment: messaging with delivery state and history,
contacts with path control and repeater trace, a repeater admin screen,
an offline map from SD, and on-device radio and node settings. One
translation unit per screen (thread, contacts, repeater, overlays, map,
settings), with UITask.cpp holding the shell, the settings rows, the mesh
events and the main loop.

The UI is a MyMesh::Listener. Incoming messages, CLI replies, ACKs and
trace results arrive through the listener interface; logins and status
requests go out through the BaseChatMesh send methods and their replies
are picked up in onUnhandledResponse (status by request tag, login by
sender, since login replies carry the server clock in the tag field). The
shared-file changes are a flood flag on MyMesh::advert(), doing what
CMD_SEND_SELF_ADVERT does, and saveChannels, saveContacts and
isValidClientRepeatFreq moving to the public section so the settings
screen can reach them.

The boot splash draws the wordmark bitmap the other display UIs already
share, expanded to an alpha mask and tinted from the widget style.

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.

1 participant