diff --git a/platformio.ini b/platformio.ini index bb94358..a7f8507 100644 --- a/platformio.ini +++ b/platformio.ini @@ -177,6 +177,19 @@ lib_deps = adafruit/Adafruit GFX Library @ 1.11.9 adafruit/Adafruit SSD1306 @ 2.5.10 +[env:ESP32_DIY_1W_LoRa_LLCC68] +board = esp32dev +build_flags = + -Werror -Wall + -DESP32_DIY_1W_LoRa_LLCC68 + -DHAS_LLCC68 + -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:ESP32_DIY_1W_LoRa_Mesh_V1_2] board = esp32dev build_flags = diff --git a/src/boards_pinout.h b/src/boards_pinout.h index 28c4412..952f92a 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -28,7 +28,7 @@ #define RADIO_BUSY_PIN 13 // SX1262 BUSY #endif -#if defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) // Ebyte E22 400M30S (SX1268) or E22 900M30S (SX1262) +#if defined(ESP32_DIY_1W_LoRa) || defined(ESP32_DIY_1W_LoRa_915) || defined(ESP32_DIY_1W_LoRa_LLCC68) // Ebyte E22 400M30S (SX1268) or E22 900M30S (SX1262) or E220 LLCC68 #define RADIO_SCLK_PIN 18 #define RADIO_MISO_PIN 19 #define RADIO_MOSI_PIN 23 @@ -143,7 +143,7 @@ // 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) || defined(ESP32_DIY_1W_LoRa_915) || defined(ESP32_DIY_1W_LoRa_Mesh_V1_2) +#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) || defined(ESP32_DIY_1W_LoRa_LLCC68) || defined(ESP32_DIY_1W_LoRa_Mesh_V1_2) #define OLED_SDA 21 #define OLED_SCL 22 #define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin) diff --git a/src/lora_utils.cpp b/src/lora_utils.cpp index dec6e94..05f3ef0 100644 --- a/src/lora_utils.cpp +++ b/src/lora_utils.cpp @@ -18,18 +18,18 @@ bool transmitFlag = true; #ifdef HAS_SX1262 SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN); #endif - #ifdef HAS_SX1268 SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN); #endif - #ifdef HAS_SX1278 SX1278 radio = new Module(RADIO_CS_PIN, RADIO_BUSY_PIN, RADIO_RST_PIN); #endif - #ifdef HAS_SX1276 SX1276 radio = new Module(RADIO_CS_PIN, RADIO_BUSY_PIN, RADIO_RST_PIN); #endif +#if defined(HAS_LLCC68) //LLCC68 supports spreading factor only in range of 5-11! + LLCC68 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN); +#endif int rssi, freqError; float snr; @@ -53,7 +53,7 @@ namespace LoRa_Utils { Utils::println("Starting LoRa failed! State: " + String(state)); while (true); } - #if defined(HAS_SX1262) || defined(HAS_SX1268) + #if defined(HAS_SX1262) || defined(HAS_SX1268) || defined(HAS_LLCC68) if (!Config.lowPowerMode) { radio.setDio1Action(setFlag); } else { @@ -73,7 +73,7 @@ namespace LoRa_Utils { radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN); #endif - #ifdef HAS_1W_LORA // Ebyte E22 400M30S (SX1268) / 900M30S (SX1262) + #ifdef HAS_1W_LORA // Ebyte E22 400M30S (SX1268) / 900M30S (SX1262) / Ebyte E220 400M30S (LLCC68) 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 @@ -86,7 +86,7 @@ namespace LoRa_Utils { radio.setCurrentLimit(140); #endif - #if defined(HAS_SX1262) || defined(HAS_SX1268) + #if defined(HAS_SX1262) || defined(HAS_SX1268) || defined(HAS_LLCC68) radio.setRxBoostedGainMode(true); #endif