Commit Graph

3428 Commits

Author SHA1 Message Date
MarekZegare4
09b56ad87e feat(ui): scalable mini-icons; delivery markers scale with font
Landscape e-ink renders text at 2×, but the delivery markers were drawn at a
fixed ~5px and looked tiny. Standardise small procedural glyphs into a reusable
mini-icon facility in icons.h:
- miniIconScale() derives 1×/2×/… from getLineHeight() (8px line = 1×).
- miniIconDraw() renders a compact bitmap (1 byte/row, bit=pixel) scaled and
  vertically centred; miniIconDotRow() draws the scaled pending-dots row.
- ICON_CHECK / ICON_CROSS bitmaps; adding a new status icon is now a bitmap +
  one draw call.
drawAckGlyph() routes through these, so ✓ / ✗ / dots scale with the font on all
displays.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 15:27:33 +02:00
MarekZegare4
606fbbe243 feat(ui): pending DM marker shows one dot per send (resend count)
The awaiting-ACK marker now draws a row of dots equal to how many times the
DM has been transmitted (1 = first send, +1 per auto-resend), so the user can
see retry progress before it resolves to checkmark/cross.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 15:20:37 +02:00
MarekZegare4
aa4bb490d0 feat(ui): DM auto-resend + incoming dedup + channel relay ring
DM auto-resend (delivery status follow-up):
- New pref dm_resend_count (0-5, default 2), Settings › Messages › Resend.
  Schema sentinel 0xC0DE0009 → 0xC0DE000A; old files clamp to the default.
- When a pending on-device DM passes its ACK deadline, tickDmResends()
  (driven from UITask::loop, so it runs in the background regardless of the
  active screen) re-sends with the next attempt# reusing the original
  timestamp, refreshing ack_tag/deadline, until resends run out → then ✗.
- dmEffectiveStatus keeps the entry pending while resends remain.

Incoming DM dedup:
- A retry reuses the sender timestamp + text but has a fresh packet hash, so
  the mesh dup-filter passes it. addDMMsg now takes sender_timestamp and drops
  copies matching prefix+timestamp+text. sender_timestamp plumbed from
  MyMesh::queueMessage through AbstractUITask/UITask.

Channel relay ring:
- Replace the single-slot relayed-into-mesh tracker with a 4-slot ring so a
  quick burst of channel sends are each matched to their repeater echo.
  Receive-path hashing still gated (now on _relay_active) so the hot flood
  path is untouched when idle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 15:13:29 +02:00
MarekZegare4
54b53f7f0f fix(ui): trim extra pixel from checkmark glyph long arm
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:41:23 +02:00
MarekZegare4
7489281dc5 feat(ui): show delivery marker in fullscreen message view
Draw the same delivery glyph in the inverted header bar of the fullscreen
DM and channel views (DARK ink), matching the history-list behaviour:
DM shows pending/delivered/failed for outgoing, channels show ✓ only on
repeater echo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:40:10 +02:00
MarekZegare4
0e2e149e18 fix(ui): DM marker stuck at ✗ for on-device sends
isAckPending() only tracks app/serial-initiated DMs (expected_ack_table);
a DM composed on the device UI registers in BaseChatMesh's own ack table,
so gating the UI notification on that table left every on-device DM timing
out to ✗. Notify the UI on every ACK and let it match the crc against its
own pending tag; APC SNR sampling stays gated on isAckPending().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:34:58 +02:00
MarekZegare4
d064a617e0 feat(ui): channel "relayed into mesh" marker (✓ on repeater echo)
Channels have no recipient ACK, so true delivery can't be shown. Instead reuse
the heard-repeater-echo idea (same as APC's flood feedback) to mark an outgoing
channel message ✓ once a repeater rebroadcast of it is heard — i.e. it was
relayed into the mesh. No echo is NOT a failure (direct/0-hop neighbours never
echo), so unconfirmed sends simply show no marker.

- MyMesh: single-slot relay tracker independent of APC (trackRelaySend on every
  channel flood; hash-match in filterRecvFloodPacket gated on _relay_pending so
  the hot recv path is untouched otherwise; window expiry in loop just drops it).
  lastChannelRelaySeq() hands the seq to the UI.
- AbstractUITask::onChannelRelayed() -> UITask -> QuickMsgScreen::markChannelRelayed().
- ChHistEntry gains relay_status / relay_seq; afterSend arms the marker on the
  exact stored entry; render shows ✓ only on ACK_OK for our own ("Me:") rows.

Verified: GAT562 (SSD1306) and WioTrackerL1Eink (GxEPD) solo builds compile clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 14:18:51 +02:00
MarekZegare4
219a2bba5c feat(ui): DM delivery status marker (pending / delivered / failed)
Outgoing direct messages now show a small delivery glyph after "Me" in the DM
history, driven by MeshCore's existing end-to-end ACK (no protocol change):
- · pending (awaiting ACK)
- ✓ delivered (ACK matched)
- ✗ failed (no ACK by the deadline)

Plumbing:
- DmHistEntry gains ack_status / ack_tag / ack_deadline_ms (RAM only).
- sendText() captures expected_ack + est_timeout; afterSend() stores them.
- AbstractUITask::onMsgAck() virtual; MyMesh::onAckRecv routes ours-only ACKs
  to UITask -> QuickMsgScreen::markDmDelivered().
- Status evaluated lazily (pending past deadline reads as failed); no timer.
- Glyphs hand-drawn (no font has a usable check/cross), font-independent.

Sends with no path (expected_ack == 0) show no marker (can't be confirmed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 14:07:15 +02:00
MarekZegare4
8545454f5b docs(features): add unprioritised idea backlog (DM delivery status + 10 more)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 13:47:12 +02:00
MarekZegare4
b8a7b5dcc0 refactor: dedup persistence header, harden action menu, tidy small items
- Persist.h: shared writeHeader()/readHeader() for the magic+version+count
  on-disk header; Waypoint and Trail snapshots now share one implementation
  (byte layout unchanged; each keeps its own count clamp/reject + extra fields).
- TrailScreen: pushAction() guards _act_map / PopupMenu capacity, so adding a
  new action can't silently overrun the fixed array.
- PopupMenu: add count()/setSelected() accessors; replace the remaining direct
  _sel/_count field pokes in NearbyScreen, TrailScreen and QuickMsgScreen.
- Trail summary: unit-suffixed time ("1h 05m" / "5m 03s") so hours can't be
  misread as minutes.
- Trail::haversineMeters delegates to geo::haversineKm — single Haversine
  implementation (also trims a little flash).

Verified: GAT562 (SSD1306) and WioTrackerL1Eink (GxEPD) solo builds compile clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 13:37:03 +02:00
MarekZegare4
151892e1ce refactor(ui): extract shared helpers, dedup screens, GPS shutdown via provider
Pull repeated UI idioms into DisplayDriver and remove duplicated logic:

- DisplayDriver: add drawScrollArrows() and drawInvertedHeader(); replaces 11
  copy-pasted scroll-arrow blocks across 5 screens and 3 inverted title-bar
  blocks (NearbyScreen x2, NavView). Standardises the detail-view separator.
- useImperial(): single source on UITask; NearbyScreen/TrailScreen delegate
  instead of each re-reading NodePrefs.units_imperial.
- NearbyScreen: extract saveSelectedWaypoint() (two identical blocks -> one);
  drop the redundant local label buffer (WaypointStore truncates).
- UITask::shutdown(): power GPS off through LocationProvider::stop() instead of
  poking PIN_GPS_EN directly — centralises enable/reset-pin + active-level logic.

Net -58 lines. Verified: GAT562 (SSD1306) and WioTrackerL1Eink (GxEPD) solo
builds compile clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 13:21:59 +02:00
MarekZegare4
1521be3803 fix(trail): check read() return for header bytes in readFrom/exportGpxFromFile
Mirrors the Waypoint::readFrom() hardening — reject a truncated trail
snapshot instead of proceeding with garbage header fields. Consistency
with the waypoint store's persistence path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:53:40 +02:00
MarekZegare4
fcdacaa3bc fix: GPS shutdown active-level, buzzer octave-8 consistency, waypoint header read checks
- UITask::shutdown(): power GPS off using !PIN_GPS_EN_ACTIVE instead of hardcoded
  LOW, matching MicroNMEALocationProvider::stop() (still LOW on current active-high
  devices, but correct for a future active-low GPS).
- buzzer _noteFreq(): clamp octave to 8 instead of 7 so the parser's accepted range
  (4-8) is fully consumed; previously an octave-8 digit was clamped away and could
  leak into the stream as the next note's duration.
- Waypoint::readFrom(): check read() return for version/reserved/count header bytes
  so a truncated file is rejected instead of using garbage count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:49:15 +02:00
MarekZegare4
6c5a40a8ce fix(power): power off GPS before SYSTEMOFF to prevent battery drain on shutdown
NRF52 GPIO pins retain their last state in SYSTEMOFF. If GPS was active,
PIN_GPS_EN stays HIGH and the module keeps drawing ~20mA. gps_enabled is
already persisted to flash so applyGpsPrefs() restores the correct state
on next boot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:29:33 +02:00
MarekZegare4
2c847c996f docs(readme): rename to MeshCore Solo Companion Firmware, add supported devices table, consolidate solo tools section
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.18
2026-06-14 10:16:13 +02:00
MarekZegare4
be6767b0cb Merge remote-tracking branch 'upstream/main' 2026-06-14 09:57:48 +02:00
MarekZegare4
2766a098a5 fix(bot): preserve trigger case, lowercase only at match time
Trigger is now stored as typed (e.g. "Ping" stays "Ping").
Case-insensitive matching is preserved by lowercasing both
the trigger and incoming message at comparison time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 09:53:09 +02:00
Liam Cottle
e8d3c53ba1 Merge pull request #2753 from formtapez/cli-docs
Added some missing CLI commands
2026-06-13 00:17:36 +12:00
MarekZegare4
ec4b7d625f fix(ui): force immediate refresh when BLE disconnects
UITask.onBLEDisconnected() sets _next_refresh=0 so the BLE icon
updates instantly instead of waiting for the next polling cycle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 12:59:41 +02:00
formtapez
d3444e6b0b fix formatting 2026-06-12 12:14:46 +02:00
formtapez
06130dce29 added some missing CLI commands 2026-06-12 12:11:12 +02:00
MarekZegare4
a1fc67ed96 feat(variants): enable ENABLE_SCREENSHOT on all solo_dual builds
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 09:50:31 +02:00
MarekZegare4
5ec61477e6 feat(ui): simplify solo splash label, remove outdated WIOTRACKER_L1.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 09:46:45 +02:00
Liam Cottle
55ad7689d5 Merge pull request #2748 from liamcottle/github/stale-bot
Configure GitHub Stale Bot
2026-06-12 03:24:26 +12:00
liamcottle
3b39925399 use single quotes for repo name 2026-06-12 03:20:44 +12:00
liamcottle
c94ed29ca3 add github workflow to close stale issues 2026-06-12 03:18:10 +12:00
MarekZegare4
ea9681075d Merge remote-tracking branch 'upstream/main' 2026-06-11 13:09:31 +02:00
MarekZegare4
99a35cade7 fix(ci): strip _companion from solo firmware filenames
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.17.1
2026-06-11 11:02:59 +02:00
MarekZegare4
e83b2f706c fix(ci): search variant subdirs for _solo_dual envs in matrix generation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:57:01 +02:00
MarekZegare4
8261c3c364 feat(ci): dynamic solo firmware build workflow, add _solo_dual envs for Wio Tracker L1
- Add build-solo-firmwares.yml: auto-detects all _solo_dual envs from platformio.ini, builds in parallel, publishes uf2 files to draft release
- Remove build-wio-tracker-l1-firmwares.yml (replaced by solo workflow)
- Add WioTrackerL1_companion_solo_dual and WioTrackerL1Eink_companion_solo_dual envs
- Wire build-solo-firmwares command in build.sh using _solo_dual suffix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:43:33 +02:00
Liam Cottle
5a342c7a20 Merge pull request #2691 from NoodlesNZ/security-policy
Add Github Security policy
2026-06-11 19:25:53 +12:00
Jakub
5b58049139 feat(power): battery saving — hardware duty-cycle RX + adaptive TX power
Two independent, default-off toggles under Settings › Radio.

Pwr save: hardware RX duty-cycle (SX126x SetRxDutyCycle via
startReceiveDutyCycleAuto). The chip cycles RX↔sleep and wakes on a preamble —
no MCU state machine; recvRaw reads the packet exactly as in continuous RX.
Falls back to continuous RX on non-SX126x. (Replaces an earlier software-CAD
state machine that fought the hardware: polling a warm-sleeping chip gave a
phantom-busy channel that stalled TX ~4 s and dropped ACKs in the scan gaps.)

Auto pwr: Adaptive Power Control. tx_power_dbm becomes a ceiling; actual TX
power tracks the reverse-link SNR margin (measured above the per-SF demod floor,
EWMA-smoothed, proportional step with a deadband). Feedback comes from direct /
room-server ACKs and, for channels (no ACK), from hearing a repeater rebroadcast
our own flood; a lost confirmation ramps power back up so channel sends can't get
stranded below what the repeaters can hear.

Prefs schema 0xC0DE0009 (rx_powersave, tx_apc). Radio page / name bar show the
live TX power; noise floor reads n/a while duty-cycling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 08:15:42 +02:00
Jakub
baaac3179c fix(gat562-30s): comment out phantom QSPI flash defines
Restore commented-out EXTERNAL_FLASH_DEVICES/USE_QSPI for reference;
board has no QSPI flash chip — defines were RAK4631 leftovers causing
framework to lock P0.28/P0.30 (joystick UP/LEFT) as QSPI outputs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 17:17:04 +02:00
Jakub
03f9023a72 fix(gat562-30s): remove phantom QSPI flash defines from variant.h
Board has no QSPI flash chip — EXTERNAL_FLASH_DEVICES/USE_QSPI were
copied from RAK4631. The framework was initialising the QSPI peripheral
on startup, locking P0.28/P0.30 (joystick UP/LEFT) as outputs. Removing
these defines prevents QSPI init entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 07:28:09 +02:00
Jakub
d6d16c26c8 fix(gat562-30s): disable QSPIFLASH in solo envs — pins conflict with joystick
QSPI IO0=P0.30 and IO2=P0.28 are wired to joystick LEFT and UP on this
board. QSPI init configures those pins as OUTPUT, blocking button reads.
Disable QSPIFLASH so the joystick works; firmware falls back to internal
flash storage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 07:26:10 +02:00
Jakub
4815e6f18d feat(gat562-30s): add solo build envs, fix joystick/GPS/buzzer/display
- SSD1306Display: track _text_sz in setTextSize(); override getCharWidth()
  and getLineHeight() so line spacing scales with text size (fixes text
  overlap on splash/clock screens at size 2)
- gat562_30s_mesh_kit variant.h: fix PIN_GPS_EN 33→34 (IO2/P1.02 controls
  GPS module power via Q3/Q5 transistors; 33 = BEE_EN = buzzer)
- gat562_30s_mesh_kit variant.h: correct joystick pin comments (P0.xx labels
  were cyclically wrong; pin numbers already correct)
- gat562_30s_mesh_kit target.h/cpp: declare and instantiate joystick_up/down
  under UI_HAS_JOYSTICK_UPDOWN guard (fixes compile error in solo envs)
- gat562_30s_mesh_kit platformio.ini: add solo_ble and solo_dual environments
  with GPS, BLE, joystick up/down, QSPI flash, and buzzer (NonBlockingRTTTL)
- gat562_mesh_watch13 platformio.ini: add solo_ble environment with GPS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:39:46 +02:00
Jakub
231b3c0e0d fix(NearbyScreen): sort "?" entries to bottom in TIME filter
Contacts with lastmod=0 or lastmod>now (RTC not synced after reboot but
contacts have timestamps from a prior session) were sorted to the top
because their raw lastmod > 0. Now both cases are normalised to 0 before
the comparison, so unknown-time entries always appear at the bottom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.17
2026-06-09 17:23:50 +02:00
Jakub
562cef3261 fix(NearbyScreen): show "?" for contacts with no timestamp in TIME filter
lastmod == 0 produced age = 0 → displayed as "0s"; now shows "?" instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:19:06 +02:00
Jakub
54ab351b2f fix(NearbyScreen): TIME filter stale sort + right-align distance/age column
- TIME mode: call refresh() every 3 s so newly-heard contacts bubble up
  to the correct position; previously the list froze at the order captured
  when the filter was selected.
- All filters: right-align the distance/age value within the right column
  (width - textWidth - 2 px) instead of pinning it to a fixed left edge,
  so short strings like "5s" or "3m" sit flush with the longer ones.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:15:07 +02:00
Jakub
2cc68fb987 fix(trail,batt): GPX NUL in stream + battery curve top at 4170 mV
- Trail.h gpxWaypoints/gpxPoint: snprintf truncation clamp was `> sizeof`
  (writing the NUL terminator into the XML stream); corrected to
  `>= sizeof - 1` at all 3 sites (<wpt>, <time>, <trkpt>).
- UITask.cpp battMvToPercent: raise 100% ceiling from 4200 → 4170 mV —
  the board never charges to 4200, so the indicator was stuck at ~97%.
- Trail.h header comment: corrected RAM cost from "256×12 B=3 KB" to
  actual CAPACITY(512)×16 B=8 KB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:00:00 +02:00
Jakub
e6f8fb99c7 feat(NearbyScreen): waypoint/navigate from list, TIME filter, addWaypoint helper
NearbyScreen:
- Hold Enter on a list row now shows Navigate and Save waypoint directly,
  without entering the detail view first
- TIME added as the last filter slot (LEFT/RIGHT cycles Fav→ALL→…→Snsr→TIME);
  time-sort shows age in right column and sorts by last-heard descending
- Save waypoint also available from detail view Options menu

UITask:
- Extract addWaypoint() helper (two overloads: with/without explicit timestamp)
  consolidating the full()+add()+saveWaypoints()+alert pattern; TrailScreen
  and QuickMsgScreen updated to use it

Fixes:
- SoundNotifier.h: correct NodePrefs.h include path (../NodePrefs.h)
- kbAddSensorPlaceholders: dereference _kb pointer in SettingsScreen,
  QuickMsgScreen and BotScreen (signature changed to KeyboardWidget&)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 15:09:57 +02:00
Jakub
5c86b85ec3 docs(README): add Solo GPX Downloader web tool to GPX Trail Export section
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 08:16:30 +02:00
Jakub
e653f51e94 docs(trail): add Solo GPX Downloader web tool to Downloading GPX section
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 08:16:30 +02:00
Jakub
8a77812eb0 Delete CNAME 2026-06-09 07:56:14 +02:00
Jakub
a5445c633d fix(gpx-downloader): fix broken h1 tag (Solo GPX Downloader)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:53:38 +02:00
Jakub
e51bc0629d feat(tools): add GPX Downloader web app
Single-file Web Serial app for GitHub Pages. Connects to the device
over USB CDC, auto-detects <?xml…</gpx> frame from the Export GPX
action, and offers the file as a browser download with an editable
filename (defaults to trail_YYYY-MM-DD.gpx). Resets automatically
after download so back-to-back exports work without reconnecting.

Requires Chrome/Edge (Web Serial API). Enable GitHub Pages from the
repo settings pointing at the branch root or docs/ as needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:51:00 +02:00
Jakub
9aadce2262 refactor(QuickMsgScreen): extract markReadAlert() helper
Deduplicate the snprintf+showAlert pattern used in three mark-as-read
sites into a single private method.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:45:40 +02:00
Jakub
fec4828124 fix(QuickMsgScreen): show "N marked read" alert for per-contact and per-channel mark-as-read
MODE_SELECT already showed the count; CONTACT_PICK ("Mark as read") and
CHANNEL_PICK ("Mark all read") were silently clearing unread without
any feedback. Count is read before zeroing so the alert is accurate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:43:51 +02:00
Jakub
51ce15bbdc refactor: extract SoundNotifier helper from UITask::notify()
Move all buzzer/melody dispatch (DM, channel, advert) into a new
SoundNotifier class in SoundNotifier.h, isolating fork-specific sound
code so upstream changes to notify() no longer cause merge conflicts.
The shared playSlot() helper also removes the custom_played
duplication that existed across the three cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 21:51:03 +02:00
Jakub
ca9b3ff726 cleanup: remove dead UIEventType::advertReceived
The enum value and its case label were never emitted after PR #16 —
both dispatch sites in MyMesh.cpp now use advertReceivedFlood or
advertReceivedZeroHop exclusively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:47:37 +02:00