345 Commits

Author SHA1 Message Date
pelgraine 7f9503c988 Fix alarm screen hint text when autolock has been applied 2026-06-07 22:17:57 +10:00
pelgraine 38656f9d1d Add on-device Rx Log packet sniffer and RX packet counter
RX packet counter: shows total received packets (flood + direct) on the
radio details page; RAM-only, resets on boot and on any SF/freq/BW change.

Rx Log: app-style packet sniffer opened from Settings > "Rx Log >>".
Captures the last 100 received packets pre-filter via Dispatcher::logRx
into a PSRAM ring, with decoded "sender: message" lines matched by packet
hash for decryptable channels. Each entry shows route/type, time, size,
hash, path, channel or From/To, SNR. W/S scroll, Q back to Settings;
T5S3 swipe-scroll rides the same path.

Files: MyMesh.h/.cpp, RxLogScreen.h (new), UITask.h/.cpp,
SettingsScreen.h, main.cpp.
2026-06-07 05:14:16 +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 28f50ae373 update firmware build date. add toaster popup to voice messages screen for when contact doesn't have direct path 2026-06-05 02:58:31 +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 0a92f5ba48 Max - three touch capacitive buttons wired. Heart = backlight at full brightness. Speech bubble = opens channel picker. Paper plane = opens DM inbox 2026-06-04 21:44:15 +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 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 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 6966ae724b max - reduced keyboard backlight brightness to 32 2026-06-02 23:07:32 +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 6f95884d47 STUPID BACKLIGHT IS WORKING FINALLY AAAH 2026-06-02 22:15:15 +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 ef62b7145c TD Pro - add custom tones for 4G variant 2026-05-15 08:32:36 +10:00
pelgraine f6cc939c4d tdpro add minesweeper game 2026-05-15 07:29:14 +10:00
pelgraine 2907cc64f3 updated firmware build date; added [J] Games to home screen; added game sub screen; added basic Snake game 2026-05-15 06:59:49 +10:00
pelgraine 1e589b3eb9 td pro - custom notification sounds enabled for t-deck pro audio variant 2026-05-12 17:14:11 +10:00
pelgraine ceb29ba662 tdpro - channel message history delete function - long press on screen to bring up menu 2026-05-12 04:50:32 +10:00
pelgraine 661157e368 Fix trace screen for t5s3 and add home icon for trace screen to t5s3 2026-05-07 20:27:58 +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 44353fcf9e hibernation page navigation bugfix 2026-05-03 23:15:32 +10:00
pelgraine 4ba130ccfa update readme for v1.8; added fix: robust SPIFFS recovery when auto-format fails
SPIFFS.begin(true) auto-formats on mount failure, but the auto-format
itself can fail if the partition contains residual data from a previous
firmware (e.g. stock LilyGo, Meshtastic, or MeshCore with a different
partition layout). When that happens the firmware previously printed
"SPIFFS format FAILED!" and continued in a broken state with no
persistence.

Now on auto-format failure:
1. Find the SPIFFS partition via esp_partition_find_first()
2. Erase it completely with esp_partition_erase_range()
3. Call SPIFFS.format() + SPIFFS.begin(false) with up to 3 retries

Added #include <esp_partition.h> under ESP32 guard.

The existing first-boot display feedback ("Formatting storage...
First boot - please wait") is unchanged -- it fires on the initial
mount failure. The new partition erase code only triggers if the
auto-format also fails.
2026-05-03 21:22:07 +10:00
pelgraine c2bfc3c985 Add true power-off via BQ25896 BATFET disconnect
Hibernate (deep sleep) leaves the BQ25896 charger IC powered, drawing
~30-60uA quiescent from BAT. This adds a second option on the shutdown
page -- "power off" -- that writes the BATFET_DIS bit in BQ25896 REG09
to fully disconnect the battery from VSYS. Leakage drops to ~12-23uA
(IC internal only). Wake requires USB-C plug-in.

Shutdown page now shows two options with a cursor (up/down to toggle):
  > hibernate: long press/Enter   (T-Deck Pro)
    power off: long press/Enter
  > hibernate: long press          (T5S3 / other)
    power off: long press

Selecting "hibernate" triggers immediately (unchanged behaviour).
Selecting "power off" shows a confirmation prompt:
  power off device?
  usb-c to wake
  Enter:yes  q:no

Power-off display suppresses the header (node name, clock, battery)
and shows only "powering off..." and "plug in USB-C to turn on".

The 's' key shortcut to settings is gated on the shutdown page so it
passes through to the hibernate/power-off selection toggle instead.
Both the TCA8418 handler (loop) and the broader handler
(handleKeyboardInput) are gated via isHomeOnShutdownPage().

PRESS_LABEL macro: removed dead UI_HAS_JOYSTICK branch (no Meck
device has a joystick), collapsed to a single #define "long press".
Joystick input polling block in loop() also removed (dead code behind
#if UI_HAS_JOYSTICK, never compiled for any Meck build).

BQ25896 I2C sequence follows TI recommendation (E2E forum, Jeff/TI):
  1. Read REG09
  2. Write BATFET_DLY=1 (bit 3) -- delays disconnect so I2C completes
  3. Write BATFET_DIS=1 | BATFET_DLY=1 (bits 5+3) -- last I2C write
The write happens after display turnOff but before board powerOff, so
I2C pull-ups on VDD3V3 are still alive. Board enters deep sleep, then
BATFET opens after tSM_DLY (~10-15s). Skipping the delay risks leaving
the BQ25896 I2C engine in an undefined state that can prevent wake on
USB-C plug-in (device soft-brick requiring battery disconnect).

REG09 bit map (confirmed from Linux kernel bq25890_charger.c):
  Bit 7: FORCE_ICO
  Bit 6: TMR2X_EN
  Bit 5: BATFET_DIS  (0x20) -- disconnect battery
  Bit 4: JEITA_VSET
  Bit 3: BATFET_DLY  (0x08) -- delay before disconnect
  Bit 2: BATFET_RST_EN (0x04) -- QON wake (not wired on T-Deck Pro)
  Bit 1: PUMPX_UP
  Bit 0: PUMPX_DN

Schematic confirms QON (pin 12) has R4 10K pull-up to REGN with no
user-accessible button -- USB-C is the only wake path from ship mode.

Guarded by #ifdef I2C_ADDR_BQ25896 so it compiles on all platforms
but only activates on boards with the charger (T-Deck Pro, T5S3).

Files changed:
  UITask.h   -- _full_poweroff, setFullPowerOff(), isHomeOnShutdownPage()
  UITask.cpp -- shutdown page UI, input handling, BATFET write,
                PRESS_LABEL cleanup, joystick removal
  main.cpp   -- 's' key gated on shutdown page (both handlers)
2026-05-03 20:24:20 +10:00
pelgraine 97498e131d updated chunked save method so it doesn't occur when device is actively being used. The flow: user navigates (keypresses every ~200ms) → _lastUserInput stays fresh → userActive is true → save deferred. User stops navigating → 3 seconds pass → userActive goes false → chunked save starts/resumes, 20 contacts per loop iteration until done. 2026-05-02 10:44:17 +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 715202849c initial successful t-echo card build 2026-04-30 18:13:01 +10:00
pelgraine 64afdb2829 updated max frame size in base serial interface to match upstream meshcore; fix getbatterypercent in abstractuitask; update renderbatteryindicator et al in uitask; change lock screen refresh to 1 min for td pro and 2 min to t5s3; fix issue in t5s3 where it was still showing lock screen in hibernating mode'; fixed cardkb bug caused by t-echo lite wip work 2026-04-30 00:20:00 +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
pelgraine db0ecd3c58 initial screen based t-echo lite with card kb support build 2026-04-21 14:07:06 +10:00
pelgraine 81b3cd2591 try and improve key responsiveness/debounce in compose mode; fix crowding in channel screen navbar text in tiny font mode 2026-04-19 18:36:25 +10:00
pelgraine 3e6bcfb031 updated loading splash screen for spiffs failure message first time flashers 2026-04-19 16:03:37 +10:00
pelgraine 49f1d91c15 tdpro - fixed notes screen touch recog and file open bug 2026-04-19 15:55:47 +10:00
pelgraine 8e3a09e3b1 added channel picker screen as messages home screen view; fixed battery curve reading to better reflect actual charge state (4200 to 4160); patched clock sync to throw out garbage rtc when device has been powered off for a while & now syncs on ble app connection: more font style customisation; nav bar hint text reduced when larger fonts are selected; ensured font style persists across reboots 2026-04-19 15:37:52 +10:00
pelgraine a4e8c31a16 fiiiiixed the contacts add and delete and toggle fav issues for real this time 2026-04-12 20:42:45 +10:00
pelgraine 0c032429eb Added new emoji to emoji picker; bug fixes for larger battery capacities recognition regression; updated readme for clarity on contacts add; updated firmware version; fix stupid blob storage size & buffer issue so now you can add contacts from last heard finally!!! Updated readme accordingly 2026-04-12 18:15:33 +10:00
pelgraine c578dcadc8 T5S3 - fixed touch selector fav contacts bug
TDPro - Update firmware build date

Contactsscreen.h — five changes:

- EPOCH_2026 = 1735689600UL constant added (Jan 1 2026 UTC), used in sort
  and formatAge.

- typeChar replaced by typeStr returning const char*, with "RS" for room
  servers (previously "S", easily confused with sensors). prefix buffer
  bumped to [5], all three snprintf calls updated to %s.

- Hop display: out_path_len == 0xFF branch now performs a live lookup
  against the 12 most recently heard advert paths (via
  getRecentlyHeard). Matches on first 7 bytes of pub_key, extracts hop
  count with a bph-aware sanity cap (64/bph max) to reject impossible
  values. Shows "~D" for direct flood neighbours, "~N" for N-hop flood
  path, "?" if not in the recent-heard cache. Resets to "?" on reboot
  until each contact re-advertises — intentional, ensures hop count is
  always fresh.

- Sort: _filteredTs now stores contact.lastmod (our local receive time)
  instead of contact.last_advert_timestamp (sender's claimed time).
  lastmod values below EPOCH_2026 are stored as 0 so stale repeaters
  with unsynced clocks and contacts received before our own timesync
  sink to the bottom of the list.

- formatAge rewritten: rejects timestamp == 0, timestamp < EPOCH_2026,
  and now < timestamp (all show "--" instead of wrapping or displaying
  garbage). Arithmetic changed from int to uint32_t, eliminating the
  signed overflow path that produced negative hour values. Age display
  call site switched from last_advert_timestamp to lastmod, so display
  self-corrects after a GPS or 4G timesync.
2026-04-12 12:44:10 +10:00
pelgraine c687133b05 tdpro refined file export contacts selection json 2026-03-31 02:49:57 +11:00
pelgraine b4983e48f0 set custom contact paths 2026-03-29 17:06:45 +11:00
pelgraine 9d7cbd4866 tdpro audio only - voice notes over lora - 5 seconds stage 1 2026-03-29 14:04:54 +11:00
pelgraine 5679cda38e tdpro touch paches - dialpad touch system conflict fix and longpress changed to 750ms 2026-03-27 02:43:06 +11:00
pelgraine 342cf4e745 tdpro large font pref option; various large font ui fixes; fix fcc recognition in t5s3 to match 1500 2026-03-26 15:34:09 +11:00