Feature: Add LilyGo T-Echo Card board variant#2451
Open
pelgraine wants to merge 10 commits intomeshcore-dev:devfrom
Open
Feature: Add LilyGo T-Echo Card board variant#2451pelgraine wants to merge 10 commits intomeshcore-dev:devfrom
pelgraine wants to merge 10 commits intomeshcore-dev:devfrom
Conversation
…_msgcount still updates and the display still wakes on new messages, but it stays on the home screen instead of switching to a preview that's unreadable at 72×40. Also saves a bit of nRF52 heap by skipping the allocation. TechoCardHomeScreen.h — Battery % moved from Y0 down to Y1, right-aligned opposite the MSG count. Node name now has the full top line to itself.
…le sleep. New file: - GPSStreamCounter.h: Stream wrapper counting NMEA sentences for live baud-rate confirmation on the GPS home screen page. Variant fixes: - variant.h: swap GPS RX/TX pins (vendor labels are chip-perspective, not nRF-perspective); #ifndef guards on buzzer defines. - target.cpp/h: wire GPSStreamCounter around Serial1. - TechoCardBoard: getMCUTemperature() via sd_temp_get (SoftDevice-safe), BQ25896 charger I2C API, ICM20948/AK09916 compass init/read/sleep. - TechoCardHomeScreen.h: COMPASS + BATTERY pages, NMEA rate when no GPS fix, battPercent() recalibrated to 4.16V full-charge ceiling. Cross-platform (all guarded behind LILYGO_TECHO_CARD or NRF52_PLATFORM): - MyMesh.cpp: MCU die temp in both telemetry paths; hasPendingWork(). - MyMesh.h: hasPendingWork() decl; GPS enable-at-boot (#if TECHO_CARD). - main.cpp: board.sleep(0) when idle (#if NRF52_PLATFORM). - UITask.cpp: _version_info[24]; double-click screen toggle and GPS hardware enable/disable (#if LILYGO_TECHO_CARD).
…o off milis to 60 seconds instead of default 15 in platformio; compass fix and calibration fix in techoboardhome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds board support for the LilyGo T-Echo Card — an nRF52840-based LoRa node with SX1262 radio, 72×40 SSD1315 OLED, L76K GPS, WS2812 RGB LEDs, and buzzer. Pin definitions for additional onboard peripherals (MAX98357 speaker amp, MP34DT05 PDM mic, ICM20948 IMU, BQ25896 charge controller) are included in
variant.hbut no driver integration exists yet.Please note this was AI-coded and could do with several reviews.
New files
Board definition:
boards/lilygo_techo_card.json— PlatformIO board definition (nRF52840, SoftDevice S140 v6)Variant directory (
variants/lilygo_techo_card/):variant.h/variant.cpp— Pin definitions andg_ADigitalPinMap, cross-referenced against LilyGo'st_echo_card_config.hand Meshtastic PR #10267. Fix GPS RX/TX pin mapping (vendor labels are from the GPS chip's perspective; pins 19/21 were reversed). #ifndef guards on buzzer defines.target.h/target.cpp— Hardware interface declarations and instantiation (radio, RTC, GPS, display, sensors). Wire GPSStreamCounter around Serial1 before MicroNMEA.TechoCardBoard.h/TechoCardBoard.cpp— Board class extendingNRF52BoardDCDCwith GPS power control, WS2812 NeoPixel support (3 LEDs daisy-chained on pin 39), buzzer, speaker enable, and gated battery ADC. Add getMCUTemperature() override using sd_temp_get() (SoftDevice-safe; direct register access hard faults). BQ25896 charger IC driver (I2C 0x6B): probe, register read/write, continuous ADC, charge status, battery mV, thermistor %. ICM20948/AK09916 compass: I2C bypass init, burst magnetometer read, sleep for power saving (~3-4 mA).TechoCardHomeScreen.h— Compact home screen for the 72x40 display with eight pages (Status, Radio, BLE, Advert, GPS, Compass, Battery, Hibernate). NMEA sentence rate display when GPS has no fix. GPS coordinates split across two lines when fix acquired. battPercent() recalibrated to 4.16V full-charge ceiling. Compass heading corrected for PCB axis orientation. On-device magnetometer calibration with persistence.platformio.ini— Five build environments: companion BLE, companion USB, repeater, room server, sensor. AUTO_OFF_MILLIS=60000 for BLE companion build (60 second screen timeout; double-click A to wake).New display driver:
src/helpers/ui/U8g2Display.h—DisplayDriverimplementation using U8g2, targetingU8G2_SSD1306_72X40_ER_F_HW_I2C. This handles all GDDRAM column/page offset mapping natively, avoiding manual offset calculations. Reusable for any future U8g2-based board.Modified files
examples/companion_radio/ui-new/UITask.cpp— Guarded additions for T-Echo Card (#if defined(LILYGO_TECHO_CARD)/#if !defined(LILYGO_TECHO_CARD)); Widen _version_info buffer from [12] to [24]. Double-click screen on/off toggle for battery saving (#if defined(LILYGO_TECHO_CARD)). Hardware GPS power control in toggleGPS() (#if defined(LILYGO_TECHO_CARD)). Triple-click A (user button) toggles buzzer on/off (#if defined(LILYGO_TECHO_CARD)).TechoCardHomeScreen.hTechoCardHomeScreeninstantiation instead ofHomeScreenPIN_BOOT_BTNhandler for second navigation button + double-click torch toggleMsgPreviewScreenguarded out — the 72×40 display is too small for message previews. The unread count still updates and the display still wakes on incoming messages, but stays on the home screen. Also saves nRF52 heap by skipping the allocation.Hardware notes
Adafruit_NeoPixel::begin()with a 300µs reset pulse to prevent stray HIGH latching green into the first LED during power-on.PIN_OLED_ENat boot to prevent brown-out when LoRa TX fires at full power (from Meshtastic PR #10267).SX126X_DIO3_TCXO_VOLTAGE), DIO2 as RF switch.Testing status
techo_card_companion_radio_bletecho_card_companion_radio_usbtecho_card_repeatertecho_card_room_servertecho_card_sensorDependencies added
olikraus/U8g2 @ ^2.35.19adafruit/Adafruit NeoPixel @ ^1.12.3adafruit/Adafruit SSD1306 @ ^2.5.12(+ Adafruit GFX, BusIO)end2endzone/NonBlockingRtttl @ ^1.3.0stevemarple/MicroNMEA @ ^2.0.6