From 2c1bbf1ac6dcddba89b70764276fe94b91ee6b73 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 22 Oct 2022 15:42:21 -0500 Subject: [PATCH 1/3] When we init default, set use_preset to true (#1843) --- src/mesh/Channels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index 20018472..f7fc3592 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -79,7 +79,7 @@ void Channels::initDefaultChannel(ChannelIndex chIndex) Config_LoRaConfig &loraConfig = config.lora; loraConfig.modem_preset = Config_LoRaConfig_ModemPreset_LONG_FAST; // Default to Long Range & Fast - + loraConfig.use_preset = true; loraConfig.tx_power = 0; // default uint8_t defaultpskIndex = 1; channelSettings.psk.bytes[0] = defaultpskIndex; From 568434d0fa4556cad0472285f252d464a2d07453 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 22 Oct 2022 18:51:22 -0500 Subject: [PATCH 2/3] Use preset wiring (#1845) * When we init default, set use_preset to true * Only use modem_preset when we use_preset * When we init default, set use_preset to true (#1843) (#1844) --- src/mesh/RadioInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 07bb0110..81821ac1 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -361,7 +361,7 @@ void RadioInterface::applyModemConfig() // Set up default configuration // No Sync Words in LORA mode Config_LoRaConfig &loraConfig = config.lora; - if (loraConfig.spread_factor == 0) { + if (loraConfig.use_preset) { switch (loraConfig.modem_preset) { case Config_LoRaConfig_ModemPreset_SHORT_FAST: From 41267a42f77e3e863cc2eddbf93e2197bf652ab7 Mon Sep 17 00:00:00 2001 From: Mykhailo Lesyk Date: Sat, 22 Oct 2022 17:55:34 -0700 Subject: [PATCH 3/3] [rak4630] enable 3.3v periphery before scan for i2c devices (#1847) Co-authored-by: Ben Meadors --- src/main.cpp | 6 ++++++ variants/rak4631/variant.h | 5 ++++- variants/rak4631_epaper/variant.h | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 104731ef..d40a1bdf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -242,6 +242,12 @@ void setup() delay(1); #endif +#ifdef RAK4630 + // We need to enable 3.3V periphery in order to scan it + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, 1); +#endif + // We need to scan here to decide if we have a screen for nodeDB.init() scanI2Cdevice(); #ifdef RAK4630 diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 3648b851..b42163fb 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -185,6 +185,9 @@ static const uint8_t SCK = PIN_SPI_SCK; #define SX126X_RXEN (37) #define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +// enables 3.3V periphery like GPS or IO Module +#define PIN_3V3_EN (34) + // RAK1910 GPS module // If using the wisblock GPS module and pluged into Port A on WisBlock base // IO1 is hooked to PPS (pin 12 on header) = gpio 17 @@ -192,7 +195,7 @@ static const uint8_t SCK = PIN_SPI_SCK; // Therefore must be 1 to keep peripherals powered // Power is on the controllable 3V3_S rail // #define PIN_GPS_RESET (34) -#define PIN_GPS_EN (34) +#define PIN_GPS_EN PIN_3V3_EN #define PIN_GPS_PPS (17) // Pulse per second input from the GPS #define GPS_RX_PIN PIN_SERIAL1_RX diff --git a/variants/rak4631_epaper/variant.h b/variants/rak4631_epaper/variant.h index df68dac4..cf1b8b07 100644 --- a/variants/rak4631_epaper/variant.h +++ b/variants/rak4631_epaper/variant.h @@ -185,6 +185,9 @@ static const uint8_t SCK = PIN_SPI_SCK; #define SX126X_RXEN (37) #define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +// enables 3.3V periphery like GPS or IO Module +#define PIN_3V3_EN (34) + // RAK1910 GPS module // If using the wisblock GPS module and pluged into Port A on WisBlock base // IO1 is hooked to PPS (pin 12 on header) = gpio 17 @@ -192,7 +195,7 @@ static const uint8_t SCK = PIN_SPI_SCK; // Therefore must be 1 to keep peripherals powered // Power is on the controllable 3V3_S rail // #define PIN_GPS_RESET (34) -#define PIN_GPS_EN (34) +#define PIN_GPS_EN PIN_3V3_EN #define PIN_GPS_PPS (17) // Pulse per second input from the GPS #define GPS_RX_PIN PIN_SERIAL1_RX