Commit Graph

2551 Commits

Author SHA1 Message Date
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 4b734f1bac updated drivers for t-echo card 2026-05-05 12:43:53 +10:00
pelgraine 20310018d3 updating t-echo card folder 2026-05-05 12:41:24 +10:00
pelgraine 8afe71510e Merge branch 'main' into dev 2026-05-05 11:57:18 +10:00
pelgraine 7adc0283b2 add sponsor link 2026-05-05 11:56:13 +10:00
pelgraine e72e498db9 Set GitHub Sponsors username to 'pelgraine'
Updated GitHub Sponsors username in FUNDING.yml
2026-05-05 11:53:55 +10:00
pelgraine 468a5ad324 update tdpro firmware versions 2026-05-05 11:39:38 +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.
v1.8
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 00b3f66bc4 Merge branch 'dev' 2026-05-03 18:55:34 +10:00
pelgraine fb93b4e4ec update readme links 2026-05-03 18:55:03 +10:00
pelgraine a7b44de613 Went back to the previous method of markAllChannelsRead() for WIfi and BLE envs ie non-standalone devices so msgs marked read on device when app is connected 2026-05-03 18:40:28 +10:00
pelgraine 7ebafc39ee update firmware build date 2026-05-03 18:20:48 +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 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 6c0c77d788 improved tdpro and t5s3 ble sync speed with large contact lists; updated firmware build date 2026-05-02 06:07:12 +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 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 26d54074c8 update firmware version and build date 2026-04-27 08:30:49 +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 964606a018 Update README.md
Updated discord channel link
2026-04-23 18:29:00 +10:00
pelgraine a8d65aa3ba Update README.md
Fixed links for discord and Meshcore flasher
2026-04-23 18:23:34 +10:00
pelgraine e74aa3b214 t-echo lite - attempt to fix debounce and emoji gibberish 2026-04-22 15:12:20 +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
pelgraine db0ecd3c58 initial screen based t-echo lite with card kb support build 2026-04-21 14:07:06 +10:00
pelgraine 291c42a40e fix ota for remote wifi repeaters 2026-04-19 22:32:31 +10:00
pelgraine 88a56d3ff5 update meck remote repeater builds to ensure consistency with region defaults and loop detect 2026-04-19 22:11:15 +10:00
pelgraine 4ec5d17402 update remote repeater firmware files to enable loop detection and regions 2026-04-19 22:04:31 +10:00
pelgraine 6360a167c5 Merge branch 'dev' v1.7 disregard 2026-04-19 21:04:09 +10:00
pelgraine ca5283af4f update readme, particularly licence section 2026-04-19 21:03:31 +10:00
pelgraine b42291c5fc fix bubble display t5s3 for channel picker 2026-04-19 21:02:47 +10:00
pelgraine 8f0d961048 update readme for v1.7 updates 2026-04-19 20:54:13 +10:00
pelgraine 27e8b8422b Merge branch 'dev' 2026-04-19 20:42:45 +10:00
pelgraine b57e000496 fix: remove BLE sync marking channels as read (regression from Feb).
The markChannelReadFromBLE() calls in the CMD_SYNC_NEXT_MESSAGE handler were marking channels and DMs as read the moment the BLE companion app synced them from the offline queue. Since the app drains the entire queue automatically on connect, this had the effect of clearing all unread indicators on the device as soon as BLE connected — before the user had actually read anything in either the app or on the device.
The MeshCore BLE protocol has no "user opened this channel" command from the app side; CMD_SYNC_NEXT_MESSAGE is an automatic bulk pull, so "synced to app" ≠ "read by user." Removed the channel and DM mark-read calls so unread counts only clear when the user navigates to that channel on the device itself. The msgRead() progress counter (syncing X messages) is unaffected.
2026-04-19 20:41:06 +10:00
pelgraine f449385e8f Merge branch 'dev' :) 2026-04-19 20:30:15 +10:00
pelgraine 31ac732f08 fix bug where channels imported from older config files displayed gibberish in channel scope under settingsscreen even when region scope not set; fix bug where after device clock sync advert times last heard weren't displaying correctly (ie showed 16895h) 2026-04-19 20:23:12 +10:00
pelgraine 46413b9858 add serial command support for regions, update serial settings guide 2026-04-19 19:53:45 +10:00
pelgraine ce6acdfd34 temp cmd 54 support 2026-04-19 19:40:03 +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 5c275a8c23 Regions - including settings nudge to remind user if no default nor channel region set. Set region by typing custom entry 2026-04-19 18:17:25 +10:00
pelgraine b536e24f8e fix word wrapping ereader for larger custom font selection 2026-04-19 17:57:29 +10:00
pelgraine 5b38b713da fix home screen ui display when montserrat or notosans selected; fix word wrap display for other fonts in tiny mode for ereader 2026-04-19 17:27:48 +10:00