Commit Graph

2881 Commits

Author SHA1 Message Date
Jakub
ddac8fe3ee docs: update README for v1.10 — e-ink support, font switcher, home page ordering
- Add Firmware Variants table (OLED vs e-ink) with filenames
- Add E-ink Display section covering adaptive layout, rotation, scaled dots,
  suppressed clock seconds
- Update Settings > Display: add Display rotation (e-ink only) entry, update
  Font entry to reflect it's now built into all builds
- Update Settings > Home Pages: document LEFT/RIGHT ordering and always-visible
  Settings/Messages pages
- Replace "Font Switcher Build" section with "Font Switcher" — font is now
  built into every variant, no separate download needed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 00:07:41 +02:00
Jakub
bb94a6f81f feat: home screen ordering — reorder all screens from Settings
NodePrefs: add page_order[11] (1-indexed bit-index, 0=end/legacy).
DataStore: persist page_order appended after use_lemon_font.

UITask/HomeScreen:
- bitToPage(): maps stable bit indices 0-10 to HomePage enum values
- buildVisibleOrder(): respects page_order when initialised, else
  falls back to default enum sequence
- navPage() and navigation dots use buildVisibleOrder()

SettingsScreen Home Pages section:
- Add Settings (bit 9) and Messages (bit 10) — show as "always"
- LEFT/RIGHT on any home page item moves it earlier/later in order
- ENTER toggles ON/OFF for pages that can be disabled
- Position number shown before label once custom order is active
- ensurePageOrderInit() seeds default order on first reorder action

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wio-tracker-v1.15-plus.1.10
2026-05-22 23:33:06 +02:00
Jakub
7519740d72 ci: build dual OLED and dual e-ink firmwares in parallel
Split the single build job into two independent jobs:
- build-oled: checks out wio-tracker-l1-improvements, builds WioTrackerL1_companion_radio_dual_settings
- build-eink: checks out eink-ui, builds WioTrackerL1Eink_companion_radio_dual

Both artifacts are merged into a single draft release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 23:20:06 +02:00
Jakub
67bccd3dd4 ci: merge font-switcher build into single wio-tracker-l1 firmware job
Font-switcher is now part of wio-tracker-l1-improvements, so there is
no longer a separate branch to check out. Drop the build-font-switcher
job and its download step in release; a single build produces the
combined dual-BLE/USB + font-switcher firmware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:47:32 +02:00
Jakub
fa842b202a fix: scale Lemon font glyphs with setTextSize on lock screen clock
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:34:24 +02:00
Jakub
319428c7c6 chore: remove unused FS_START_Y constant from FullscreenMsgView
startY is computed dynamically from header_h, making the constant redundant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:34:24 +02:00
Jakub
ca5eb221e7 fix: persist use_lemon_font setting across reboots
The font preference was not saved to or loaded from flash, so it would
reset to default (Adafruit font) on every boot. Added to the versioned
DataStore read/write chain in the same pattern as other recently added
fields (auto_lock, dm_melody etc.).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:34:24 +02:00
Jakub
4161951d19 fix: force immediate redraw after font switch in applyFont()
Without _next_refresh = 0 the Settings screen would continue using its
2-second refresh interval after a font change, showing stale rendering
for up to 2 seconds. Mirrors the pattern used by setBrightnessLevel().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:33:35 +02:00
Jakub
a115916d8f feat: runtime font switcher — Default vs Lemon in Settings > Display
- Add Lemon font (LemonFont.h, LemonIcons.h) to the standard build
  alongside the Adafruit built-in font; ~101 KB added to flash
- SH1106Display: add _use_lemon flag + setLemonFont(bool) to switch
  at runtime; print() and getTextWidth() use Lemon path when active;
  translateUTF8ToBlocks() passes UTF-8 through unchanged (Lemon supports
  full Unicode U+0020-U+04FF) vs transliterating for the default font
- DisplayDriver: add getCharWidth()/getLineHeight() virtuals (defaults 6/8);
  SH1106Display returns 5/9 for Lemon, 6/8 for default; add setLemonFont()
  no-op virtual; fix orphaned UTF-8 leading byte in drawTextEllipsized
- FullscreenMsgView: replace fixed-char-count word-wrap with pixel-accurate
  wrap using display.getTextWidth(); use getLineHeight() for spacing so
  Lemon (9 px) and default (8 px) both render correctly
- NodePrefs: add use_lemon_font field (0=default, 1=Lemon)
- SettingsScreen: add "Font" item in Display section (Default / Lemon),
  calls UITask::applyFont() on change
- UITask: add applyFont() that calls display->setLemonFont(use_lemon_font);
  called at startup (begin()) and when the setting changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:33:35 +02:00
Jakub
72c07df8b3 fix: code review corrections in DualSerialInterface and NearbyScreen
- DualSerialInterface: guard writeFrame/isWriteBusy/isBLEConnected with
  _ble_enabled to avoid BLE-after-disable race
- NearbyScreen: initialize all fields in constructor; promote D_* layout
  constants to class scope; clamp _dscroll on result count change;
  replace hardcoded 2 with D_VISIBLE in scroll logic; allow re-scan
  from detail view via KEY_CONTEXT_MENU/KEY_ENTER
- variant.cpp: fix inconsistent indentation in initVariant()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:08:28 +02:00
Jakub
38cd0fada3 feat: add 12h/24h clock format setting (default 24h)
Toggle in Settings > Display > Format. In 12h mode the clock shows
h:mm AM/PM (or h:mm:ss AM/PM with seconds, no space before AM/PM).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:04:43 +02:00
Jakub
e0312c2b6b fix: strip @[nick] reply prefix in channel and DM history card previews
Reply prefix was eating ~9 chars of display width, causing the actual
message body to be ellipsized in list cards. Fullscreen view already
showed the recipient correctly via the To: header line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:37:25 +02:00
Jakub
5828600d48 feat: dual BLE+USB serial — single firmware replaces separate BLE/USB builds
- DualSerialInterface: enable()/disable() control BLE only, USB always on;
  USB state machine not read while BLE connected to avoid partial-frame
  corruption; reset USB on BLE disconnect for clean reconnect
- Fix -UBLE_DEBUG_LOGGING (no space) to avoid PlatformIO SCons parse error
- build.sh: drop separate USB/BLE builds, dual_settings only
- wio-tracker-l1-eink: enable DUAL_SERIAL in companion_radio_ble build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:16:07 +02:00
Jakub
7a49584af7 docs: add Active Discovery section with ASCII mockups to README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:43:18 +02:00
Jakub
6b2f2ecf01 fix: replace base64.hpp include with local encoder to fix ODR link error
base64.hpp is header-only; including it in a .h file pulled into multiple
translation units caused duplicate symbol errors at link time.

Replaced with a self-contained static pubKeyToBase64() method inside
NearbyScreen that implements the same standard base64 encoding without
any external include.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wio-tracker-v1.15-plus.1.9
2026-05-21 09:14:16 +02:00
Jakub
52d97ed314 feat: show pub_key as base64 in discover detail screen
Replaces "Type: Repeater" line with the node's full public key encoded
as base64 (44 chars). drawTextEllipsized clips it with ... to fit the
128px wide display. Type is already visible in the inverted header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:11:32 +02:00
Jakub
3b7915d0b7 feat: discover detail screen + card selection + Rem removed from card body
Card body now shows only "RSSI:-87 SNR:7" (Rem was too long to fit).

List view:
- UP/DOWN selects items; selected card fully inverted, unselected keeps header-only highlight
- Enter opens full-screen detail for selected node
- Long-press Enter (context menu) re-scans

Detail screen:
- Inverted title bar with node name (or [Type])
- Type / RSSI / SNR / Rem / Status lines
- Cancel or context menu returns to discover list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:05:15 +02:00
Jakub
2da37b3af5 feat: 2-line boxed discover entries with RSSI, SNR, remote SNR
Each discovered node now renders as a boxed 2-line card (same style as
message history):
  ┌──────────────────────────────┐
  │ NodeName (or [Sensor])  Type │  ← inverted header
  │ RSSI:-87 SNR:7 Rem:5         │  ← signal stats
  └──────────────────────────────┘

Add snr_x4 and remote_snr_x4 to DiscoverResult:
  snr_x4       = _radio->getLastSNR()*4  (how well we heard the response)
  remote_snr_x4 = payload[1]             (how well responder heard our request)

2 items visible at a time; UP/DOWN scroll through results.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:56:54 +02:00
Jakub
2a9874d05d feat: show RSSI in discover results list
Add rssi field to DiscoverResult, captured from _radio->getLastRSSI()
when the discover response is received.

Display format in the right column:
  known node  → "Rpt-87" / "Snsr-92" (type + dBm)
  new node    → "*-87" (asterisk + dBm; type already visible in "[Rpt]" label)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:51:43 +02:00
Jakub
6249e63ec0 fix: remove isBLEConnected guard from discover response handling
The !isBLEConnected() check was too restrictive — if BLE happened to be
connected (app in background) the standalone discover would silently drop
all responses. Tag matching already provides correct isolation: responses
matching _pending_node_discover_tag are handled by the standalone UI and
not forwarded to the BLE app; responses with a different tag fall through
to the normal forward path.

Also show short type names (Rpt/Snsr/Room) in the discover results list
instead of generic "known"/"NEW", with a '*' prefix for nodes not yet
in contacts — matching the repeater/sensor distinction the app shows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:37:17 +02:00
Jakub
64098bc4dc fix: change [M]=Discover hint to [Enter]=Discover in NearbyScreen
[M] key doesn't exist on the device; context menu is long-press Enter.
Also handle KEY_ENTER directly when the list is empty so the hint
is accurate — pressing Enter with no contacts enters discover mode
without going through the context menu.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:13:13 +02:00
Jakub
d851043059 feat: add dedicated discover sub-screen to NearbyScreen
Replaces the inline advert scan in the nearby list with a proper
CTL_TYPE_NODE_DISCOVER_RESP-based sub-screen accessible via the context menu.

- DiscoveredEntry → DiscoverResult: adds name[32] and is_known flag so
  both known contacts and unknown nodes are shown with useful labels
- getDiscoveredNodes → getDiscoverResults, capacity 8 → 16
- onControlDataRecv populates name from contacts for known nodes and
  records all respondents (not just unknowns)
- NearbyScreen gains _discover_mode sub-screen: 8-second scan window,
  live result polling each render cycle, UP/DOWN scroll, CANCEL to
  return, ENTER/M to re-scan; known nodes show actual name + "known",
  unknown nodes show "[Type]" + "NEW"
- List view is clean: no discovered nodes mixed in, no scanning banner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 07:57:21 +02:00
Jakub
9cabcd5ac7 feat: replace advert scan with active node discovery in NearbyScreen
NearbyScreen now sends CTL_TYPE_NODE_DISCOVER_REQ (same protocol as the
companion app) instead of a plain self-advert. Nearby repeaters, sensors
and room servers respond with their pub_key and type. Known contacts get
their lastmod refreshed; unknown nodes appear as temporary entries (e.g.
"Repeater") in the list until their advert is received.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 00:16:53 +02:00
Jakub
9427fa1999 fix: correct dual serial interface — routing, UI state, debug logging
- isConnected() returns true always (USB always available, mesh can send)
- isBLEConnected() added to BaseSerialInterface for BLE-specific UI/buzzer state
- MyMesh uses isBLEConnected() to update UITask connection indicator
- Disable BLE_DEBUG_LOGGING in dual build (would corrupt USB stream)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 18:24:55 +02:00
Jakub
1787752e82 feat: add dual BLE+USB serial interface for Wio Tracker L1
BLE takes priority when connected; USB is always ready as fallback.
Both state machines run continuously — no BLE disconnect on USB connect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 18:20:10 +02:00
Jakub
3d739df666 docs: update README for font-switcher build and font setting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:04:14 +02:00
Jakub
f289252da5 ci: opt into Node.js 24 for all GitHub Actions workflows
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:03:15 +02:00
Jakub
e9b38fc559 ci: replace lemon-font build with font-switcher build
Build firmware from the font-switcher branch instead of font-lemon.
The font-switcher build includes both Adafruit and Lemon fonts in one
binary with a runtime toggle in Settings > Display.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wio-tracker-v1.15-plus.1.8
2026-05-20 09:42:09 +02:00
Jakub
6399df1f4a fix: improve buzzer volume control on nRF52
- Use inverted PWM polarity (0x8000) with PCT {2,5,12,25,50} giving
  ~6-8 dB perceptual steps (-24/-16/-9/-3/0 dB) vs the original
  uneven steps where levels 4 and 5 were only 1 dB apart
- Guard against cmp=0 truncation in both _nrfStartPwm and applyVolume:
  at level 1 with high notes (freq > ~2.5 kHz) integer math gives
  cmp=0 which with inverted polarity means 100% HIGH → complete silence
- Change volume preview note from C5 (523 Hz) to C6 (1047 Hz) to better
  match the piezo resonant frequency range and actual notification sounds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 09:06:00 +02:00
Jakub
31e91bda21 Update message formatting in README.md 2026-05-19 20:39:57 +02:00
Jakub
b19ab7f426 docs: add ASCII screen mockups to README feature sections
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 20:37:56 +02:00
Jakub
fa194016d7 feat: show message age (3m, 2h, >1d) in channel and DM history list
Stores RTC timestamp on each history entry and renders it right-aligned
on the sender row using a compact format (Xs/Xm/Xh/>1d).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 20:21:32 +02:00
Jakub
eee496b60b fix: add missing space after Type: and Seen: labels in NearbyScreen detail view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 17:44:49 +02:00
Jakub
9a8f324a63 docs: add Lemon font build section to README
Describes the font-lemon branch variant with native Unicode rendering,
pixel-accurate word wrap, and a link to the Lemon font source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 14:07:20 +02:00
Jakub
469b03ddf4 ci: update branch reference from font-experiments to font-lemon
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wio-tracker-v1.15-plus.1.7
2026-05-19 13:56:25 +02:00
Jakub
d9d4315c5d ci: build lemon-font firmware alongside standard on wio-tracker-v* tags
Add build-lemon-font job that checks out the font-experiments branch and
builds with FIRMWARE_VERSION suffixed with -lemon-font, producing files
like WioTrackerL1_*-v1.15-plus.1.7-lemon-font-SHA.uf2. A separate
release job collects artifacts from both builds into one draft release.
Tag pattern narrowed from wio-tracker-* to wio-tracker-v* to avoid
triggering on wio-tracker-lemon-* tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:44:25 +02:00
Jakub
02fd79d567 docs: update README with reply feature and screen lock
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 22:33:04 +02:00
Jakub
0f5740f6b6 fix: remove redundant slen clamp and update stale comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 18:20:42 +02:00
Jakub
34cfd27b8a fix: use @[nick] format for replies and fix fullscreen message display
- Reply prefix changed to "@[nick] " format — bracket delimiter handles
  nicks with spaces unambiguously
- FullscreenMsgView: parse "@[nick] body" to show "To: nick" header;
  fall back gracefully if format not matched
- Reduce FS_CHARS 21→20 to prevent scroll arrows overlapping last char
- Transliterate nick before displaying in "To:" header and "RE:" title
  so non-ASCII characters render correctly on the OLED font

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 18:18:45 +02:00
Jakub
b21bcb5ca4 fix: render reply popup in CHANNEL_HIST and DM_HIST phases
_ctx_menu.render() was only called in CONTACT_PICK and CHANNEL_PICK,
so the reply popup was active but invisible in history views. Added
render calls for list view and fullscreen view in both DM_HIST and
CHANNEL_HIST phases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 16:11:25 +02:00
Jakub
6f7de3ed20 feat: add reply action to channel and DM message history
Long-press Enter (KEY_CONTEXT_MENU) on a selected message shows an
'Options / Reply' popup in both list and fullscreen views. Confirming
opens MSG_PICK with 'RE: nick' title — the reply can be sent via
keyboard or quick message templates, both automatically prefixed with
'@nick '.

- Channel: reply prefix extracted from 'sender: message' format
- DM: reply available only on incoming messages, uses contact name
- FullscreenMsgView: REPLY added to Result enum, KEY_CONTEXT_MENU handled
- MSG_PICK: _reply_mode flag routes prefix through keyboard and templates
- Guard: prevent sending empty reply (prefix-only keyboard input ignored)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 15:12:11 +02:00
Jakub
8f566732ed feat: show @recipient as 'To: nick' bar in fullscreen message view
When a message starts with @nick, the fullscreen view expands the header
to show a second row 'To: nick' below the sender name, and displays the
message body without the @nick prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 15:00:01 +02:00
Jakub
9b61bc3028 fix: increase quick-message expansion buffer from 80 to 140 bytes
custom_msgs templates are up to 140 chars; the 80-byte msg[] buffer
silently truncated any message longer than 79 characters before sending.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:53:36 +02:00
Jakub
584ef33b3e fix: channel bot respects bot_enabled flag
tryBotReplyChannel checked bot_channel_enabled but not bot_enabled,
so disabling the bot via the main Enable toggle had no effect on
channel replies. Added bot_enabled to the guard condition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:41:56 +02:00
Jakub
4df97ae5ed fix: persist auto_lock setting across reboots
auto_lock was defined in NodePrefs but missing from both loadPrefsInt
and savePrefs in DataStore.cpp. Added at the end of the serialization
chain (inside if(file.available())) for backwards compatibility with
existing saved files — old files default to auto_lock=0 (disabled).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:39:10 +02:00
Jakub
a5a32530f0 Update Discord link in README.md 2026-05-17 18:55:21 +02:00
Jakub
44122565f6 perf: query sensors once for both lock screen dashboard fields
Previously each LPP sensor field called querySensors() separately.
Now a single querySensors() call fills a shared buffer used by both fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 18:52:40 +02:00
Jakub
28d69f88f4 Add Discord discussion link to README
Added a link to the discussion channel on Discord.
2026-05-17 18:51:48 +02:00
Jakub
360d5d10f7 feat: add 30s minimum interval option to auto-advert screen
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 14:33:58 +02:00
Jakub
a2856b7a48 fix: lock screen wake window no longer extends on repeated key presses
Previously every key press while locked reset _lock_wake_until to now+5s,
so multiple presses (or spurious button events) kept extending the window.
Now the 5s timer is set only when the display first wakes from dark.
The unlock sequence still extends the window on each Back+Enter step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 14:30:53 +02:00