204 Commits

Author SHA1 Message Date
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
ripplebiz
54c111609a Merge pull request #2286 from IoTThinks/MCdev-PowerSaving-for-nrf52-companion-202604
Added Power Saving for NRF52 companions to have extra 30% battery life
2026-05-31 18:49:46 +10:00
AtlavoxDev
e5dab6b999 Rename bootComplete() to onBootComplete() for naming consistency
Matches the existing event-style lifecycle hooks on MainBoard
(onBeforeTransmit, onAfterTransmit) per @liamcottle's review feedback.
2026-05-25 09:50:28 -04:00
AtlavoxDev
39a69b86c3 Add MainBoard::bootComplete() hook for boot-indicator LED feedback
Framework for upcoming variant-specific PRs that add LED feedback during boot. The hook gives users visual cues that the device is busy and
shouldn't be interacted with until startup completes.
2026-05-25 09:04:47 -04:00
Kevin Le
6b1099161c Added Power Saving for NRF52 companions 2026-05-22 10:58:17 +07: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
5bc250888f fix: apply saved display brightness before UI task starts
Loading... screen was always shown at full brightness because prefs
are not yet loaded at that point. Apply setBrightness() in the first
common code path after the_mesh.begin() loads prefs, so at least the
tail of the loading screen and the entire splash screen respect the
saved brightness level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 23:15:29 +02:00
Jakub
af2aca151f Add hardware watchdog and QuickMsgScreen
Watchdog: nRF52840 hardware WDT with 30s timeout, runs during sleep.
Resets device if main loop stalls for >30s. Pets in every loop()
iteration so normal operation never triggers it.

QuickMsgScreen: new UI screen accessible from home screen pages.
Two-phase UI: contact picker (shows all contacts with hop count),
then predefined message picker (location, I'm OK, need help, on my
way, ETA 10min, ETA 30min). Location message uses live GPS fix if
available. Sends via the_mesh.sendMessage() and shows sent/error alert.

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
Jakub
4d46abb2c1 feat(wio-tracker-l1): energy optimizations
- CPU sleep: board.sleep(0) in main loop puts NRF52 into WFE/sd_app_evt_wait
  between iterations; wakes on any interrupt (radio, BLE, timer). Largest
  power saving of the three changes.

- VBAT_ENABLE gating: voltage divider now powered only during ADC read
  (HIGH for 10ms, then LOW). Previously stayed HIGH continuously.
  Fixed in both variant.cpp (init) and WioTrackerL1Board::getBattMilliVolts().

- LED off with display: PIN_LED is cleared when auto-off triggers and
  restored (handed back to userLedHandler) when display wakes. Avoids
  idle LED current draw during screen-off periods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:46 +02:00
Rococo88
a0cc3bab4b Refactor WiFi auto-reconnect to use non-blocking polling 2026-05-07 12:24:06 +02:00
Scott Powell
0a8a0a4904 * Refactor: removed duplicated radio_rng_seed(), radio_set_params(), radio_set_tx_power() 2026-05-01 14:47:07 +10: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
taco
c7eea3915d fix: remove esp_wifi.h from esp32board.h
saves ~500 bytes of dram and allows Tbeam to compile again
2026-01-30 15:07:40 +11:00
Scott Powell
3c27132914 * T1000e BLE - default node name is now the MAC address 2026-01-23 15:53:58 +11:00
Scott Powell
3d9378d91e * Fix for VolatileRTCClock wrapping around to initial synced time every 49 days 2025-10-30 16:45:50 +11:00
taco
accd1e0a97 nrf52 targets: increase limits for contacts and channels 2025-09-06 14:15:40 +10:00
taco
2b24c575c7 support dual filsystems on nrf52
store identity and prefs in UserData and contacts, channels and adv_blobs in ExtraData
2025-09-06 14:15:40 +10:00
taco
bdfe9ad27b switch to using QSPI bus for external flash 2025-09-06 14:15:40 +10:00
taco
c5180d4588 initial commit: CustomLFS 2025-09-06 14:15:40 +10:00
Scott Powell
acde9921b5 * Refactor of UITask, moved to /ui-new 2025-08-16 20:04:54 +10:00
Scott Powell
4b95c981bb * UI revamp for companion radios 2025-08-08 20:01:31 +10:00
Scott Powell
1295c4633b * companion: minor refactor of who should invoke UITask::loop() 2025-06-21 20:48:28 +10:00
Florent de Lamotte
588a986976 t1000e: gps toggle not using board class 2025-06-19 17:26:58 +02:00
Scott Powell
9c833486bf * DataStore, advert blob record format change 2025-06-06 21:35:54 +10:00
Scott Powell
6e0b505a2a * companion: refactor of all filesystem access to new DataStore module 2025-06-06 15:30:35 +10:00
Scott Powell
5729d66a9e * companion: some further refactors after the MyMesh refactor 2025-06-02 15:25:55 +10:00
Florent
31cbf9ed0e gps : sync time on fix 2025-06-01 20:02:35 -07:00
hank
f58a34f5f4 Refactored MyMesh, advert on doublepress
Pulled the class out of main.cpp, made a header to go along with it, externed globals in headers to make them accessible to button code. Added button code to send an advert on double press. Refactored ini files to prevent linker errors.
2025-05-31 19:11:28 -07:00
Scott Powell
fec064c1a2 * companion: interference threshold default (14) 2025-05-27 22:48:28 +10:00
Scott Powell
b3fc6bedf9 * companion: saveContacts() now deferred for 5 secs (lazy writes) 2025-05-27 18:45:06 +10:00
Scott Powell
0e90b73110 * companion: PUSH_CODE_LOGIN_SUCCESS frame, now includes server clock timestamp 2025-05-26 19:52:32 +10:00
Scott Powell
0bad7ee106 * ver bump to 1.6.2 2025-05-24 16:19:19 +10:00
Scott Powell
02b6f4a285 * Companion: telemetry_mode_env added to prefs 2025-05-22 15:26:30 +10:00
liamcottle
d9c1cffac2 allow setting default node name for companion via build flag 2025-05-20 20:51:46 +12:00
ripplebiz
ecfeb2ff63 Merge pull request #314 from seagull9000/RTTTL-tweaks1
RTTTL on message types
2025-05-20 17:44:19 +10:00
seagull9000
7507f889a5 fix location and naming of enum 2025-05-20 19:33:21 +12:00
seagull9000
f82844f43f RTTTL on message types 2025-05-20 19:09:49 +12:00
Scott Powell
56b84408e4 * workaround for nRF + LittleFS glitch with seek/truncate 2025-05-20 16:29:09 +10:00
Scott Powell
7e90d386e2 * refactored buzzer concept to UITask
* moved buzzer.h/cpp to helpers/ui
2025-05-20 11:52:55 +10:00
seagull9000
be88bea42d initial support for generic RTTTL notifier 2025-05-20 13:26:40 +12:00
Scott Powell
a73eb9823d * big refactor of the 'display' object. Now defined in variants/*/target modules. 2025-05-19 14:16:55 +10:00
ripplebiz
885cfe9667 Merge pull request #294 from 446564/SH1106-display
Sh1106 display
2025-05-17 23:32:14 +10:00
Scott Powell
65d398fcbc * ver bump to v1.6.1 2025-05-17 20:04:55 +10:00
Rob Loranger
25b534a29d add support for SH1106 OLED display 2025-05-16 08:45:55 -07:00
Florent
35e1901d0e wio-e5 : initial port 2025-05-11 09:28:15 +02:00
Scott Powell
d072e7b575 * ver bump to v1.6.0 2025-05-09 18:12:42 +10:00
Scott Powell
810fc8b8f0 * Heltec tracker: new 'periph_power' shared pin (between Display & GPS) 2025-05-08 15:50:53 +10:00
ripplebiz
0e208f01cd Merge pull request #258 from seagull9000/Heltec-Wireless-Tracker-support
Heltec Wireless Tracker support
2025-05-08 12:29:02 +10:00
seagull9000
e076e797e6 Heltec Wireless Tracker support 2025-05-07 21:40:27 +12:00