Commit Graph

2867 Commits

Author SHA1 Message Date
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
Jakub
3fb0a55aef fix: auto-reset _lock_seq_used after 5s in case Back release event is missed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:17:02 +02:00
Jakub
2bc6dae78e feat: add Icelandic and Romanian legacy cedilla transliteration
Adds ð/Ð (eth), þ/Þ (thorn) for Icelandic, and ţ/Ţ (t with cedilla)
for legacy-encoded Romanian text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:11:42 +02:00
Jakub
b0552e246a feat: extend UTF-8 transliteration to cover all major European languages
Adds Scandinavian (å ø æ), Hungarian (ő ű), Romanian (ă ș ț),
Croatian (đ), Turkish (ğ ş ı), and Baltic/Lithuanian/Latvian
(ā ē ī ū ģ ķ ļ ņ ŗ ų ė į) diacritics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:08:20 +02:00
Jakub
6492fd490e feat: add Czech and Slovak diacritic transliteration
Adds háček and other Czech/Slovak characters (č š ž ř ě ů ď ť ň ľ ĺ ŕ)
to the UTF-8 transliteration table so they display as ASCII letters
instead of █ blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:01:51 +02:00
Jakub
20e88443b4 fix: polish lock screen sequence — hints update instantly, screen stays on, triple-Back blocked
- Turn display on at first Back+Enter press so hints are visible even when screen was dark
- Extend _lock_wake_until on every sequence step to prevent screen blanking mid-press
- Set _next_refresh=0 on every Enter press (not just on completion) for immediate hint redraw
- Add _lock_seq_used flag to suppress the Back CLICK that fires on release after unlock
- Block triple-Back (buzzer toggle) when screen is locked

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 11:17:59 +02:00
Jakub
43f3621fdc fix: replace long-press lock trigger with back_btn.isPressed() check
Long press detection on back_btn was unreliable — the release generated
a spurious CLICK that cancelled the sequence. Now the Enter click handler
checks back_btn.isPressed() directly: holding Back and clicking Enter 3×
within 3 seconds locks/unlocks the screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 10:09:54 +02:00
Jakub
ef0241b5f3 feat: show two dashboard sensor values on lock screen
Reuses dashboard_fields[0] and [1] from NodePrefs — left-aligned and
right-aligned in one row under the clock, no labels to save space.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 10:04:28 +02:00
Jakub
9ff42a9296 feat: screen lock — hold Back + 3×Enter to lock/unlock
- Long press Back starts lock sequence; 3 Enter presses within 3s toggle lock
- Locked screen wakes for 5 seconds on any key, showing clock and unlock hint
- Incoming messages do not wake the display while locked
- Auto Lock setting in Display section: locks automatically when screen turns off
- Lock state persisted in UITask; NodePrefs gains auto_lock flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 09:55:51 +02:00
Jakub
b068318bc5 refactor: extract SettingsScreen and QuickMsgScreen to separate header files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wio-tracker-v1.15-plus.1.5
2026-05-17 00:12:40 +02:00
Jakub
a60ec376d7 perf: increase render interval on static screens from 300ms to 2000ms
Static screens (SettingsScreen, BotScreen, FullscreenMsgView, message
list, contact picker) were re-rendering every 300ms with no visible
benefit. New messages still trigger immediate refresh via newMsg() →
_next_refresh=100, so responsiveness is unchanged. Reduces unnecessary
SPI transfers and CPU wakeups ~6x on idle static screens.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:42:52 +02:00
Jakub
c4b152fd6a fix: clear arrow background in FullscreenMsgView to prevent text overlap
Text lines fill the full display width, causing the last chars to bleed
into the scroll arrow area. Draw a DARK fillRect behind each arrow before
rendering it, so the arrow appears on a clean black background without
truncating the text width.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:28:18 +02:00
Jakub
5d41812784 fix: separate DM and channel bot reply cooldown timers
Single shared _bot_last_reply_ms caused a DM reply to block the
channel bot for 10s and vice versa. Split into _bot_last_dm_reply_ms
and _bot_last_ch_reply_ms so each cooldown is independent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:26:31 +02:00
Jakub
44b2519df4 fix: with_sender buffer too small and FS_LINE_H mismatch
- with_sender[160] could hold only ~160 chars but node_name(32) +
  expanded(200) needs up to 234; snprintf would silently truncate
  the UI display entry. Increased to 240.
- FS_LINE_H was 9 but Adafruit 5x7 font line height is 8, wasting
  1px per line and showing 5 lines instead of 6.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:23:20 +02:00
Jakub
1b9dc42250 fix: bot trigger matched against message body only, not sender name
Channel messages have the format "sender_name: body". The trigger was
being searched across the whole string, so a nick containing the trigger
word would fire a reply even with an unrelated message. Now the match
skips past the ": " separator and only checks the message body.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:19:12 +02:00