From 4999c89820a5b710f2b6b3542fe60b5db4ad3e56 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Tue, 18 Jun 2024 19:30:34 -0400 Subject: [PATCH] all boards with 915 versions added --- .github/workflows/build.yml | 14 ++++++++++++ README.md | 5 ++++- platformio.ini | 45 +++++++++++++++++++++++++++++++------ src/A7670_utils.cpp | 2 +- src/LoRa_APRS_iGate.cpp | 6 ++--- src/aprs_is_utils.cpp | 12 +++++----- src/boards_pinout.h | 37 +++++++++++++++--------------- src/lora_utils.cpp | 6 ++--- src/utils.cpp | 2 +- 9 files changed, 89 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4880097..7364f81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ jobs: target: - name: ttgo-lora32-v21 chip: esp32 + - name: ttgo-lora32-v21_915 + chip: esp32 - name: heltec-lora32-v2 chip: esp32 - name: heltec_wifi_lora_32_V3 @@ -23,18 +25,28 @@ jobs: chip: esp32s3 - name: ESP32_DIY_LoRa chip: esp32 + - name: ESP32_DIY_LoRa_915 + chip: esp32 - name: ESP32_DIY_1W_LoRa chip: esp32 + - name: ESP32_DIY_1W_LoRa_915 + chip: esp32 - name: ttgo-t-beam-v1_2 chip: esp32 + - name: ttgo-t-beam-v1_2_915 + chip: esp32 - name: ttgo-t-beam-v1 chip: esp32 + - name: ttgo-t-beam-v1_915 + chip: esp32 - name: ttgo-t-beam-v1_SX1268 chip: esp32 - name: ttgo-t-beam-v1_2_SX1262 chip: esp32 - name: ESP32_DIY_LoRa_A7670 chip: esp32 + - name: ESP32_DIY_LoRa_A7670_915 + chip: esp32 - name: heltec_wireless_tracker chip: esp32s3 - name: OE5HWN_MeshCom @@ -49,6 +61,8 @@ jobs: chip: esp32c3 - name: esp32c3_DIY_1W_LoRa chip: esp32c3 + - name: esp32c3_DIY_1W_LoRa_915 + chip: esp32c3 steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index e81164b..af1fc18 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,15 @@ ____________________________________________________ ### Buying links --> here. +(NOTE: all boards with 433-868-915 MHz versions) + - TTGO Lilygo LoRa32 v2.1 / v1.6 (they work the same). - TTGO T-Beam v1.0 , v1.1, v1.2 (also variations with SX1262 and SX1268 LoRa Modules). - HELTEC V2, V3 , Wireless Stick, Wireless Stick Lite, HT-CT62, Wireless Tracker. -- ESP32 Wroom + SX1278 LoRa Module or Ebyte 400M30S 1W LoRa Module for a DIY Versions. +- ESP32 Wroom + SX1278 LoRa Module or Ebyte 400M30S/900M30S 1W LoRa Module for a DIY Versions. - ESP32C3 + Ebyte 400M30S 1W LoRa Module for another DIY version. @@ -48,6 +50,7 @@ ____________________________________________________ ____________________________________________________ ## Timeline (Versions): +- 2024.06.18 All boards with 433 / 868 / 915 MHz versions. - 2024.06.10 ESP32C3 + 1W LoRa Module (E22 400M30S) support added. - 2024.06.09 Si7021 module added (with autodetected I2C Address) - 2024.06.08 Callsign Validation for all Rx and Tx Station that iGate/Digi hears. diff --git a/platformio.ini b/platformio.ini index 6923af1..0391096 100644 --- a/platformio.ini +++ b/platformio.ini @@ -132,6 +132,7 @@ build_flags = -Werror -Wall -DESP32_DIY_1W_LoRa -DHAS_SX1268 + -DHAS_1W_LORA -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 lib_deps = ${common.lib_deps} @@ -251,6 +252,7 @@ build_flags = -Werror -Wall -DOE5HWN_MeshCom -DHAS_SX1268 + -DHAS_1W_LORA -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 lib_deps = ${common.lib_deps} @@ -282,13 +284,13 @@ lib_deps = adafruit/Adafruit SSD1306 @ 2.5.10 [env:esp32c3_DIY_1W_LoRa] -extends = env:esp32 board = esp32-c3-devkitm-1 board_build.mcu = esp32c3 build_flags = -Werror -Wall -DESP32C3_DIY_1W_LoRa -DHAS_SX1268 + -DHAS_1W_LORA -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 @@ -297,7 +299,7 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 -[env:ttgo-lora32-v21-915] +[env:ttgo-lora32-v21_915] board = ttgo-lora32-v21 build_flags = -Werror -Wall @@ -309,7 +311,7 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 -[env:ESP32_DIY_LoRa-915] +[env:ESP32_DIY_LoRa_915] board = esp32dev build_flags = -Werror -Wall @@ -321,7 +323,7 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 -[env:ttgo-t-beam-v1_2-915] +[env:ttgo-t-beam-v1_2_915] board = ttgo-t-beam build_flags = -Werror -Wall @@ -335,7 +337,7 @@ lib_deps = adafruit/Adafruit SSD1306 @ 2.5.10 lewisxhe/XPowersLib @ 0.2.4 -[env:ttgo-t-beam-v1-915] +[env:ttgo-t-beam-v1_915] board = ttgo-t-beam build_flags = -Werror -Wall @@ -349,7 +351,7 @@ lib_deps = adafruit/Adafruit SSD1306 @ 2.5.10 lewisxhe/XPowersLib @ 0.2.4 -[env:ESP32_DIY_LoRa_A7670-915] +[env:ESP32_DIY_LoRa_A7670_915] board = esp32dev build_flags = -Werror -Wall @@ -361,4 +363,33 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 vshymanskyy/TinyGSM @ 0.12.0 - vshymanskyy/StreamDebugger @ 1.0.1 \ No newline at end of file + vshymanskyy/StreamDebugger @ 1.0.1 + +[env:ESP32_DIY_1W_LoRa_915] +board = esp32dev +build_flags = + -Werror -Wall + -DESP32_DIY_1W_LoRa_915 + -DHAS_SX1262 + -DHAS_1W_LORA + -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 +lib_deps = + ${common.lib_deps} + adafruit/Adafruit GFX Library @ 1.11.9 + adafruit/Adafruit SSD1306 @ 2.5.10 + +[env:esp32c3_DIY_1W_LoRa_915] +board = esp32-c3-devkitm-1 +board_build.mcu = esp32c3 +build_flags = + -Werror -Wall + -DESP32C3_DIY_1W_LoRa_915 + -DHAS_SX1262 + -DHAS_1W_LORA + -DARDUINO_USB_MODE=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + -DELEGANTOTA_USE_ASYNC_WEBSERVER=1 +lib_deps = + ${common.lib_deps} + adafruit/Adafruit GFX Library @ 1.11.9 + adafruit/Adafruit SSD1306 @ 2.5.10 \ No newline at end of file diff --git a/src/A7670_utils.cpp b/src/A7670_utils.cpp index 3001e7a..2014a9d 100644 --- a/src/A7670_utils.cpp +++ b/src/A7670_utils.cpp @@ -6,7 +6,7 @@ #include "display.h" #include "utils.h" -#if defined(ESP32_DIY_LoRa_A7670) +#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #define TINY_GSM_MODEM_SIM7600 //The AT instruction of A7670 is compatible with SIM7600 #define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb #define SerialAT Serial1 diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index edf3665..b15e36a 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -33,7 +33,7 @@ ________________________________________________________________________________ #include "tnc_utils.h" #include "display.h" #include "utils.h" -#ifdef ESP32_DIY_LoRa_A7670 +#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #include "A7670_utils.h" #endif @@ -116,7 +116,7 @@ void setup() { BME_Utils::setup(); WEB_Utils::setup(); TNC_Utils::setup(); - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) A7670_Utils::setup(); #endif Utils::checkRebootMode(); @@ -138,7 +138,7 @@ void loop() { WIFI_Utils::checkWiFi(); // Always use WiFi, not related to IGate/Digi mode - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) if (Config.aprs_is.active && !modemLoggedToAPRSIS) A7670_Utils::APRS_IS_connect(); #else if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) APRS_IS_Utils::connect(); diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index 0145594..59f879f 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -24,7 +24,7 @@ extern bool backUpDigiMode; uint32_t lastRxTime = millis(); -#ifdef ESP32_DIY_LoRa_A7670 +#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) extern bool stationBeacon; #endif @@ -82,7 +82,7 @@ namespace APRS_IS_Utils { if (!Config.aprs_is.active) { aprsisState = "OFF"; } else { - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) if (modemLoggedToAPRSIS) { aprsisState = "OK"; } else { @@ -217,7 +217,7 @@ namespace APRS_IS_Utils { display_toggle(true); } lastScreenOn = millis(); - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) stationBeacon = true; A7670_Utils::uploadToAPRSIS(aprsPacket); stationBeacon = false; @@ -250,7 +250,7 @@ namespace APRS_IS_Utils { Sender += ' '; } String ackPacket = Config.callsign + ">APLRG1,TCPIP,qAC::" + Sender + ":" + ackMessage; - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) A7670_Utils::uploadToAPRSIS(ackPacket); #else upload(ackPacket); @@ -268,7 +268,7 @@ namespace APRS_IS_Utils { } lastScreenOn = millis(); delay(500); - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) A7670_Utils::uploadToAPRSIS(queryAnswer); #else upload(queryAnswer); @@ -305,7 +305,7 @@ namespace APRS_IS_Utils { } void listenAPRSIS() { - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) A7670_Utils::listenAPRSIS(); #else if (espClient.connected()) { diff --git a/src/boards_pinout.h b/src/boards_pinout.h index b81c36b..aec372e 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -28,7 +28,7 @@ #define RADIO_BUSY_PIN 13 // SX1262 BUSY #endif -#ifdef ESP32_DIY_1W_LoRa // Ebyte E22 400M30S / SX1268 +#if defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) // Ebyte E22 400M30S (SX1268) or E22 900M30S (SX1262) #define RADIO_SCLK_PIN 18 #define RADIO_MISO_PIN 19 #define RADIO_MOSI_PIN 23 @@ -106,10 +106,23 @@ #define OLED_SDA 21 #define OLED_SCL 22 #define OLED_RST 36 -#endif +#endif + +#if defined(ESP32C3_DIY_1W_LoRa) || defined(ESP32C3_DIY_1W_LoRa_915) + #define RADIO_SCLK_PIN 8 + #define RADIO_MISO_PIN 9 + #define RADIO_MOSI_PIN 10 + #define RADIO_CS_PIN 5 + #define RADIO_RST_PIN 4 + #define RADIO_DIO1_PIN 2 + #define RADIO_BUSY_PIN 3 + #define RADIO_RXEN 6 + #define RADIO_TXEN 7 +#endif + // OLED -#if defined(TTGO_T_LORA32_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom) || defined(ESP32_DIY_LoRa_A7670) || defined(TTGO_T_LORA32_V2_1_915) || defined(ESP32_DIY_LoRa_915) || defined(TTGO_T_Beam_V1_0_915) || defined(TTGO_T_Beam_V1_2_915) || defined(ESP32_DIY_LoRa_A7670_915) +#if defined(TTGO_T_LORA32_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(OE5HWN_MeshCom) || defined(ESP32_DIY_LoRa_A7670) || defined(TTGO_T_LORA32_V2_1_915) || defined(ESP32_DIY_LoRa_915) || defined(TTGO_T_Beam_V1_0_915) || defined(TTGO_T_Beam_V1_2_915) || defined(ESP32_DIY_LoRa_A7670_915) || defined(ESP32_DIY_1W_LoRa_915) #define OLED_SDA 21 #define OLED_SCL 22 #define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin) @@ -133,7 +146,7 @@ #define OLED_RST -1 #endif -#if !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) +#if !defined(HELTEC_HTCT62) && !defined(HELTEC_WSL_V3) && !defined(ESP32C3_DIY_1W_LoRa) && !defined(ESP32C3_DIY_1W_LoRa_915) #define HAS_DISPLAY #endif @@ -159,7 +172,7 @@ #define BOARD_I2C_SCL 42 #endif -#if defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_LoRa_915) || defined(ESP32_DIY_1W_LoRa) +#if defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_LoRa_915) || defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) #define INTERNAL_LED_PIN 2 #endif #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) @@ -176,7 +189,7 @@ #define BOARD_I2C_SCL 6 #endif -#ifdef ESP32_C3_DIY_LoRa +#ifdef ESP32_C3_DIY_LoRa // just testing! #define OLED_SDA 8 #define OLED_SCL 9 #define OLED_RST 10 @@ -188,18 +201,6 @@ #define RADIO_IRQ_PIN 2 #endif -#ifdef ESP32C3_DIY_1W_LoRa - #define RADIO_SCLK_PIN 8 - #define RADIO_MISO_PIN 9 - #define RADIO_MOSI_PIN 10 - #define RADIO_CS_PIN 5 - #define RADIO_RST_PIN 4 - #define RADIO_DIO1_PIN 2 - #define RADIO_BUSY_PIN 3 - #define RADIO_RXEN 6 - #define RADIO_TXEN 7 -#endif - /* (Same pins for LILYGO LoRa32 and ESP32 Wroom Dev ) SX1278-------------------> ESP32 ttgo-lora32-v21 and ESP32 WROOM Dev GND GND diff --git a/src/lora_utils.cpp b/src/lora_utils.cpp index 857cc20..e7edfcd 100644 --- a/src/lora_utils.cpp +++ b/src/lora_utils.cpp @@ -70,15 +70,15 @@ namespace LoRa_Utils { radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN); #endif - #if defined(ESP32_DIY_1W_LoRa) || defined(OE5HWN_MeshCom) || defined(ESP32C3_DIY_1W_LoRa) - state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 400M30S as it has Low Noise Amp + #ifdef HAS_1W_LORA // Ebyte E22 400M30S (SX1268) / 900M30S (SX1262) + state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 1W modules as they have Low Noise Amp radio.setCurrentLimit(140); // to be validated (100 , 120, 140)? #endif #if defined(HAS_SX1278) || defined(HAS_SX1276) state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 400M30S as it has Low Noise Amp radio.setCurrentLimit(100); // to be validated (80 , 100)? #endif - #if defined(HELTEC_V3) || defined(HELTEC_WSL_V3) || defined(HELTEC_WS) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) + #if (defined(HAS_SX1268) || defined(HAS_SX1262)) && !defined(HAS_1W_LORA) state = radio.setOutputPower(Config.loramodule.power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22. radio.setCurrentLimit(140); #endif diff --git a/src/utils.cpp b/src/utils.cpp index d928872..93e8710 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -175,7 +175,7 @@ namespace Utils { if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) { show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0); seventhLine = " listening..."; - #ifdef ESP32_DIY_LoRa_A7670 + #if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) A7670_Utils::uploadToAPRSIS(beaconPacket); #else APRS_IS_Utils::upload(beaconPacket);