Commit Graph

55 Commits

Author SHA1 Message Date
Jakub
7d9d5f847d feat(screenshot): extend e-ink screenshot support via GxEPD2 patch
- Add lib/GxEPD2-patch/src/GxEPD2_BW.h: local patched copy of GxEPD2_BW.h
  that exposes getBuffer()/getBufferSize() under ENABLE_SCREENSHOT guard.
  Include guard (_GxEPD2_BW_H_) prevents double-inclusion of the installed
  library version.

- GxEPDDisplay.h: use patched header via relative include when
  ENABLE_SCREENSHOT so the patch takes precedence over the installed lib
  (PlatformIO adds library paths before -I build_flags).

- DisplayDriver.h: add virtual getBuffer()/getBufferSize()/getDisplayType()
  defaults (nullptr/0/0) under ENABLE_SCREENSHOT.

- SH1106Display.h / SSD1306Display.h / GxEPDDisplay.h: add concrete overrides;
  getDisplayType() returns 0 (OLED) or 1 (e-ink).

- MyMesh.cpp/h: replace fragile C-cast with virtual dispatch in
  handleScreenshotRequest(); extend 5-byte header to 6 bytes by appending
  display_type so the host tool can decode the correct pixel layout.

- tools/screenshot.py: parse 6-byte header; add eink_buffer_to_image()
  that decodes the row-major MSB-first GxEPD2 buffer with DISPLAY_ROTATION=1
  (phys_x = 127-ly, phys_y = lx); dispatch on display_type.

- variants/wio-tracker-l1-eink/platformio.ini: add
  [env:WioTrackerL1Eink_companion_dual_dev] with ENABLE_SCREENSHOT.
- variants/wio-tracker-l1/platformio.ini: unchanged (OLED env already exists).

Builds verified: WioTrackerL1Eink_companion_dual_dev SUCCESS,
                 WioTrackerL1Eink_companion_radio_ble SUCCESS (unaffected).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 01:03:47 +02:00
Jakub
34fcab6bd5 feat(ui): show MeshCore version large and plus version in splash bar
Add MESHCORE_VERSION build flag ("1.15") to companion base configs.
Splash screen now shows MESHCORE_VERSION in the large text and the
plus firmware version (stripped of commit hash) in the Plus bar,
e.g. "1.15" large + "Plus v1.11 for Wio" below.

Change CI tag pattern to v* and simplify version extraction so tag
v1.11 maps directly to FIRMWARE_VERSION=v1.11.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 00:35:07 +02:00
Jakub
137b0234d5 ci: rename dual envs and fix tag-triggered builds for OLED and e-ink
Rename WioTrackerL1_companion_radio_dual_settings → WioTrackerL1_companion_dual
and WioTrackerL1Eink_companion_radio_dual → WioTrackerL1Eink_companion_dual.

Fix CI workflow: remove hardcoded branch refs so both build jobs check out
the tagged commit; add version extraction to each build job (previously
GIT_TAG_VERSION was only set in the release job, leaving FIRMWARE_VERSION
empty during builds); update build commands to use new env names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 00:13:34 +02:00
Jakub
72c07df8b3 fix: code review corrections in DualSerialInterface and NearbyScreen
- DualSerialInterface: guard writeFrame/isWriteBusy/isBLEConnected with
  _ble_enabled to avoid BLE-after-disable race
- NearbyScreen: initialize all fields in constructor; promote D_* layout
  constants to class scope; clamp _dscroll on result count change;
  replace hardcoded 2 with D_VISIBLE in scroll logic; allow re-scan
  from detail view via KEY_CONTEXT_MENU/KEY_ENTER
- variant.cpp: fix inconsistent indentation in initVariant()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:08:28 +02:00
Jakub
5828600d48 feat: dual BLE+USB serial — single firmware replaces separate BLE/USB builds
- DualSerialInterface: enable()/disable() control BLE only, USB always on;
  USB state machine not read while BLE connected to avoid partial-frame
  corruption; reset USB on BLE disconnect for clean reconnect
- Fix -UBLE_DEBUG_LOGGING (no space) to avoid PlatformIO SCons parse error
- build.sh: drop separate USB/BLE builds, dual_settings only
- wio-tracker-l1-eink: enable DUAL_SERIAL in companion_radio_ble build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:16:07 +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
ef24bb8554 Enable joystick up/down in all WioTrackerL1 companion builds
Moved UI_HAS_JOYSTICK_UPDOWN=1 from _settings-only variants to the
WioTrackerL1CompanionBLE and WioTrackerL1CompanionUSB base configs.
The hardware always had the up/down buttons; the flag was only in
_settings as a temporary testing boundary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
d5a2e1170a Enable sensors page for Wio Tracker companion builds
UI_SENSORS_PAGE=1 activates the existing sensor display screen in
HomeScreen — shows temperature, pressure, humidity, voltage and other
LPP-formatted sensor data from connected I2C sensors (BME280, etc.).
BME280 support is already included via sensor_base build flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
81c69f89c6 Splash screen: show unofficial build marker for Plus builds
Add FIRMWARE_PLUS_BUILD compile flag to both companion sections in
platformio.ini. When set, SplashScreen shows "+ unofficial build" in
yellow below the build date. Avoids runtime string parsing — the
existing version stripping logic (cuts at first dash) is unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
3f7293c657 Fix FIRMWARE_VERSION: append -Plus in build.sh, not platformio.ini
build.sh sets FIRMWARE_VERSION via PLATFORMIO_BUILD_FLAGS — hardcoding
it in platformio.ini caused a macro redefinition conflict. Instead,
build_wio_tracker_l1_firmwares() now appends "-Plus" to the env var
before calling build_firmware(), so the final version string becomes
e.g. v1.15.0-Plus-abcdef.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:47 +02:00
Jakub
87aafce88f Set custom FIRMWARE_VERSION for Wio Tracker companion builds
Override the upstream FIRMWARE_VERSION define via build_flags so all
companion radio builds (USB and BLE) show "v1.15.0-Plus" on the splash
screen. The #ifndef guard in MyMesh.h makes this override automatic.

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
Jakub
c3846ba9f5 feat(wio-tracker-l1): add settings screen and companion radio improvements
Settings screen (UI_HAS_JOYSTICK_UPDOWN build variant):
- Display brightness (5 levels, contrast curve tuned for SH1106 non-linearity)
- Buzzer on/off (respected at startup, no more forced unmute)
- TX power (2–22 dBm)
- Auto-off delay (5s / 15s / 30s / 60s / never)
- GPS update interval (off / 30s / 1min / 5min / 15min / 30min)
- Timezone offset (UTC-12..+14) for clock screen
- Low battery auto-shutdown threshold (off / 3.0–3.5V, default 3.4V)
- Battery display mode (icon / % / voltage)

Battery:
- EMA filter (alpha=0.2) on ADC readings to smooth voltage spikes from uneven load
- Battery % calculated using low_batt_mv as 0% anchor
- Mute icon repositions dynamically based on battery display width

Clock screen on HomeScreen showing time/date with timezone support.

Build:
- _settings variants added for USB and BLE companion radio builds
- Automatic UF2 generation on every build via create-uf2.py post-script
- UI_HAS_JOYSTICK_UPDOWN flag guards joystick_up/down to avoid breaking other boards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:09:46 +02:00
João Brázio
75895895f0 Add USE_SX1262 flag to multiple platformio.ini configurations 2026-03-16 09:34:12 +00:00
João Brázio
9a95e25ef2 Remove unused RX boosted gain mode functions and related preprocessor directives across multiple variants 2026-03-05 18:38:57 +00:00
João Brázio
64a16d7ad2 Merge branch 'dev' into 2026/remote-lna 2026-02-27 10:32:14 +00:00
dylan
f720338c03 Fix WioTrackerL1 BLE companion: route sensors to Grove I2C bus (Wire1)
Sensors connected via the Grove I2C connector (D18/D17) were not detected
because the firmware scanned the OLED I2C bus (Wire, D14/D15) by default.
Adding ENV_PIN_SDA/SCL flags directs EnvironmentSensorManager to use Wire1,
matching the physical Grove connector pinout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:12:48 +08:00
João Brázio
71136671bd Implement remote lna toggle cli cmd 2026-02-10 15:02:23 +00:00
Wessel Nieboer
d0720c63c2 Allow negative tx power
Like SX1262 allows -9 dBm lowest, some allow lower but that probably
isn't useful
2026-02-06 02:24:51 +01:00
fdlamotte
3f3978c7d3 Merge branch 'dev' into nrf-dcdc 2026-01-27 08:42:58 -04:00
Scott Powell
f46f0d0ed1 * WIO tracker l1: BLE companion. default node name now MAC address 2026-01-24 22:08:05 +11:00
Frieder Schrempf
4f46ec75dd Remove NRF52BoardOTA class and integrate it into NRF52Board
As all NRF52 boards now have OTA support, let's remove the subclass
and integrate it into the base class.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2026-01-08 22:46:20 +01:00
Frieder Schrempf
b024b9e1a1 Deduplicate NRF52 startOTAUpdate()
The startOTAUpdate() is the same for all NRF52 boards. Use a common
implementation for all boards that currently have a specific
implementation.

The following boards currently have an empty startOTAUpdate() for
whatever reasons and therefore are not inheriting NRF52BoardOTA to
keep the same state: Nano G2 Ultra, Seeed SenseCAP T1000-E,
Wio WM1110.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:30:50 +01:00
Frieder Schrempf
e3bb225efb Deduplicate DC/DC regulator enable for NRF52 boards
Some NRF52 boards are able to use the internal power-efficient DC/DC
regulator. Add a new class that can be inherited by board classes to
enable this feature and reduce the power consumption.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:29:14 +01:00
Frieder Schrempf
93d1560d14 Use common NRF52 begin() and deduplicate() startup reason init
Use a common begin() method that can be called from derived classes
to contain the shared initialization code.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:26:57 +01:00
Frieder Schrempf
87b0e432bb Deduplicate reboot() for NRF52 boards
The reboot() method is the same for all NRF52 boards. Use a shared
implementation.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
2025-12-17 10:25:16 +01:00
Kevin Le
4504ad4daf Added default temperature from ESP32 MCU and NRF52 MCU
Added NRF52Board.h and NRF52Board.cpp
Modified NRF52 variants to extend from NRF52Board to share common feature
2025-12-12 19:01:15 +07:00
Florent de Lamotte
6db57677f9 tracker_l1: enable dc/dc converter 2025-12-04 12:01:00 +01:00
Florent
7d62a27836 uitask: bring back buzzer toggle on tracker l1 2025-10-18 13:40:01 +02:00
Scott Powell
cd920693ec * UITask: new UI_HAS_JOYSTICK
* MomentaryButton: new constructor 'multiclick' param
* WIoTrackerL1: now just use joystick, joystick press for KEY_ENTER, no multi-click for snappier UI
2025-10-16 17:33:22 +11:00
liamcottle
0307b6119e increase MAX_NEIGHBOURS from 8 to 50 2025-09-28 16:11:58 +13:00
Liam Cottle
2992062bbe Merge pull request #770 from Meshcore-Portugal/jbrazio/2025_44aa3add
Normalize repeater target names
2025-09-27 23:15:23 +12:00
taco
a3e6b79c2f Revert addition of ENV_PIN_SDA 2025-09-25 20:08:18 +10:00
Florent
611d61b6c6 tracker_l1: fix bme226 init in ESM to include all sensors 2025-09-22 19:10:01 +02:00
Florent
0cb34740d2 tracker-l1: correct bad definition for PIN_GPS_EN 2025-09-22 12:06:05 +02:00
Florent
f9543bb7bb tracker_l1: support for EnvironmentSensorManager 2025-09-21 22:14:22 +02:00
Florent
59ea6cdb89 wio-l1-eink initial support 2025-09-20 21:45:13 +02:00
João Brázio
510472bfa0 Normalize repeater target names 2025-09-10 23:56:07 +01:00
taco
f92bd0db9e fix inconsistencies across nrf companion roles 2025-09-09 17:00:29 +10:00
taco
e8314c9c8c new ldscript for extrafs nrf companion envs 2025-09-09 16:55:46 +10:00
taco
accd1e0a97 nrf52 targets: increase limits for contacts and channels 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
1f20722f51 fix: wio tracker L1: tidy platformio.ini 2025-09-04 19:59:33 +10:00
taco
cb8ca91d27 WioTrackerL1: add joystick left and right for new UI 2025-08-17 19:01:28 +10:00
taco
8f1ccb65ae WioTrackerL1: add poweroff support 2025-08-17 18:10:58 +10:00
Scott Powell
76a53bf84d * Wio-e5-mini: ui-orig
* WioTrackerL1: ui-new
2025-08-17 17:23:28 +10:00
Scott Powell
e14b022a7c * original UITask now in /ui-orig folder 2025-08-16 21:09:35 +10:00
taco
86671c0ff8 Support NewUI on WioTrackerL1 2025-08-16 09:29:48 +10:00
taco
a49b5aaba7 fix: wrong QSPI pins for wio tracker l1 2025-08-02 04:07:07 +10:00