From 3d4a25b43c0bc29ee4dcbd327c8752a38843966e Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:30:34 +0200 Subject: [PATCH 1/5] Added more modes Added more modes, compatible to the old '300bps' mode but with different correction rates. --- lib/BG_RF95/BG_RF95.cpp | 7 +++++-- lib/BG_RF95/BG_RF95.h | 17 ++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/BG_RF95/BG_RF95.cpp b/lib/BG_RF95/BG_RF95.cpp index 67158e5..9a6ec9b 100644 --- a/lib/BG_RF95/BG_RF95.cpp +++ b/lib/BG_RF95/BG_RF95.cpp @@ -21,10 +21,13 @@ PROGMEM static const BG_RF95::ModemConfig MODEM_CONFIG_TABLE[] = { 0x72, 0x74, 0x00}, // Bw125Cr45Sf128 (the chip default) { 0x92, 0x74, 0x00}, // Bw500Cr45Sf128 { 0x48, 0x94, 0x00}, // Bw31_25Cr48Sf512 - { 0x78, 0xc4, 0x00}, // Bw125Cr48Sf4096 - { 0x72, 0xc7, 0x8}, // BG 125 cr45 sf12 + { 0x78, 0xc7, 0x08}, // Bw125Cr48Sf4096 + { 0x76, 0xc7, 0x08}, // Bw125Cr47Sf4096 + { 0x74, 0xc7, 0x08}, // Bw125Cr46Sf4096 + { 0x72, 0xc7, 0x08}, // Bw125Cr45Sf4096 { 0x72, 0xb4, 0x00}, // Bw125Cr45Sf2048 <= M0IGA messup speed { 0x76, 0x94, 0x04}, // Bw125Cr47Sf512 <= corrected 1200baud + { 0x78, 0xa4, 0x00}, // Bw125Cr48Sf1024 }; BG_RF95::BG_RF95(uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI& spi) diff --git a/lib/BG_RF95/BG_RF95.h b/lib/BG_RF95/BG_RF95.h index ce36c7b..8534dc6 100644 --- a/lib/BG_RF95/BG_RF95.h +++ b/lib/BG_RF95/BG_RF95.h @@ -542,13 +542,16 @@ public: /// you may need to change the RHReliableDatagram timeout for reliable operations. typedef enum { - Bw125Cr45Sf128 = 0, ///< Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Default medium range - Bw500Cr45Sf128, ///< Bw = 500 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Fast+short range - Bw31_25Cr48Sf512, ///< Bw = 31.25 kHz, Cr = 4/8, Sf = 512chips/symbol, CRC on. Slow+long range - Bw125Cr48Sf4096, ///< Bw = 125 kHz, Cr = 4/8, Sf = 4096chips/symbol, CRC on. Slow+long range - Bw125Cr45Sf4096, ///< APRS - Bw125Cr45Sf2048, ///< M0IGA Messup speed / 698baud (not 1200) - Bw125Cr47Sf512, ///< corrected 1200 baud + Bw125Cr45Sf128 = 0, ///< Bw = 125 kHz, Cr = 4:5, Sf = 128chips/symbol, CRC on. Default medium range + Bw500Cr45Sf128, ///< Bw = 500 kHz, Cr = 4:5, Sf = 128chips/symbol, CRC on. Fast+short range + Bw31_25Cr48Sf512, ///< Bw = 31.25 kHz, Cr = 4:8, Sf = 512chips/symbol, CRC on. Slow+long range + Bw125Cr48Sf4096, ///< Bw = 125 kHz, Cr = 4:8, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr47Sf4096, ///< Bw = 125 kHz, Cr = 4:7, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr46Sf4096, ///< Bw = 125 kHz, Cr = 4:6, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr45Sf4096, ///< APRS (BW 125 khz, Cr = 4:5, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr45Sf2048, ///< M0IGA Messup speed / 698baud (not 1200) + Bw125Cr47Sf512, ///< corrected 1200 baud + Bw125Cr48Sf1024, /// Bw 125, Cr = 4/8, Sf = 1024chips/symbol, CRC on } ModemConfigChoice; /// Constructor. You can have multiple instances, but each instance must have its own From bf4f5647012d34dc7f9ab903e81d5900d5897be1 Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:32:04 +0200 Subject: [PATCH 2/5] Added more modes Added more modes, compatible to the old '300bps' mode but with different correction rates. --- src/TTGO_T-Beam_LoRa_APRS.ino | 36 ++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 4ab4d03..fd327cf 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -56,8 +56,8 @@ const byte TXLED = 4; //pin number for LED on TX Tracker /* Original LORA32 V2.1 Setup #elif LORA32_21 - #define I2C_SDA 4 - #define I2C_SCL 15 + #define I2C_SDA 21 + #define I2C_SCL 22 #define BUTTON 2 //pin number for BUTTO #define BUZZER 13 // enter your buzzer pin gpio const byte TXLED = 4; //pin number for LED on TX Tracker @@ -384,7 +384,19 @@ void loraSend(byte lora_LTXPower, float lora_FREQ, const String &message) { if(lora_speed==1200){ rf95.setModemConfig(BG_RF95::Bw125Cr47Sf512); } - else{ + else if(lora_speed==610){ + rf95.setModemConfig(BG_RF95::Bw125Cr48Sf1024); + } + else if(lora_speed==180){ + rf95.setModemConfig(BG_RF95::Bw125Cr48Sf4096); + } + else if(lora_speed==210){ + rf95.setModemConfig(BG_RF95::Bw125Cr47Sf4096); + } + else if(lora_speed==240){ + rf95.setModemConfig(BG_RF95::Bw125Cr46Sf4096); + } + else { rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096); } rf95.setFrequency(lora_FREQ); @@ -927,10 +939,24 @@ void setup(){ batt_read(); writedisplaytext("LoRa-APRS","","Init:","ADC OK!","BAT: "+String(BattVolts,2),""); - if(lora_speed==1200) + if(lora_speed==1200){ rf95.setModemConfig(BG_RF95::Bw125Cr47Sf512); - else + } + else if(lora_speed==610){ + rf95.setModemConfig(BG_RF95::Bw125Cr48Sf1024); + } + else if(lora_speed==180){ + rf95.setModemConfig(BG_RF95::Bw125Cr48Sf4096); + } + else if(lora_speed==210){ + rf95.setModemConfig(BG_RF95::Bw125Cr47Sf4096); + } + else if(lora_speed==240){ + rf95.setModemConfig(BG_RF95::Bw125Cr46Sf4096); + } + else { rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096); + } Serial.printf("LoRa Speed:\t%d\n", lora_speed); From ffba4f2ac6af79da124a9fac9086a988d2ee951a Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:36:04 +0200 Subject: [PATCH 3/5] Added more modes Added more modes, compatible to the old '300bps' mode but with different correction rates. Renamed all modes --- data_embed/index.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data_embed/index.html b/data_embed/index.html index 3aca2eb..f93bbb4 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -58,10 +58,14 @@
- +
@@ -304,7 +308,7 @@ From 9ca6e6688091360d22ae85c8d3faf461405610b3 Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:39:34 +0200 Subject: [PATCH 4/5] Update index.html --- data_embed/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_embed/index.html b/data_embed/index.html index f93bbb4..8cda2f6 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -308,7 +308,7 @@ From 81ce66bd0d198aa99a0f46b37df2182df248408f Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:48:18 +0200 Subject: [PATCH 5/5] Update TTGO_T-Beam_LoRa_APRS.ino --- src/TTGO_T-Beam_LoRa_APRS.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index fd327cf..df5f6d6 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -56,8 +56,8 @@ const byte TXLED = 4; //pin number for LED on TX Tracker /* Original LORA32 V2.1 Setup #elif LORA32_21 - #define I2C_SDA 21 - #define I2C_SCL 22 + #define I2C_SDA 4 + #define I2C_SCL 15 #define BUTTON 2 //pin number for BUTTO #define BUZZER 13 // enter your buzzer pin gpio const byte TXLED = 4; //pin number for LED on TX Tracker