Commit Graph

3406 Commits

Author SHA1 Message Date
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
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
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
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
Jakub
c339dc7d97 refactor(ui): share single KeyboardWidget instance across screens
Moves KeyboardWidget from a per-screen value member to a single instance
owned by UITask, passed to SettingsScreen, QuickMsgScreen, and BotScreen
as a pointer. Only one screen is ever active at a time, so the shared
state is safe. Saves ~1.5 KB of always-resident heap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:42:18 +02:00
Jakub
2d6d35192b refactor(BaseChatMesh): extract onDiscoveredAdvert to keep upstream signature
Reverts onDiscoveredContact to the upstream 4-param signature, adding a
separate virtual onDiscoveredAdvert(bool was_flood) with a default no-op
implementation. Only MyMesh overrides the new virtual; simple_secure_chat
and any future implementors need no changes on upstream merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:37:22 +02:00
Jakub
ceea1df196 chore: add graphify hooks, CLAUDE.md, and gitignore updates
- .claude/settings.json: PreToolUse hooks redirecting grep/file reads
  to graphify query when graph.json exists
- CLAUDE.md: graphify knowledge graph instructions for Claude Code sessions
- .gitignore: exclude graphify-out/ and .claude/settings.local.json
- .vscode/extensions.json: add comments header

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:16:38 +02:00
Jakub
cd4c8e3ce6 fix(DataStore): clamp notif_melody_dm/ch to valid range [0-3]
After PR #16 added None (slot=3) to melody options, only notif_melody_ad
had a bounds check. Add matching clamps for dm and ch to prevent stray
bytes from an older prefs file triggering buildMelodyFromPrefs with an
out-of-range slot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:13:16 +02:00
vanous
8e1352b24a Settings - Sound: Add Advert scope 2026-06-07 10:53:17 +02:00
vanous
7703b3ae36 Settings - Sound: Allow to set items to None 2026-06-07 09:13:02 +02:00
Jakub
484d8cb093 docs(features): refresh power-saving entry for v1.16 merge
Upstream's native NRF52 companion power-saving (PR #1238) and the preamble
16->32 bump for SF<9 both landed in the v1.16 merge. Update the battery/power
roadmap entry: the MCU now sleeps via board.sleep(0) when !hasPendingWork()
(no toggle — not sleeping only wastes power; it doesn't touch the radio), and
the preamble fix unblocks the CAD RX-windowing experiment on feat/power-saving.
Note the radio_set_*() globals were removed upstream (replace with radio_driver.*)
so that branch will need a rebase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v1.16
2026-06-06 17:41:49 +02:00
Jakub
6099b39740 fix(ui): bump splash MESHCORE_VERSION 1.15 -> 1.16
The splash shows the upstream base version from the hardcoded MESHCORE_VERSION
build flag (distinct from FIRMWARE_VERSION, which is our solo version). The
upstream merge bumped FIRMWARE_VERSION to v1.16-solo.0 but left this flag at
1.15. Update all three occurrences (wio + eink) to 1.16.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:27:48 +02:00
Jakub
f5b3213f80 Merge upstream/main (v1.16.0) into wio-unified
Merge 254 upstream commits. Highlights relevant to the Wio fork: native
NRF52 companion power-saving (sleep when !hasPendingWork), preamble 16->32
for SF<9, generic sensor-registration model, CMD_SEND_RAW_PACKET, isEink()
display abstraction, KEEP_DISPLAY_ON_USB, contacts-sync/transient fixes.

Conflicts resolved (11 files):
- buzzer.h/.cpp: keep NRF52 include guard + our begin()->startup(); fold in
  upstream doc comment.
- platformio (wio + eink): keep our slim env layout, add upstream kiss_modem
  env (+ debug_tool=stlink on eink ble).
- GxEPDDisplay.h: take upstream isEink() override.
- EnvironmentSensorManager.h: take upstream's wider #if guard.
- DataStore.cpp: take upstream saveContacts(filter) signature, keep our
  ::openWrite (member openWrite would shadow the global 2-arg overload).
- main.cpp: keep our watchdog init + add board.onBootComplete(); adopt
  upstream's `if(!hasPendingWork()) sleep` loop.
- MyMesh.h: version -> v1.16-solo.0, build date 6 Jun 2026.
- MyMesh.cpp: keep both CMD codes (SCREENSHOT 66 + RAW_PACKET 65), both field
  inits, both handlers, our screenshot fns + upstream saveContacts/save_filter,
  upstream hasPendingWork() + our MyMeshBot include.
- UITask.cpp: keep our solo splash/clock page/snprintf/buzzer init; merge
  auto-off (+ opt-in KEEP_DISPLAY_ON_USB); merge low-batt shutdown (our EMA +
  prefs threshold + upstream's !isExternalPowered() guard and eink-aware delay).

Post-merge drift fixes (upstream API/architecture changes, not conflicts):
- applyTxPower(): radio_set_tx_power() removed upstream -> radio_driver.setTxPower().
- Sensor refactor dropped the per-sensor *_initialized flags our
  getAvailableLPPTypes() relied on; removed that override and the SENSORS page
  now derives available LPP types from the populated sensors_lpp buffer.

README kept ours via .gitattributes merge=ours. Builds verified on all 5 Wio
envs (dual, eink dual, radio_ble, dual_dev, eink_dual_dev). Not yet
hardware-verified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:21:41 +02:00
Scott Powell
07a3ca9e05 Merge branch 'dev'
# Conflicts:
#	docs/faq.md
2026-06-06 21:12:43 +10:00
Scott Powell
8c0d5c5b24 * version 1.16.0 2026-06-06 21:09:38 +10:00
ripplebiz
74adda6316 Merge pull request #2702 from meshcore-dev/flood.max.advert
new CLI config: flood.max.advert
2026-06-06 21:05:22 +10:00
Scott Powell
8fc2da5c98 * default now 8, per the will of the peoples. 2026-06-06 21:00:58 +10:00
Liam Cottle
b6454d6251 Merge pull request #2703 from IoTThinks/Fixed-powersaving--in-cli_commands.md-2026-06
Change default power saving setting to 'off'
2026-06-06 16:09:27 +12:00
IoTThinks
6a9a84e8a5 Change default power saving setting to 'off' 2026-06-06 11:04:36 +07:00
Scott Powell
5f6821bb66 * new CLI config: flood.max.advert (default 16) 2026-06-06 13:09:24 +10:00
Scott Powell
397ac6144f * number allocations: Ripple range reserved 2026-06-06 12:45:35 +10:00
Jakub
cacc4e6206 fix(ui): keep hasConnection() BLE-specific; use isClientConnected() only for mute/wake
Self-review caught a regression I'd just introduced: feeding hasConnection()
from isClientConnected() (BLE *or* USB) broke the GPX-export collision warning
in TrailScreen, which relies on hasConnection() meaning "BLE app connected"
(BLE → USB dump is safe; otherwise the app may be on USB → warn).

Correct split:
- hasConnection() ← isBLEConnected() — BLE-specific consumers: BT status
  indicator, pairing PIN, GPX-export warning.
- isClientConnected() (BLE bonded OR open USB-CDC port) used directly only by
  the Auto buzzer mute and message-wake, which should react to either transport.

Builds clean on dual (OLED + e-ink) and pure-BLE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v1.15.1
2026-06-05 12:42:14 +02:00
Jakub
3b795f7abc feat(ui): detect USB-CDC connection for Auto mute (BLE or USB)
USB client presence IS detectable on nRF52 after all: (bool)Serial ==
tud_cdc_n_connected() (DTR — a host has the CDC port open). Add
isClientConnected() = BLE-bonded OR USB-CDC-open; DualSerialInterface
overrides it, base defaults to isConnected() (single-transport unchanged).

Wire it so each consumer gets the right signal:
- hasConnection() ← isClientConnected(): Auto buzzer mute + message-wake now
  trigger on BLE or an open USB port (PR #14's intent, done correctly), but
  not on charging-only (no host → DTR low).
- BT status indicator + pairing PIN stay on isBLEConnected() (BLE-specific).

Caveat: a plain serial monitor also asserts DTR, so it counts as connected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:36:49 +02:00
Jakub
4ea67ee950 fix(ui): hasConnection() should track BLE bond, not isConnected()
PR #14 (advert sound) changed setHasConnection() from isBLEConnected() to
isConnected() to also mute on USB — but DualSerialInterface::isConnected() is
hardcoded true (USB is always a send fallback) and ArduinoSerialInterface's is
too ("no way of knowing"), so USB-client presence is undetectable. The result
on every dual build: hasConnection() always true, which broke everything that
means "a companion app is connected":
- Auto buzzer mute → permanently muted (Auto behaved like Off)
- BT status indicator → always shown connected
- message-wake → display never woke for new messages

Revert to isBLEConnected() (the only detectable client signal). Mute-on-USB
isn't achievable; Buzzer = Off covers that case manually.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:30:55 +02:00
Jakub
a6ae9e80c8 fix(ble): show pairing PIN on dual (BLE+USB) builds
The Bluetooth-page PIN prompt was gated on hasConnection(), which is fed by
the serial interface's isConnected(). DualSerialInterface::isConnected()
always returns true (USB always "connected"), so waiting_for_pair was always
false and the PIN was never drawn — on every dual build, i.e. the published
OLED + e-ink firmware. Pure-BLE builds were unaffected (there isConnected()
reflects bond state).

Gate the PIN on actual BLE-bonded state instead: add
AbstractUITask::isBLEConnected() (forwards to BaseSerialInterface::
isBLEConnected(), which DualSerialInterface overrides with the real BLE state
and pure-BLE inherits as its bond-aware isConnected()). The PIN now shows on
the Bluetooth page while BLE is on and not yet bonded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:03:38 +02:00
Nick Le Mouton
dea5ed790f Add SECURITY.md 2026-06-05 21:25:25 +12:00