977 Commits

Author SHA1 Message Date
pelgraine 7005bd065e Merge pull request #22 from nabbi/fix/full-build-failures-on-main
Fix remaining build failures found by a full pio run across all envs
2026-06-24 21:43:29 +10:00
Nic Boet abc2457123 Fix remaining build failures found by a full pio run across all envs
A complete `pio run` (all 16 environments) on Linux turned up 6
failures beyond the case-sensitive-include fix already on this
branch:

1. meck_remote_repeater, meck_wifi_repeater, meck_wifi_repeater_t5s3
   compile GxEPDDisplay.cpp / FastEPDDisplay.cpp, which #include
   MeckFonts.h whenever HAS_MECK_FONTS is defined. HAS_MECK_FONTS is
   set at the shared variant-base level (so all envs in that variant
   inherit it), but the `-I examples/companion_radio/ui-new` include
   path needed to find MeckFonts.h was only added to the
   companion-radio envs, not the repeater envs in the same file.
   Added the missing -I flag to the three repeater env sections.

2. meck_wifi_repeater_heltec_v3/v4/v4_headless failed with "missing
   SConscript file 'merge-bin.py'". esp32_base's extra_scripts still
   pointed at merge-bin.py, which was deleted in 451f4b01 ("remove
   redundant merge script"). Other variants override extra_scripts
   themselves so they never hit the stale base default; the Heltec
   variants don't, so they inherited the broken reference. Pointed
   esp32_base at merge_firmware.py instead, matching every variant
   that already sets this explicitly.

3. After fix #1, meck_wifi_repeater_t5s3 still failed: wifimqtt.cpp
   had a hardcoded `extern AutoDiscoverRTCClock rtc_clock;`, but the
   T5S3 variant declares its global rtc_clock as PCF85063Clock (a
   different concrete RTCClock subclass) in target.h. The local
   extern was redundant anyway, since target.h is already included
   at the top of this file and declares the correctly-typed global
   for whichever variant is being built. Removed the stale extern so
   the call resolves through the existing declaration.

Verified: `pio run` now succeeds for all 16 environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 16:11:36 -05:00
Nic Boet 7df116b4f1 Fix case-sensitive filesystem build failures (Linux) for ESP32 LilyGo variants
The repo has apparently only ever been built on case-insensitive
filesystems (macOS/Windows): every #include in the codebase uses
intended PascalCase/CamelCase header names (e.g. "SettingsScreen.h",
"WiFiMQTT.h"), but 28 of the actual files on disk were saved with
inconsistent casing (e.g. "Settingsscreen.h", "wifimqtt.h"). On a
case-sensitive filesystem (Linux) this is a hard compile failure, not
a cosmetic mismatch -- confirmed by running `pio run -e meck_audio_ble`
on Gentoo Linux, which failed immediately on "target.h: No such file
or directory" and a cascade of similar errors as each fix exposed the
next one.

Root causes, two flavors of the same underlying bug:

1. Header filename casing (29 files renamed via `git mv` to preserve
   history): examples/companion_radio/ui-new/*, examples/simple_repeater/*,
   and two variant-local headers (PCF85063Clock.h, TCA8418Keyboard.h x2).
   Verified safe before renaming: every file has exactly one consistent
   intended casing across all the places that #include it (checked via
   a repo-wide scan comparing every #include against on-disk filenames,
   zero conflicts found), so each rename is a pure no-op for behavior.

2. PlatformIO config paths using the wrong case for variant directories
   that are actually lowercase on disk (variants/lilygo_tdeck_pro,
   variants/lilygo_t5s3_epaper_pro):
   - `-I variants/LilyGo_TDeck_Pro` / `-I variants/LilyGo_T5S3_EPaper_Pro`
     in build_flags (3 occurrences, including lilygo_tdeck_max's
     reference to TDeck Pro's shared headers) -- broke header resolution
     for target.h and friends.
   - `+<../variants/LilyGo_TDeck_Pro>` / `+<../variants/LilyGo_T5S3_EPaper_Pro>`
     in build_src_filter (2 occurrences) -- silently excluded the board-init
     .cpp files (TDeckBoard.cpp etc.) from compilation entirely, which
     didn't fail until the *link* stage ("undefined reference to
     radio_init()", `TDeckBoard::begin()`, etc.) since PlatformIO's glob
     just matched nothing rather than erroring.

Verified fix: `pio run -e meck_audio_ble` now compiles, links, and
produces a firmware image cleanly (RAM 53.1%, Flash 49.6%).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 14:44:46 -05:00
pelgraine 8133ab5856 Max: update build date and firmware version. Add keyboard LED brightness setting (MAX); fix standalone unread counter
Keyboard LED brightness (T-Deck Pro MAX):
Adds a "Keyboard LED" row to Settings (MAX only), below Backlight
Brightness and mirroring it: 5-100% in 5% steps, default 50%. The
both-shifts keyboard backlight toggle previously used a hardcoded PWM
level of 8 (~3%), too dim for some users; it now reads the stored
percentage and maps it to PWM, taking effect on the next toggle.
- NodePrefs.h: new kb_backlight_pct field (5..100, default 50)
- Settingsscreen.h: ROW_KB_BACKLIGHT row plus label/edit handling
- DataStore.cpp: load/save/clamp, appended so existing prefs files stay
  compatible (fall back to 50%)
- main.cpp: toggle uses kb_backlight_pct (percent -> PWM) instead of 8

Standalone unread counter fix:
On standalone builds the home-page MSG count and channel-picker unread
badges never updated, although messages arrived and displayed normally.
ArduinoSerialInterface::isConnected() is hardcoded to return true (a plain
UART has no connection state), so the periodic
setHasConnection(_serial->isConnected()) in MyMesh left hasConnection()
permanently true -- making UITask mark every received message read on
arrival. The same stuck flag also suppressed the DM counter and the
new-message screen wake. Guard the call so only builds with a real
companion (BLE / WiFi / wired SERIAL_RX) derive connection state from the
interface; companion-less builds report not-connected. The core
ArduinoSerialInterface is unchanged, preserving wired-companion behaviour.
- MyMesh.cpp: guard setHasConnection() for companion-less builds
2026-06-22 07:01:18 +10:00
pelgraine 7a61f3efe2 fix regression on the pro and max where q was causing early exit on wifi password and notes screen. update firmware version and build date. 2026-06-17 06:33:28 +10:00
pelgraine c72253eb7b update firmware version and build date 2026-06-10 23:16:32 +10:00
pelgraine 40571e398e fix battery size for max in variant.h and comments 2026-06-10 23:11:25 +10:00
pelgraine 62628ec751 fix Max battery size 2026-06-10 22:57:46 +10:00
pelgraine 51ef01f3a6 Max - Silent alarm option added 2026-06-07 21:33:25 +10:00
pelgraine 353048aab3 So the power investigation wraps up like this:
GPS — fixed (the "off" toggle and boot path now actually cut the XL9555 rail). Kept in main.cpp + UITask.cpp.
BLE controller — the ~13 mA between the BLE build (BLE off) and standalone is the controller staying initialised; the boot-gate in SerialBLEInterface.cpp/.h defers BLEDevice::init() until first enable, reclaiming it. That's the meaningful idle win.
CPU, gyro rail, ES8311, frontlight — all measured and ruled out. The residual ~12 mA Max-vs-Pro is distributed always-on hardware with no software switch — hardware overhead, not a bug.

Defer ESP32 BLE controller bring-up to first user enable
MyMesh::startInterface() called serial.enable() unconditionally at boot. On the ESP32 BLE build this ran the deferred-init SerialBLEInterface's _realBegin()/BLEDevice::init() and powered the BT controller before main.cpp's boot-time disable(), which only stops advertising and cannot power the controller back down -- so the controller stayed up while "off", drawing ~13 mA at idle. Guard the enable() so ESP32 BLE builds skip it at boot; the controller now comes up lazily on the first enable() when the user turns Bluetooth on from the Bluetooth page. WiFi builds are unaffected and still enable at boot.
2026-06-07 00:09:56 +10:00
pelgraine 8ac9aeed28 Max - fixed usb C wake auto power on after shutdown is used, and minor ui fix to home screen when BLE is on but not connected 2026-06-06 21:23:44 +10:00
pelgraine 378db7932c udpate firmware version 2026-06-06 21:09:48 +10:00
pelgraine fb4d8273a9 Max - New buzzer(vibrate) option in custom channel notification preferences - silent buzz notification. 2026-06-04 23:54:07 +10:00
pelgraine b6e3c7e0a5 implemented $PCAS04,7 - Multi-constellation mode (GPS, Galileo, BeiDou, and QZSS)
The default LilyGo/MeshOS firmware uses GPS-only ($PCAS04,1) & $PMTK869,1,1 - EASY predicted ephemeris
2026-06-04 23:25:03 +10:00
pelgraine f6bce4f5ee Max - fix missing -D HAS_4G_MODEM=1 flags. Revised settingscreen so it uses a scroll bar instead of the heading total counter. New brightness scale in settings to control heart button brightness toggle strength, which also persists after reboot. 2026-06-04 22:29:14 +10:00
pelgraine 1613b81004 Max - touch support working!! 2026-06-04 21:24:14 +10:00
pelgraine 4db03adb3a Max - 4G working! 2026-06-04 20:37:53 +10:00
pelgraine 70e150e9c3 What changed and what to expect:
The fix (six sites: 948, 978, 1519, 1651, 1719, 1906): the indexer now chooses pixel-vs-char wrapping from _display->getFontStyle(), the same basis the renderer (1200), the layout sizing (1336), and the cache key already use. With all four agreeing, the indexer's recorded page boundary lands on the exact byte where the renderer's height-based stop lands — no more swallowed run between pages.
Version bump (INDEX_VERSION 13 → 14): your existing .idx caches were built by the old indexer and would otherwise be reloaded as-is (same font key), so the fix would appear to do nothing. Bumping the version makes the loader discard every v13 cache and rebuild it.

All six edits are in and braces balance (267/267). Here's what changed in Audiobookplayerscreen.h:

PNGdec include (47) and cover size 40→30 (67) — 30 virtual units ≈ 55px.
PNG draw callback coverDrawCallbackPNG (147) — nearest-neighbour downscales the 256px source line-by-line and dithers to 1-bit using the same Bayer matrix as the JPEG path. The decoder is heap-allocated per-decode (new PNG()), mirroring how the JPEG path uses new JPEGDEC(), so there's no permanent BSS cost.
decodeFolderCoverPNG() (419) + tryLoadFolderCover() (505) — reads cover.png from _currentPath into PSRAM and decodes it.
Hooks in both openBook (1099) and advanceTrack (1198), so the cover loads on open and persists as tracks auto-advance within an album. It only loads when there's no embedded cover, so M4B/ID3 embedded art still wins; music (no embedded art) gets the folder PNG.
Layout (1531, 1556) — cover now draws below the artist line, above the status/Paused-Vol line, exactly where you wanted it.
2026-06-03 19:24:19 +10:00
pelgraine 0d2f27e615 Here's what each does:
target.h — declares meck_audio_route_amp() and meck_audio_codec_init() in the bridge (54-55), guarded by HAS_ES8311_AUDIO, ready for the alarm/voice paths to reuse later.
target.cpp — includes ES8311.h (6) and defines both helpers where board and the codec driver are visible: route+amp (100-102), and the once-only es8311_init_44100_16bit() (108-110).
Audiobookplayerscreen.h — forward-declares both (54-55); ensureI2SInit() now does route+amp and the 5-arg setPinout with MCLK on MAX (268-270); and meck_audio_codec_init() runs right after connecttoFS (1142). The Pro path is untouched.
2026-06-03 18:31:07 +10:00
pelgraine 8c6b3b1029 redid commit e0e011e and also added Vendor ESP32-audioI2S into lib/ with ES8311 APLL + set-once I2S edits 2026-06-03 17:59:38 +10:00
pelgraine e91980674c re-apply e-ink offset 2026-06-03 17:41:16 +10:00
pelgraine 0a119eac4f initial audio playback working success - fixed pin 41 guard dac issue for pro variant by guarding with has es8311 audio 2026-06-03 15:10:28 +10:00
pelgraine d66f202081 decoupled the Max from the Pro variant; fixed e-ink offset in the max 2026-06-03 01:52:48 +10:00
pelgraine fc322070ae max - dropped keyboard bl brightness to 8, screen bl brightness to 1 for maximum dark room friendliness. Fix e-ink x offset 2026-06-03 00:16:18 +10:00
pelgraine ef13cfac7e max - screen backlight dropped to 5, keyboard backlight brightness dropped by half to 128. Will need to revise message flash in settingscreen.h to use buzze instead of keyboard backlight led 2026-06-02 22:54:57 +10:00
pelgraine 4c4efd4cf3 max - alt+b screen front light set to brightness 10 sans diagnostics 2026-06-02 22:49:00 +10:00
pelgraine bc8f36fd0f max - screem brightness set to 10, alt+b working with diagnostics still present currently 2026-06-02 22:44:44 +10:00
pelgraine 6f95884d47 STUPID BACKLIGHT IS WORKING FINALLY AAAH 2026-06-02 22:15:15 +10:00
pelgraine dcbcf1bc1e max - fix max contacts, channels, and firmware version in plaftormio 2026-06-02 18:28:49 +10:00
pelgraine 12dc40db33 max - keyboard backlight works - press both shift keys to turn on and off 2026-06-02 18:16:25 +10:00
pelgraine 590655016a initial max updates - not yet working 2026-06-02 18:03:09 +10:00
pelgraine 4cc15f7ab0 Delete t-echo card and t-echo lite folders as no longer working on those; support json import & export config; new method for creating private and hashtag channels 2026-05-23 04:04:45 +10:00
pelgraine 47a7f2f9d1 add 100 and :D emoji; update firmware version to 1.11;; config json import and export on device to SD now supported 2026-05-22 10:08:24 +10:00
pelgraine cd2c8ae5b3 tdpro - updated max group channels to 40 for all builds 2026-05-15 07:01:42 +10:00
pelgraine 18b9ab6c4d update firmware version and build date 2026-05-12 04:24:30 +10:00
pelgraine 3596ad558d Fix missing data store persistence updates - font style, scope name and corresponding scope key - now sticks across reboots. Revised tdpro home ui offset to original settings. Fixed tpro hibernate icon positioning. 2026-05-07 17:57:19 +10:00
pelgraine 6de664ea37 Dm message persistence; fixed home ui offset alignment; trace route screen addition 2026-05-07 17:23:04 +10:00
pelgraine 708b96e0e8 T-Echo Card audio support initial stages - codec2 attempts 2026-05-07 05:47:18 +10:00
pelgraine 20310018d3 updating t-echo card folder 2026-05-05 12:41:24 +10:00
pelgraine 468a5ad324 update tdpro firmware versions 2026-05-05 11:39:38 +10:00
pelgraine 95c992d966 Hibernate now enters true deep sleep on T-Deck Pro.
UITask shutdown (already occurs/unchanged):
1. BLE disabled (_serial->disable()).
2. WiFi disconnected + WIFI_OFF.
3. 4G modem shutdown().
4. GPS power cut (PIN_GPS_EN LOW).
5. LoRa radio powerOff() (standby mode).
6. Display turnOff().

TDeckBoard::powerOff() (new):
7. btStop() -- BLE controller stop.
8. Peripheral power OFF (PIN_PERF_POWERON LOW) -- keyboard, BQ27220, sensors.
9. LoRa module power OFF (P_LORA_EN LOW) -- cuts power entirely.
10. Hold LoRa NSS high (prevents SX1262 drawing current from floating CS).
11. esp_deep_sleep_start() -- CPU halts, ~10-40uA.

Wake (reset button or USB power-on):
12. ESP32-S3 cold boots.
13. TDeckBoard::begin() runs: peripheral power ON, I2C init, LoRa power ON, NSS hold released.
14. App starts fresh -- prefs/contacts/messages load from flash.

No LoRa wake during hibernate -- the device is truly off. Only a hardware
reset (reset button) or USB power-on wakes the device.
2026-05-02 10:19:37 +10:00
pelgraine 9c4c374db8 added has meck fonts build flag to draft max platformio; new fast scroll implementation update with next page scroll function with shift+w/s; updated home page hint text to make it clearer you can press enter to toggle on/off/send adverts etc 2026-05-02 10:07:49 +10:00
pelgraine ca16af54cc renamed WIP variant project files to reflect WIP status appropriately 2026-05-02 09:29:26 +10:00
pelgraine f51d8be290 Fix to beer emoji mug handle; font changes that support diacritics meaning updates to display drivers, fonts, highlighting, sprites; build flag added to both tdpro and t5s3 pro to enable diacritics rendering changes 2026-05-02 09:26:30 +10:00
pelgraine 715202849c initial successful t-echo card build 2026-04-30 18:13:01 +10:00
pelgraine 46ff5229e1 attempted to fix emojisprites override; added beer stein sprite; renamed t-echo card folder 2026-04-30 16:49:25 +10:00
pelgraine b5b11a2036 T-Echo Card: apply hardware findings from Meshtastic PR #10267.
Incorporates hardware-specific learnings from caveman99's Meshtastic
T-Echo Card support PR (meshtastic/firmware#10267), cross-referenced
against LilyGo's official t_echo_card_config.h pinmap.

Battery (critical):
- Add BATTERY_MEASUREMENT_CONTROL pin P0.31 — gates the resistive
  voltage divider feeding AIN0. Without toggling this pin, battery
  ADC reads are invalid (floating divider input).
- TechoCardBoard::getBatteryVoltage() now drives P0.31 HIGH before
  SAADC read and LOW after to avoid parasitic drain.

Display (critical):
- Add OLED_DISPLAY_OFFSET = 24 for the SSD1315 72×40 panel. The
  physical display is mapped at GDDRAM pages 3–7 (rows 24–63);
  SETDISPLAYOFFSET and SETMULTIPLEX commands are sent after
  display.begin() in target.cpp to shift the visible window.

Power rail (high priority):
- RT9080 3V3 LDO now gets a clean HIGH→LOW→HIGH reset cycle with
  100ms dwell in board.begin(), preventing brown-out when LoRa TX
  fires at +22 dBm after a soft reset.
2026-04-25 19:35:44 +10:00
pelgraine 36976e0029 t-echo lite - stripped emoji in contacts and last heard, changed recent adverts list to default 4 2026-04-22 12:54:16 +10:00
pelgraine f461777214 t-echo lite screen: removed diag diagnostic prints, sorted compose mode with cardkb, fixed enter & esc handlers; increased e-ink offset for home screen centering; condensed footer text for all screens; datastore chunked saved guarded for esp32 ; still encountering memory problems with ble build even w 250 contacts and 10 chanel message history so trying standalone 2026-04-21 22:43:29 +10:00
pelgraine 7e1009f31c various t-echo light screen improvements including refresh time to 15s 2026-04-21 17:40:50 +10:00