Commit Graph

73 Commits

Author SHA1 Message Date
Jakub
2671e3f764 feat(ui): Trail phase 4 — Save/Load to flash + GPX export over USB
Single-slot persistence as agreed. Action popup grows three entries
(conditional on what makes sense for the current state):

- "Save trail"  — writes the current RAM ring to /trail in LittleFS.
- "Load trail"  — only shown when /trail exists; replaces the live ring
                  with the snapshot (any active session ends first).
- "Export GPX"  — dumps the trail as a minimal GPX 1.1 document over
                  Serial so the user can capture it from a USB host.

Plumbing:
- TrailStore gains writeTo / readFrom (template on the file handle, so
  the platform-specific File flavour stays out of Trail.h) plus
  exportGpx(Stream&) for the GPX serializer. Header carries magic
  "TRAL", a version byte, point count, and the accumulated active time
  so elapsed survives the round trip.
- DataStore::openWrite is exposed publicly so callers outside DataStore
  don't have to duplicate the platform open-mode dance.
- MyMesh gains a public getDataStore() accessor.

After Load, _pending_seg_break is set so any subsequent Start opens a
new segment instead of joining the loaded last point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 07:49:17 +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
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
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
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
083ddac85c refactor: remove ping from NearbyScreen, rely on auto-advert for presence
Ping sent empty messages appearing in target's chat history, and RTT
measurement never worked for direct sendMessage() calls. Removed all
ping state machinery and registerExpectedAck(); detail view now shows
node info only (lat/lon/dist/bearing/type).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 16:17:52 +02:00
Jakub
09ac455806 feat: add periodic auto-advert with GPS position (Auto-Advert tool)
Adds configurable periodic 0-hop self-advert that includes GPS coordinates,
making the device's position visible in other nodes' Nearby Nodes screen.
Options: off / 1min / 2min / 5min / 10min / 30min / 1h.

Accessible via Tools → Auto-Advert. Timer runs in MyMesh::loop().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 16:08:33 +02:00
Jakub
d59687647f fix: wire NearbyScreen ping through expected_ack_table so RTT is measurable
Direct sendMessage() calls bypass the BT serial handler that populates
expected_ack_table; add registerExpectedAck() to MyMesh and call it from
NearbyScreen so isAckPending() can actually track the outstanding ping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 15:57:00 +02:00
Jakub
9e5c0e79e7 fix: move EXPECTED_ACK_TABLE_SIZE define before class for isAckPending
The #define was inside the private section, after isAckPending() which
references it — preprocessor hadn't seen the symbol yet at that point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 11:30:43 +02:00
Jakub
24474f67fa feat: NearbyScreen, configurable clock dashboard, memory optimizations
- Add NearbyScreen: GPS contact list with haversine distance sort,
  type filter (ALL/Chat/Rpt/Room/Snsr), detail view with ping (RTT via
  ACK poll), node scan via advert(), context menu
- Add DashboardConfigScreen: configure up to 3 data fields on the clock
  page (Battery, Temp, Humidity, Pressure, GPS, Altitude, Lux, CO2,
  Contacts); entered via long-press ENTER on clock page
- Rework HP_CLOCK layout: full-screen clock (size 2 at y=0), date at
  y=19, separator at y=28, three data field rows at y=31/41/51;
  hide node name/battery indicator on clock page
- Persist dashboard_fields[3] in NodePrefs and DataStore
- Add isAckPending() to MyMesh for NearbyScreen ping detection
- Wire NearbyScreen into ToolsScreen and UITask
- Reduce NearbyScreen entry buffer from MAX_CONTACTS(100) to 32,
  saving ~3.3 KB RAM
- Switch haversine/bearing math from double to float (sinf/cosf/atan2f),
  eliminating double libm and saving ~5-10 KB flash

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 11:28:36 +02:00
Jakub
f6e251cfe3 chore: adopt vX.Y-plus.N versioning scheme
vX.Y tracks upstream major.minor; plus.N is fork-specific revision.
Bump to v1.15-plus.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
dd2c09174f Extract bot logic from MyMesh into MyMeshBot.h
Move tryBotReplyDM() and tryBotReplyChannel() implementations to
MyMeshBot.h (included at end of MyMesh.cpp). onMessageRecv and
onChannelMessageRecv now contain only a single-line call each,
minimising the diff against upstream in those methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
dcccc9733b Bot: global keyboard in BotScreen, placeholder expansion via MsgExpand.h
- Replace BotScreen's custom embedded keyboard with the shared global
  keyboard layout (KB_* constants): char rows at KB_CHARS_Y, special row
  at KB_SPECIAL_Y=48 with 5 buttons ([^][Sp][Del][{}][OK]), fixing the
  previous layout that rendered below the 64 px display boundary.
  Proportional column scaling between char rows (10 cols) and special row
  (5 cols). [{}] opens the placeholder picker overlay.

- Add MsgExpand.h: standalone inline expandMsg() with no framework
  dependencies, expanding {loc} and {time} placeholders. Used by both
  MyMesh (bot channel/DM replies) and QuickMsgScreen, replacing the
  duplicate expandBotMsg() static and the inline expandMsg() method.

- Bump FIRMWARE_VERSION to v1.15.3.

- ToolsScreen: remove key-hint footer line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
58afc23df3 Add Auto-Reply Bot and Tools screen to home carousel
- New 'Tools' page on the home screen carousel with Ringtone Editor and Auto-Reply Bot items
- Bot settings: enable/disable toggle, channel picker, trigger phrase, reply text (keyboard with pre-fill)
- Bot logic in MyMesh: case-insensitive substring match, 10 s cooldown to prevent reply loops
- Settings: Home Pages visibility control (which carousel pages are shown; Settings and Messages always visible)
- DataStore: persist home_pages_mask and bot fields with backward-compat guards on read

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
aa99b77de4 WioTrackerL1 UI v1.15.1: bugfixes and UX polish
- Fix placeholder picker colors: dark box + white border, light fill
  for selected item (consistent with rest of UI)
- Fix placeholders not expanded when sending from keyboard (expandMsg
  was only called in MSG_PICK path, not KEYBOARD path)
- Fix sent messages incrementing unread counter: set _phase=CHANNEL_HIST
  before addChannelMsg so viewing=true
- Fix keyboard column inverse mapping on UP from special row
- Remove old_row dead code from QuickMsgScreen keyboard handler
- Alert banner shown only on home screen, suppressed in settings/messages
- Bump FIRMWARE_VERSION to v1.15.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
1fe5922c79 Add RTC time persistence to flash
Save last known unix timestamp to /rtc_save on shutdown and restore it
on startup, so the clock shows correct time immediately after restart
without waiting for GPS fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Scott Powell
3751785400 * version 1.15.0 2026-04-19 11:27:55 +10:00
Scott Powell
d2fdd6fad4 * companion: FIRMWARE_VER_CODE now bumped to 11 2026-04-15 20:47:17 +10:00
Scott Powell
efdd2b6a6c * companion: simplified the CMD_GET / CMD_SET _DEFAULT_FLOOD_SCOPE 2026-04-13 23:11:21 +10:00
Scott Powell
3b32f35288 * Companion: default scope 2026-04-10 17:01:41 +10:00
Scott Powell
2325973fec * Companion: applyGPSPrefs() now just in one place (moved out of UITask) 2026-03-25 16:26:51 +11:00
Alejandro Ramirez
f8dbdce6bb fix: apply persisted GPS enabled setting on boot for companion radio
The companion_radio example was not restoring the GPS enabled/disabled
preference from flash after reboot. The preference was being saved
correctly when toggled via the mobile app, but on boot,
sensors.begin() -> initBasicGPS() unconditionally sets gps_active=false
and nothing subsequently restored the persisted state.

Added applyGpsPrefs() (matching the pattern in simple_repeater,
simple_sensor, and simple_room_server) and call it from main.cpp
after sensors.begin() to ensure the GPS hardware is initialized
before the saved preference is applied.
2026-03-24 09:10:09 -05:00
Liam Cottle
91aed048e9 Merge pull request #1928 from dz0ny/feat/grp-data-upstream
feat: Add support for PAYLOAD_TYPE_GRP_DATA
2026-03-23 21:41:51 +13:00
Scott Powell
467959cc3b * version 1.14.1 2026-03-20 12:32:41 +11:00
Janez T
2f68769185 fix: Widen grp data type
ref: #1928
2026-03-19 09:25:42 +01:00
Janez T
1fb26e7623 fix: Drop grp data timestamp
ref: #1928
2026-03-19 09:22:12 +01:00
Janez T
a21b83b127 fix: address comments
ref:
2026-03-18 20:09:11 +01:00
Janez T
9b84278607 feat: Add support for PAYLOAD_TYPE_GRP_DATA
Docs changes are to reflect how it is currently in fw

This adds ability to send datagram data to everyone in channel
2026-03-18 20:08:52 +01:00
Scott Powell
3fe2dd7f48 * ver 1.14.0 2026-03-06 12:20:04 +11:00
Wouter Bijen
00566741f6 Add configurable max hops filter for auto-add contacts
Filter auto-add of new contacts by hop count (issues #1533, #1546).
Setting is configurable from the companion app via extended
CMD_SET/GET_AUTOADD_CONFIG protocol (0 = no limit, 1-63 = max hops).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:41:41 +01:00
Scott Powell
5b0884ad2d * added CMD_SET_PATH_HASH_MODE 2026-02-23 21:08:22 +11:00
Scott Powell
2e00298128 * companion: retransmit delays now hard-coded (only for client repeat mode) 2026-02-17 20:25:56 +11:00
Scott Powell
e2571accbe * ver 1.13.0 2026-02-15 17:24:37 +11:00
Scott Powell
564a19d125 * companion client repeat mode support 2026-02-14 15:50:06 +11:00
Scott Powell
465776d667 * ver 1.12.0 2026-01-29 21:12:31 +11:00
taco
403ce1db08 contacts: granular autoadd and overwrite-oldest 2026-01-15 18:01:20 +11:00
Scott Powell
e054597a18 * ver 1.11.0 2025-11-30 18:32:10 +11:00
zaquaz
2bd47de3b9 Added buzzer config persistance accross restart 2025-11-20 19:02:32 -08:00
Scott Powell
91e9fcea4b * ver 1.10.0 2025-11-13 20:45:38 +11:00
Scott Powell
2e63499ae5 * companion: protocol ver bumped to 8. 2025-11-06 22:51:17 +11:00
Scott Powell
4a5404d997 * companion: added CMD_SEND_CONTROL_DATA, and PUSH_CODE_CONTROL_DATA 2025-11-06 22:10:20 +11:00
Scott Powell
9ebeb477aa * RegionMap: inverted 'flags' to _deny_ bits
* Mesh: new filterRecvFloodPacket() for overriding
* repeater CLI: 'allow' -> 'allowf' or 'denyf'
2025-11-05 14:34:44 +11:00
Scott Powell
d9ff3a4d02 * Mesh: new sendFlood() overload with transport codes.
* BaseChatMesh:  sendFloodScoped(), for overriding with some outbound 'scope' / TransportKey
* companion: new 'send_scope' variable.
2025-11-04 01:21:56 +11:00
Scott Powell
8d8b9a6141 * ver 1.9.1 2025-10-02 12:52:19 +10:00
Scott Powell
b92d9bd972 * ver 1.9.0 2025-09-28 19:24:00 +10:00
Scott Powell
52d5cc6068 * tidy and minor fix for offline queue deletion 2025-09-22 15:01:28 +10:00
Scott Powell
74dea260e5 * proposed change for re-trying reciprocal path transmit 2025-09-08 19:22:59 +10:00
Scott Powell
637891b814 * ver bump 2025-09-01 19:32:15 +10:00