Skip to content

Fixes #1183 — T-Echo Lite incorrect battery voltage#2287

Merged
liamcottle merged 1 commit intomeshcore-dev:devfrom
pelgraine:fix/techo-lite-battery
Apr 22, 2026
Merged

Fixes #1183 — T-Echo Lite incorrect battery voltage#2287
liamcottle merged 1 commit intomeshcore-dev:devfrom
pelgraine:fix/techo-lite-battery

Conversation

@pelgraine
Copy link
Copy Markdown

@pelgraine pelgraine commented Apr 10, 2026

The T-Echo Lite variant files were copied from the T-Echo without adapting to the Lite's different hardware. Three issues fixed, plus build environments added for the screenless Core variant.

Battery (TechoBoard.h/cpp): Added PIN_VBAT_MEAS_EN (P0.31) — the T-Echo Lite has a gated voltage divider that must be enabled before reading. Also added pinMode(PIN_VBAT_READ, INPUT) before each ADC read to reclaim P0.02 from other peripherals. Pin definitions hardcoded from LilyGo's t_echo_lite_config.h.

I2C (variant.h): Corrected SDA/SCL from P0.04/P0.02 to P1.04/P1.02 per LilyGo's IIC_1_SDA/IIC_1_SCL. The old P0.02 mapping conflicted with the battery ADC pin.

GPS (variant.h): Corrected all five GPS pin assignments to match LilyGo's config — UART TX/RX, wake, PPS, and power enable were all scrambled.

Tested on T-Echo Lite Base (screenless):
H747-01_01

Battery readings now match Heltec V4 comparison reference within 10mV - Heltec v4 read partially discharged battery as 3.51v, screenshots of T-Echo Lite readings below:

IMG_2110
IMG_2111
IMG_2112

@pelgraine pelgraine changed the title Fixes #1183 — T-Echo Lite incorrect battery voltage + headless (Core) support Fixes #1183 — T-Echo Lite incorrect battery voltage + headless env support Apr 10, 2026
@jirogit
Copy link
Copy Markdown
Contributor

jirogit commented Apr 21, 2026

Hi @pelgraine — a few questions to help clarify which variant this PR
actually targets, since LilyGO's naming is confusing many people
(including me):

  1. Which hardware do you have? The PR title says "Core" but the
    photos in here looks Non-Shell. Could you confirm
    whether your device is:

    • T-Echo Lite Core (castellated module, no USB, no display)
    • T-Echo Lite Non-Shell (has USB-C, no display)
    • T-Echo Lite (full version with ePaper display)
  2. Naming convention: The new base env LilyGo_T-Echo-Lite-Core
    uses a hyphen before "Core", while the rest of the codebase uses
    underscores (e.g. Heltec_t114_without_display_companion_radio_ble).
    Also, _base suffix is used for PlatformIO base envs elsewhere
    (e.g. Heltec_E213_base), while core does not appear anywhere
    in the codebase. Worth aligning with maintainer preference.

I ask because my PR #2353 targets the Non-Shell variant specifically,
and I want to make sure we cover all three variants correctly without
overlap or gaps.

@pelgraine
Copy link
Copy Markdown
Author

@jirogit

Hi, yes, I shouldn't have put the platformio changes in. This fix is really just about the battery voltage problem detailed in issue #1183, not the headless build problem. The one I worked with was actually the T-Echo Lite Non-Shell (has USB-C, no display) version. When I have a spare minute I'll fix the PR to remove those.

Battery (TechoBoard.h/cpp): Added PIN_VBAT_MEAS_EN (P0.31) — the T-Echo
Lite has a gated voltage divider that must be enabled before reading. Also
added pinMode(PIN_VBAT_READ, INPUT) before each ADC read to reclaim P0.02
from other peripherals. Pin definitions hardcoded from LilyGo's
t_echo_lite_config.h.

I2C (variant.h): Corrected SDA/SCL from P0.04/P0.02 to P1.04/P1.02 per
LilyGo's IIC_1_SDA/IIC_1_SCL. The old P0.02 mapping conflicted with the
battery ADC pin.

GPS (variant.h): Corrected all five GPS pin assignments to match LilyGo's
config — UART TX/RX, wake, PPS, and power enable were all scrambled.

SPI (variant.h): Fixed SPI_INTERFACES_COUNT from _PINNUM(0, 2) to (2).

Tested on T-Echo Lite Non-Shell (USB-C, no display). Battery readings match
Heltec V4 reference within 10mV.
@pelgraine pelgraine force-pushed the fix/techo-lite-battery branch from aeecc4d to d516cd8 Compare April 22, 2026 02:56
@pelgraine pelgraine changed the title Fixes #1183 — T-Echo Lite incorrect battery voltage + headless env support Fixes #1183 — T-Echo Lite incorrect battery voltage Apr 22, 2026
@pelgraine
Copy link
Copy Markdown
Author

Updated to remove platformio changes and references to headless env.

Also tested with my new T-Echo Lite with shell & screen with the T-Echo Lite companion radio BLE build and can confirm that displays as expected.

IMG_2413 IMG_2414

@pelgraine
Copy link
Copy Markdown
Author

@jirogit all updated!

@liamcottle liamcottle merged commit dc54857 into meshcore-dev:dev Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants