Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 82 additions & 18 deletions variants/lilygo_tlora_v2_1/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build_flags =
-D P_LORA_DIO_0=26 ; SX1276 DIO0 interrupt pin
-D P_LORA_DIO_1=33 ; SX1276 DIO1 interrupt pin
-D P_LORA_NSS=18 ; Chip select - SS pin
-D P_LORA_RESET=14 ; Reset pin
-D P_LORA_RESET=23 ; Reset pin
-D P_LORA_SCLK=5 ; SPI clock
-D P_LORA_MISO=19 ; SPI MISO
-D P_LORA_MOSI=27 ; SPI MOSI
Expand All @@ -37,7 +37,17 @@ lib_deps =
${esp32_base.lib_deps}
${sensor_base.lib_deps}

; TCXO-specific flags (for LILYGO T-LoRa V2.1-1.6 TCXO hardware variant)
[tcxo_flags]
build_flags =
-D P_LORA_DIO_1=RADIOLIB_NC ; TCXO uses NC for DIO1
-D P_LORA_TCXO_EN=33 ; TCXO enable pin

; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments ===

;
; Repeater
;
[env:LilyGo_TLora_V2_1_1_6_repeater]
extends = LilyGo_TLora_V2_1_1_6
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
Expand All @@ -56,6 +66,12 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TLora_V2_1_1_6_TCXO_repeater]
extends = env:LilyGo_TLora_V2_1_1_6_repeater
build_flags =
${env:LilyGo_TLora_V2_1_1_6_repeater.build_flags}
${tcxo_flags.build_flags}

[env:LilyGo_TLora_V2_1_1_6_terminal_chat]
extends = LilyGo_TLora_V2_1_1_6
build_flags =
Expand All @@ -70,6 +86,15 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0

[env:LilyGo_TLora_V2_1_1_6_TCXO_terminal_chat]
extends = env:LilyGo_TLora_V2_1_1_6_terminal_chat
build_flags =
${env:LilyGo_TLora_V2_1_1_6_terminal_chat.build_flags}
${tcxo_flags.build_flags}

;
; Companion Radio
;
[env:LilyGo_TLora_V2_1_1_6_companion_radio_usb]
extends = LilyGo_TLora_V2_1_1_6
build_flags =
Expand All @@ -87,6 +112,12 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0

[env:LilyGo_TLora_V2_1_1_6_TCXO_companion_radio_usb]
extends = env:LilyGo_TLora_V2_1_1_6_companion_radio_usb
build_flags =
${env:LilyGo_TLora_V2_1_1_6_companion_radio_usb.build_flags}
${tcxo_flags.build_flags}

[env:LilyGo_TLora_V2_1_1_6_companion_radio_ble]
extends = LilyGo_TLora_V2_1_1_6
build_flags =
Expand All @@ -108,23 +139,11 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0

[env:LilyGo_TLora_V2_1_1_6_room_server]
extends = LilyGo_TLora_V2_1_1_6
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_room_server>
[env:LilyGo_TLora_V2_1_1_6_TCXO_companion_radio_ble]
extends = env:LilyGo_TLora_V2_1_1_6_companion_radio_ble
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-D ADVERT_NAME='"TLora-V2.1-1.6 Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}
${env:LilyGo_TLora_V2_1_1_6_companion_radio_ble.build_flags}
${tcxo_flags.build_flags}

[env:LilyGo_TLora_V2_1_1_6_companion_radio_wifi]
extends = LilyGo_TLora_V2_1_1_6
Expand All @@ -145,6 +164,39 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0

[env:LilyGo_TLora_V2_1_1_6_TCXO_companion_radio_wifi]
extends = env:LilyGo_TLora_V2_1_1_6_companion_radio_wifi
build_flags =
${env:LilyGo_TLora_V2_1_1_6_companion_radio_wifi.build_flags}
${tcxo_flags.build_flags}

;
; Room Server
;
[env:LilyGo_TLora_V2_1_1_6_room_server]
extends = LilyGo_TLora_V2_1_1_6
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_room_server>
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-D ADVERT_NAME='"TLora-V2.1-1.6 Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TLora_V2_1_1_6_TCXO_room_server]
extends = env:LilyGo_TLora_V2_1_1_6_room_server
build_flags =
${env:LilyGo_TLora_V2_1_1_6_room_server.build_flags}
${tcxo_flags.build_flags}

;
; Repeater Bridges
;
Expand All @@ -171,6 +223,12 @@ lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TLora_V2_1_1_6_TCXO_repeater_bridge_rs232]
extends = env:LilyGo_TLora_V2_1_1_6_repeater_bridge_rs232
build_flags =
${env:LilyGo_TLora_V2_1_1_6_repeater_bridge_rs232.build_flags}
${tcxo_flags.build_flags}

[env:LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow]
extends = LilyGo_TLora_V2_1_1_6
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
Expand All @@ -190,4 +248,10 @@ build_flags =
; -D CORE_DEBUG_LEVEL=3
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}
${esp32_ota.lib_deps}

[env:LilyGo_TLora_V2_1_1_6_TCXO_repeater_bridge_espnow]
extends = env:LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow
build_flags =
${env:LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow.build_flags}
${tcxo_flags.build_flags}
7 changes: 7 additions & 0 deletions variants/lilygo_tlora_v2_1/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ bool radio_init() {
fallback_clock.begin();
rtc_clock.begin(Wire);

// Enable TCXO before radio initialization
#ifdef P_LORA_TCXO_EN
pinMode(P_LORA_TCXO_EN, OUTPUT);
digitalWrite(P_LORA_TCXO_EN, HIGH);
delay(50); // Allow TCXO to stabilize
#endif

#if defined(P_LORA_SCLK)
return radio.std_init(&spi);
#else
Expand Down