From 68d7c178a5a34db2fa893289cab8689e26d72dca Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:10:18 +1000 Subject: [PATCH 01/14] Standardise RAK pin definitions --- variants/gat562_30s_mesh_kit/variant.h | 14 ++++----- variants/gat562_mesh_evb_pro/variant.h | 14 ++++----- variants/gat562_mesh_tracker_pro/variant.h | 14 ++++----- variants/gat562_mesh_watch13/variant.h | 14 ++++----- variants/rak3401/variant.h | 33 ++++++++++++++-------- variants/rak4631/variant.h | 12 ++++---- 6 files changed, 55 insertions(+), 46 deletions(-) diff --git a/variants/gat562_30s_mesh_kit/variant.h b/variants/gat562_30s_mesh_kit/variant.h index 5672572b5c..df3a649d9c 100644 --- a/variants/gat562_30s_mesh_kit/variant.h +++ b/variants/gat562_30s_mesh_kit/variant.h @@ -38,15 +38,15 @@ extern "C" { #endif // __cplusplus - /* +/* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B - static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B - static const uint8_t WB_IO3 = 21; // SLOT_C - static const uint8_t WB_IO4 = 4; // SLOT_C - static const uint8_t WB_IO5 = 9; // SLOT_D - static const uint8_t WB_IO6 = 10; // SLOT_D + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT static const uint8_t WB_A1 = 31; // IO_SLOT diff --git a/variants/gat562_mesh_evb_pro/variant.h b/variants/gat562_mesh_evb_pro/variant.h index b0e54a7941..a9074445be 100644 --- a/variants/gat562_mesh_evb_pro/variant.h +++ b/variants/gat562_mesh_evb_pro/variant.h @@ -38,15 +38,15 @@ extern "C" { #endif // __cplusplus - /* +/* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B - static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B - static const uint8_t WB_IO3 = 21; // SLOT_C - static const uint8_t WB_IO4 = 4; // SLOT_C - static const uint8_t WB_IO5 = 9; // SLOT_D - static const uint8_t WB_IO6 = 10; // SLOT_D + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT static const uint8_t WB_A1 = 31; // IO_SLOT diff --git a/variants/gat562_mesh_tracker_pro/variant.h b/variants/gat562_mesh_tracker_pro/variant.h index 0a28a2a455..1342b0fb6c 100644 --- a/variants/gat562_mesh_tracker_pro/variant.h +++ b/variants/gat562_mesh_tracker_pro/variant.h @@ -38,15 +38,15 @@ extern "C" { #endif // __cplusplus - /* +/* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B - static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B - static const uint8_t WB_IO3 = 21; // SLOT_C - static const uint8_t WB_IO4 = 4; // SLOT_C - static const uint8_t WB_IO5 = 9; // SLOT_D - static const uint8_t WB_IO6 = 10; // SLOT_D + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT static const uint8_t WB_A1 = 31; // IO_SLOT diff --git a/variants/gat562_mesh_watch13/variant.h b/variants/gat562_mesh_watch13/variant.h index f79c9970a5..679a6f24c1 100644 --- a/variants/gat562_mesh_watch13/variant.h +++ b/variants/gat562_mesh_watch13/variant.h @@ -38,15 +38,15 @@ extern "C" { #endif // __cplusplus - /* +/* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B - static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B - static const uint8_t WB_IO3 = 21; // SLOT_C - static const uint8_t WB_IO4 = 4; // SLOT_C - static const uint8_t WB_IO5 = 9; // SLOT_D - static const uint8_t WB_IO6 = 10; // SLOT_D + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT static const uint8_t WB_A1 = 31; // IO_SLOT diff --git a/variants/rak3401/variant.h b/variants/rak3401/variant.h index 9882788608..a1a0e92c07 100644 --- a/variants/rak3401/variant.h +++ b/variants/rak3401/variant.h @@ -38,6 +38,27 @@ extern "C" { #endif // __cplusplus +/* + * WisBlock Base GPIO definitions + */ + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 + static const uint8_t WB_SW1 = 33; // IO_SLOT + static const uint8_t WB_A0 = 5; // IO_SLOT + static const uint8_t WB_A1 = 31; // IO_SLOT + static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT + static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT + static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT + static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT + static const uint8_t WB_SPI_CS = 26; // IO_SLOT + static const uint8_t WB_SPI_CLK = 3; // IO_SLOT + static const uint8_t WB_SPI_MISO = 29; // IO_SLOT + static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT + // Number of pins defined in PinDescription array #define PINS_COUNT (48) #define NUM_DIGITAL_PINS (48) @@ -92,8 +113,6 @@ extern "C" #define PIN_AREF (2) #define PIN_NFC1 (9) -#define WB_IO5 PIN_NFC1 -#define WB_IO4 (4) #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -178,20 +197,10 @@ static const uint8_t AREF = PIN_AREF; // enables 3.3V periphery like GPS or IO Module // Do not toggle this for GPS power savings #define PIN_3V3_EN (34) -#define WB_IO2 PIN_3V3_EN - -// 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 -// IO2 is hooked to GPS RESET = gpio 34, but it can not be used to this because IO2 is ALSO used to control 3V3_S power (1 is on). -// Therefore must be 1 to keep peripherals powered -// Power is on the controllable 3V3_S rail -#define PIN_GPS_PPS (17) // Pulse per second input from the GPS #define PIN_GPS_RX PIN_SERIAL1_RX #define PIN_GPS_TX PIN_SERIAL1_TX -#define PIN_GPS_1PPS PIN_GPS_PPS #define GPS_BAUD_RATE 9600 #define GPS_ADDRESS 0x42 //i2c address for GPS diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 38cc88685c..8635bd598b 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -41,12 +41,12 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B - static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B - static const uint8_t WB_IO3 = 21; // SLOT_C - static const uint8_t WB_IO4 = 4; // SLOT_C - static const uint8_t WB_IO5 = 9; // SLOT_D - static const uint8_t WB_IO6 = 10; // SLOT_D + static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 + static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 + static const uint8_t WB_IO3 = 21; // SLOT_C P.12 + static const uint8_t WB_IO4 = 4; // SLOT_C P.10 + static const uint8_t WB_IO5 = 9; // SLOT_D P.12 + static const uint8_t WB_IO6 = 10; // SLOT_D P.10 static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT static const uint8_t WB_A1 = 31; // IO_SLOT From fe51961487f823818ea5ce1a7ff32132c17033d4 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:11:25 +1000 Subject: [PATCH 02/14] Remove unused 1PPS pin definition This was only configured for a single Sensor Slot anyway --- variants/rak4631/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 8635bd598b..50c1c5c7d6 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -182,7 +182,7 @@ extern "C" #define EXTERNAL_FLASH_DEVICES IS25LP080D #define EXTERNAL_FLASH_USE_QSPI -#define PIN_GPS_1PPS 17 //GPS PPS pin +#define PIN_GPS_RX PIN_SERIAL1_RX #define GPS_BAUD_RATE 9600 #define GPS_ADDRESS 0x42 //i2c address for GPS From dc669e0d97197a8ce25b408e1700c3d874e997a8 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:12:17 +1000 Subject: [PATCH 03/14] Move GPS pin definition to be with other pin definitions --- variants/rak4631/platformio.ini | 2 -- variants/rak4631/variant.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 0dfbf79775..4e37fcfda2 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -12,8 +12,6 @@ build_flags = ${nrf52_base.build_flags} -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 - -D PIN_GPS_TX=PIN_SERIAL1_RX - -D PIN_GPS_RX=PIN_SERIAL1_TX -D PIN_GPS_EN=-1 -D PIN_OLED_RESET=-1 -D USE_SX1262 diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 50c1c5c7d6..575d260ae1 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -183,6 +183,8 @@ extern "C" #define EXTERNAL_FLASH_USE_QSPI #define PIN_GPS_RX PIN_SERIAL1_RX +#define PIN_GPS_TX PIN_SERIAL1_TX + #define GPS_BAUD_RATE 9600 #define GPS_ADDRESS 0x42 //i2c address for GPS From 0f69b7ae9cf76105b22688e87e9da82558fc4ac5 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:13:33 +1000 Subject: [PATCH 04/14] Enable GPS support for RAK4631 & derivatives These boards support the RAK12500 and RAK12501 GPS modules. --- variants/rak4631/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 4e37fcfda2..ebb9aeb999 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -9,6 +9,7 @@ build_flags = ${nrf52_base.build_flags} -I variants/rak4631 -D RAK_4631 -D RAK_BOARD + -UENV_INCLUDE_GPS -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 From 618fb0c011a15d14548f1bec300a4cece1330402 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:14:44 +1000 Subject: [PATCH 05/14] Enable RAK-flavoured sensor support for RAK3401 This board is a RAK4631 derivative (even sharing the same bootloader) and so supports the same features --- variants/rak3401/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/rak3401/platformio.ini b/variants/rak3401/platformio.ini index 48e7192266..c285e3ec50 100644 --- a/variants/rak3401/platformio.ini +++ b/variants/rak3401/platformio.ini @@ -6,6 +6,7 @@ build_flags = ${nrf52_base.build_flags} ${sensor_base.build_flags} -I variants/rak3401 -D RAK_3401 + -D RAK_BOARD -D NRF52_POWER_MANAGEMENT -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper From f161449fe6be353a41f4f8eaccc21aa9e2101ae6 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Tue, 28 Jul 2026 23:16:41 +1000 Subject: [PATCH 06/14] Fix transposed UART RX/TX pins for RAK boards This seems to have just been a typo. Fixing this allows RAK12500 to work in serial mode, and RAK12501 to work at all. (Both tested on RAK3401) --- src/helpers/sensors/EnvironmentSensorManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index e2f0d33e72..b95d48d865 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -775,8 +775,7 @@ void EnvironmentSensorManager::initBasicGPS() { // or make a new location provider ... #ifdef RAK_WISBLOCK_GPS void EnvironmentSensorManager::rakGPSInit(){ - - Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); + Serial1.setPins(PIN_GPS_RX, PIN_GPS_TX); #ifdef GPS_BAUD_RATE Serial1.begin(GPS_BAUD_RATE); From 44d17f0a97dfd2e673226bdab405cc95021ef00e Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Fri, 31 Jul 2026 22:50:15 +1000 Subject: [PATCH 07/14] Replace RAK GPS attempted reset pin control with 3V3_EN control The previous code only worked by accident. 1. Regardless of which slot the GPS module was present in, it would always be detected as Slot A 2. Slot A reset pin (WB_IO2) overlaps with PIN_3V3_EN. 3. Per u-blox ZOE-M8Q documentation: "In reset state, the SiP consumes a significant amount of current. It is therefore recommended to use RESET_N only as a reset signal and not as an enable/disable." So using reset PIN to control GPS status is not desirable anyway. This commit replaces the faulty reset pin detection and control logic by instead just controlling the 3V3 bus. Note: 3V3 control is disabled on the RAK3401 as this board is most commonly used in the "1W LoRa Booster Kit", and turning 3V3 off would also disable 5V power supply to the SKY66122 PA. Changes tested with RAK3401 with a RAK12500 in both Slot A and Slot C, as well as a RAK12501 in Slot A. --- .../sensors/EnvironmentSensorManager.cpp | 66 +++++++------------ .../sensors/EnvironmentSensorManager.h | 2 +- variants/rak3401/variant.h | 5 +- 3 files changed, 27 insertions(+), 46 deletions(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index b95d48d865..b6a270ca8b 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -165,16 +165,15 @@ static RAK12035_SoilMoisture RAK12035; #endif #ifdef RAK_WISBLOCK_GPS -static uint32_t gpsResetPin = 0; static bool i2cGPSFlag = false; static bool serialGPSFlag = false; #ifndef TELEM_RAK12500_ADDRESS -#define TELEM_RAK12500_ADDRESS 0x42 //RAK12500 Ublox GPS via i2c +#define TELEM_RAK12500_ADDRESS 0x42 // RAK12500 u-blox ZOE-M8Q GPS via i2c #endif #include -static SFE_UBLOX_GNSS ublox_GNSS; +static SFE_UBLOX_GNSS ublox_GNSS; // RAK12500 u-blox ZOE-M8Q GPS via UART -class RAK12500LocationProvider : public LocationProvider { +class RAKI2CLocationProvider : public LocationProvider { long _lat = 0; long _lng = 0; long _alt = 0; @@ -207,7 +206,7 @@ class RAK12500LocationProvider : public LocationProvider { bool isEnabled() override { return true; } }; -static RAK12500LocationProvider RAK12500_provider; +static RAKI2CLocationProvider RAK12500_provider; #endif // ============================================================ @@ -783,14 +782,14 @@ void EnvironmentSensorManager::rakGPSInit(){ Serial1.begin(9600); #endif - //search for the correct IO standby pin depending on socket used - if(gpsIsAwake(WB_IO2)){ - } - else if(gpsIsAwake(WB_IO4)){ - } - else if(gpsIsAwake(WB_IO5)){ - } - else{ + #ifdef PIN_3V3_EN + digitalWrite(PIN_3V3_EN,LOW); + delay(1000); + digitalWrite(PIN_3V3_EN,HIGH); + delay(2000); + #endif + + if(!gpsIsAwake()){ MESH_DEBUG_PRINTLN("No GPS found"); gps_active = false; gps_detected = false; @@ -804,25 +803,10 @@ void EnvironmentSensorManager::rakGPSInit(){ #endif } -bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){ - - #if defined(ETHERNET_ENABLED) && defined(RAK_BOARD) - if (ioPin == WB_IO2) { - // WB_IO2 powers the Ethernet module on RAK baseboards. - return false; - } - #endif - - //set initial waking state - pinMode(ioPin,OUTPUT); - digitalWrite(ioPin,LOW); - delay(500); - digitalWrite(ioPin,HIGH); - delay(500); - +bool EnvironmentSensorManager::gpsIsAwake(){ //Try to init RAK12500 on I2C if (ublox_GNSS.begin(Wire) == true){ - MESH_DEBUG_PRINTLN("RAK12500 GPS init correctly with pin %i",ioPin); + MESH_DEBUG_PRINTLN("RAK12500 I2C GPS init"); ublox_GNSS.setI2COutput(COM_TYPE_UBX); ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GALILEO); @@ -833,7 +817,6 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){ ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_QZSS); ublox_GNSS.setMeasurementRate(1000); ublox_GNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); - gpsResetPin = ioPin; i2cGPSFlag = true; gps_active = true; gps_detected = true; @@ -841,20 +824,13 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){ _location = &RAK12500_provider; return true; } else if (Serial1.available()) { - MESH_DEBUG_PRINTLN("Serial GPS init correctly and is turned on"); -#ifdef PIN_GPS_EN - if(PIN_GPS_EN){ - gpsResetPin = PIN_GPS_EN; - } -#endif + MESH_DEBUG_PRINTLN("Serial GPS init correctly"); serialGPSFlag = true; gps_active = true; gps_detected = true; return true; } - pinMode(ioPin, INPUT); - MESH_DEBUG_PRINTLN("GPS did not init with this IO pin... try the next"); return false; } #endif @@ -862,8 +838,8 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){ void EnvironmentSensorManager::start_gps() { gps_active = true; #ifdef RAK_WISBLOCK_GPS - pinMode(gpsResetPin, OUTPUT); - digitalWrite(gpsResetPin, HIGH); + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); return; #endif @@ -878,8 +854,12 @@ void EnvironmentSensorManager::start_gps() { void EnvironmentSensorManager::stop_gps() { gps_active = false; #ifdef RAK_WISBLOCK_GPS - pinMode(gpsResetPin, OUTPUT); - digitalWrite(gpsResetPin, LOW); + #ifdef SKY66122 + MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable SKY66122."); + return; + #endif + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, LOW); return; #endif diff --git a/src/helpers/sensors/EnvironmentSensorManager.h b/src/helpers/sensors/EnvironmentSensorManager.h index 29147c8967..be1195dce3 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.h +++ b/src/helpers/sensors/EnvironmentSensorManager.h @@ -30,7 +30,7 @@ class EnvironmentSensorManager : public SensorManager { void initBasicGPS(); #ifdef RAK_BOARD void rakGPSInit(); - bool gpsIsAwake(uint8_t ioPin); + bool gpsIsAwake(); #endif #endif diff --git a/variants/rak3401/variant.h b/variants/rak3401/variant.h index a1a0e92c07..5f49695c9f 100644 --- a/variants/rak3401/variant.h +++ b/variants/rak3401/variant.h @@ -181,6 +181,7 @@ static const uint8_t AREF = PIN_AREF; // in hardware via SetDIO2AsRfSwitchCtrl (microsecond-accurate, no GPIO needed). // The 5V boost for the PA is enabled by WB_IO2 (P0.34 = PIN_3V3_EN). #define SX126X_POWER_EN (21) // P0.21 = IO3 -> SKY66122 CSD+CPS (FEM enable) +#define SKY66122 // CTX is driven by SX1262 DIO2, not a GPIO #define SX126X_DIO2_AS_RF_SWITCH @@ -194,8 +195,8 @@ static const uint8_t AREF = PIN_AREF; #define P_LORA_BUSY SX126X_BUSY #define P_LORA_RESET SX126X_RESET -// enables 3.3V periphery like GPS or IO Module -// Do not toggle this for GPS power savings +// enables 3.3V periphery like GPS, the IO Module, and the SKY66122 5V boost +// Do NOT use this for GPS power savings as this will interfere with LoRa functionality #define PIN_3V3_EN (34) #define PIN_GPS_RX PIN_SERIAL1_RX From 02c7fe81319678baee125f5f764c6a75e26cd4f1 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Fri, 31 Jul 2026 22:55:35 +1000 Subject: [PATCH 08/14] Prevent disabling PIN_3V3_EN if Ethernet is enabled This check was originally implemented in 3e9ceba24a65a6f13409b48614909237e737f5aa, but after refactoring needed to be re-added. --- src/helpers/sensors/EnvironmentSensorManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index b6a270ca8b..b19c5aa7bf 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -854,6 +854,10 @@ void EnvironmentSensorManager::start_gps() { void EnvironmentSensorManager::stop_gps() { gps_active = false; #ifdef RAK_WISBLOCK_GPS + #ifdef ETHERNET_ENABLED + MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable Ethernet."); + return; + #endif #ifdef SKY66122 MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable SKY66122."); return; From 30184c98c770295d239b66d0e74f9bdde89002ef Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Fri, 31 Jul 2026 22:58:14 +1000 Subject: [PATCH 09/14] Re-transpose GPS UART RX/TX pins to match convention I don't really know why this is done, but it's consistent with how other boards are handled so I've restored it for the RAK4631. (And fixed it for the RAK3401) --- src/helpers/sensors/EnvironmentSensorManager.cpp | 2 +- variants/rak3401/variant.h | 4 ++-- variants/rak4631/variant.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index b19c5aa7bf..5ff32f91e5 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -774,7 +774,7 @@ void EnvironmentSensorManager::initBasicGPS() { // or make a new location provider ... #ifdef RAK_WISBLOCK_GPS void EnvironmentSensorManager::rakGPSInit(){ - Serial1.setPins(PIN_GPS_RX, PIN_GPS_TX); + Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); #ifdef GPS_BAUD_RATE Serial1.begin(GPS_BAUD_RATE); diff --git a/variants/rak3401/variant.h b/variants/rak3401/variant.h index 5f49695c9f..9f9e907a4b 100644 --- a/variants/rak3401/variant.h +++ b/variants/rak3401/variant.h @@ -199,8 +199,8 @@ static const uint8_t AREF = PIN_AREF; // Do NOT use this for GPS power savings as this will interfere with LoRa functionality #define PIN_3V3_EN (34) -#define PIN_GPS_RX PIN_SERIAL1_RX -#define PIN_GPS_TX PIN_SERIAL1_TX +#define PIN_GPS_TX PIN_SERIAL1_RX +#define PIN_GPS_RX PIN_SERIAL1_TX #define GPS_BAUD_RATE 9600 #define GPS_ADDRESS 0x42 //i2c address for GPS diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 575d260ae1..a747a6b4ff 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -182,8 +182,8 @@ extern "C" #define EXTERNAL_FLASH_DEVICES IS25LP080D #define EXTERNAL_FLASH_USE_QSPI -#define PIN_GPS_RX PIN_SERIAL1_RX -#define PIN_GPS_TX PIN_SERIAL1_TX +#define PIN_GPS_TX PIN_SERIAL1_RX +#define PIN_GPS_RX PIN_SERIAL1_TX #define GPS_BAUD_RATE 9600 #define GPS_ADDRESS 0x42 //i2c address for GPS From aa3269a94edceb5c7668ec4dc6b0fcdbede2ef1f Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Sat, 1 Aug 2026 21:52:54 +1000 Subject: [PATCH 10/14] Fix accidentally disabling GPS for RAK4631 I'm not quite sure how I messed this up, I think I must've got -D and -U mixed up. Anyway this is enabled in sensor_base so we don't actually have to enable it here. --- variants/rak4631/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index ebb9aeb999..4e37fcfda2 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${nrf52_base.build_flags} -I variants/rak4631 -D RAK_4631 -D RAK_BOARD - -UENV_INCLUDE_GPS -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 From adce724b54edf266448c9f7772d6fc8c606108d0 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Sun, 2 Aug 2026 02:52:50 +1000 Subject: [PATCH 11/14] Standardise pin definitions across RAK boards --- variants/gat562_30s_mesh_kit/variant.h | 57 ++++++++++++++-------- variants/gat562_mesh_evb_pro/variant.h | 55 +++++++++++++-------- variants/gat562_mesh_tracker_pro/variant.h | 55 +++++++++++++-------- variants/gat562_mesh_watch13/variant.h | 55 ++++++++++++++------- variants/rak3401/variant.h | 57 ++++++++++++++-------- variants/rak4631/variant.h | 57 +++++++++++++++------- 6 files changed, 224 insertions(+), 112 deletions(-) diff --git a/variants/gat562_30s_mesh_kit/variant.h b/variants/gat562_30s_mesh_kit/variant.h index df3a649d9c..e8c09fb0c0 100644 --- a/variants/gat562_30s_mesh_kit/variant.h +++ b/variants/gat562_30s_mesh_kit/variant.h @@ -41,23 +41,41 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -144,6 +162,9 @@ extern "C" static const uint8_t AREF = PIN_AREF; +// enables 3.3V periphery like GPS sensors and Ethernet modules +#define PIN_3V3_EN PIN_WB_IO2 + /* * Serial interfaces */ @@ -216,8 +237,6 @@ extern "C" #define GPS_THREAD_INTERVAL 50 #define PIN_GPS_TX PIN_SERIAL1_RX #define PIN_GPS_RX PIN_SERIAL1_TX -#define PIN_GPS_EN (33) -#define PIN_GPS_PPS (17) #ifdef __cplusplus } diff --git a/variants/gat562_mesh_evb_pro/variant.h b/variants/gat562_mesh_evb_pro/variant.h index a9074445be..dd4e1f5cd1 100644 --- a/variants/gat562_mesh_evb_pro/variant.h +++ b/variants/gat562_mesh_evb_pro/variant.h @@ -41,23 +41,41 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -202,8 +220,7 @@ extern "C" #define GPS_THREAD_INTERVAL 50 #define PIN_GPS_TX PIN_SERIAL1_RX #define PIN_GPS_RX PIN_SERIAL1_TX -#define PIN_GPS_EN (33) -#define PIN_GPS_PPS (17) +#define PIN_GPS_EN PIN_WB_IO2 #ifdef __cplusplus } diff --git a/variants/gat562_mesh_tracker_pro/variant.h b/variants/gat562_mesh_tracker_pro/variant.h index 1342b0fb6c..45f116a607 100644 --- a/variants/gat562_mesh_tracker_pro/variant.h +++ b/variants/gat562_mesh_tracker_pro/variant.h @@ -41,23 +41,41 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -212,8 +230,7 @@ extern "C" #define GPS_THREAD_INTERVAL 50 #define PIN_GPS_TX PIN_SERIAL1_RX #define PIN_GPS_RX PIN_SERIAL1_TX -#define PIN_GPS_EN (33) -#define PIN_GPS_PPS (17) +#define PIN_GPS_EN PIN_WB_IO2 #ifdef __cplusplus } diff --git a/variants/gat562_mesh_watch13/variant.h b/variants/gat562_mesh_watch13/variant.h index 679a6f24c1..463086efd5 100644 --- a/variants/gat562_mesh_watch13/variant.h +++ b/variants/gat562_mesh_watch13/variant.h @@ -41,23 +41,41 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -125,6 +143,9 @@ extern "C" static const uint8_t AREF = PIN_AREF; +// enables 3.3V periphery like GPS sensors and Ethernet modules +#define PIN_3V3_EN PIN_WB_IO2 + /* * Serial interfaces */ diff --git a/variants/rak3401/variant.h b/variants/rak3401/variant.h index 9f9e907a4b..0fa8d4253d 100644 --- a/variants/rak3401/variant.h +++ b/variants/rak3401/variant.h @@ -41,23 +41,41 @@ extern "C" /* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -195,9 +213,8 @@ static const uint8_t AREF = PIN_AREF; #define P_LORA_BUSY SX126X_BUSY #define P_LORA_RESET SX126X_RESET -// enables 3.3V periphery like GPS, the IO Module, and the SKY66122 5V boost -// Do NOT use this for GPS power savings as this will interfere with LoRa functionality -#define PIN_3V3_EN (34) +// enables 3.3V periphery like GPS, the IO module, Ethernet module, and the SKY66122 5V boost +#define PIN_3V3_EN PIN_WB_IO2 #define PIN_GPS_TX PIN_SERIAL1_RX #define PIN_GPS_RX PIN_SERIAL1_TX diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index a747a6b4ff..055ea96754 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -38,26 +38,44 @@ extern "C" { #endif // __cplusplus - /* +/* * WisBlock Base GPIO definitions */ - static const uint8_t WB_IO1 = 17; // SLOT_A P.12 / SLOT_B P.10 - static const uint8_t WB_IO2 = 34; // SLOT_A P.10 / SLOT_B P.12 - static const uint8_t WB_IO3 = 21; // SLOT_C P.12 - static const uint8_t WB_IO4 = 4; // SLOT_C P.10 - static const uint8_t WB_IO5 = 9; // SLOT_D P.12 - static const uint8_t WB_IO6 = 10; // SLOT_D P.10 - static const uint8_t WB_SW1 = 33; // IO_SLOT - static const uint8_t WB_A0 = 5; // IO_SLOT - static const uint8_t WB_A1 = 31; // IO_SLOT - static const uint8_t WB_I2C1_SDA = 13; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C1_SCL = 14; // SENSOR_SLOT IO_SLOT - static const uint8_t WB_I2C2_SDA = 24; // IO_SLOT - static const uint8_t WB_I2C2_SCL = 25; // IO_SLOT - static const uint8_t WB_SPI_CS = 26; // IO_SLOT - static const uint8_t WB_SPI_CLK = 3; // IO_SLOT - static const uint8_t WB_SPI_MISO = 29; // IO_SLOT - static const uint8_t WB_SPI_MOSI = 30; // IO_SLOT +#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21); // SLOT_C P.12 +#define PIN_WB_IO4 (4); // SLOT_C P.10 +#define PIN_WB_IO5 (9); // SLOT_D P.12 +#define PIN_WB_IO6 (10); // SLOT_D P.10 +#define PIN_WB_SW1 (33); // IO_SLOT +#define PIN_WB_A0 (5); // IO_SLOT +#define PIN_WB_A1 (31); // IO_SLOT +#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24); // IO_SLOT +#define PIN_WB_I2C2_SCL (25); // IO_SLOT +#define PIN_WB_SPI_CS (26); // IO_SLOT +#define PIN_WB_SPI_CLK (3); // IO_SLOT +#define PIN_WB_SPI_MISO (29); // IO_SLOT +#define PIN_WB_SPI_MOSI (30); // IO_SLOT + + static const uint8_t WB_IO1 = PIN_WB_IO1; + static const uint8_t WB_IO2 = PIN_WB_IO2; + static const uint8_t WB_IO3 = PIN_WB_IO3; + static const uint8_t WB_IO4 = PIN_WB_IO4; + static const uint8_t WB_IO5 = PIN_WB_IO5; + static const uint8_t WB_IO6 = PIN_WB_IO6; + static const uint8_t WB_SW1 = PIN_WB_SW1; + static const uint8_t WB_A0 = PIN_WB_A0; + static const uint8_t WB_A1 = PIN_WB_A1; + static const uint8_t WB_I2C1_SDA = PIN_WB_I2C1_SDA; + static const uint8_t WB_I2C1_SCL = PIN_WB_I2C1_SCL; + static const uint8_t WB_I2C2_SDA = PIN_WB_I2C2_SDA; + static const uint8_t WB_I2C2_SCL = PIN_WB_I2C2_SCL; + static const uint8_t WB_SPI_CS = PIN_WB_SPI_CS; + static const uint8_t WB_SPI_CLK = PIN_WB_SPI_CLK; + static const uint8_t WB_SPI_MISO = PIN_WB_SPI_MISO; + static const uint8_t WB_SPI_MOSI = PIN_WB_SPI_MOSI; // Number of pins defined in PinDescription array #define PINS_COUNT (48) @@ -182,6 +200,9 @@ extern "C" #define EXTERNAL_FLASH_DEVICES IS25LP080D #define EXTERNAL_FLASH_USE_QSPI +// enables 3.3V periphery like GPS sensors and Ethernet modules +#define PIN_3V3_EN PIN_WB_IO2 + #define PIN_GPS_TX PIN_SERIAL1_RX #define PIN_GPS_RX PIN_SERIAL1_TX From 779a25a415c32cf26f13617514e9424320e5f5d5 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Mon, 3 Aug 2026 06:33:39 +1000 Subject: [PATCH 12/14] Fix syntax errors in header files I'm new to C++ so I didn't notice this --- variants/gat562_30s_mesh_kit/variant.h | 34 +++++++++++----------- variants/gat562_mesh_evb_pro/variant.h | 34 +++++++++++----------- variants/gat562_mesh_tracker_pro/variant.h | 34 +++++++++++----------- variants/gat562_mesh_watch13/variant.h | 34 +++++++++++----------- variants/rak3401/variant.h | 34 +++++++++++----------- variants/rak4631/variant.h | 34 +++++++++++----------- 6 files changed, 102 insertions(+), 102 deletions(-) diff --git a/variants/gat562_30s_mesh_kit/variant.h b/variants/gat562_30s_mesh_kit/variant.h index e8c09fb0c0..4cbb6a9bdd 100644 --- a/variants/gat562_30s_mesh_kit/variant.h +++ b/variants/gat562_30s_mesh_kit/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; diff --git a/variants/gat562_mesh_evb_pro/variant.h b/variants/gat562_mesh_evb_pro/variant.h index dd4e1f5cd1..06bb062a91 100644 --- a/variants/gat562_mesh_evb_pro/variant.h +++ b/variants/gat562_mesh_evb_pro/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; diff --git a/variants/gat562_mesh_tracker_pro/variant.h b/variants/gat562_mesh_tracker_pro/variant.h index 45f116a607..42fa799679 100644 --- a/variants/gat562_mesh_tracker_pro/variant.h +++ b/variants/gat562_mesh_tracker_pro/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; diff --git a/variants/gat562_mesh_watch13/variant.h b/variants/gat562_mesh_watch13/variant.h index 463086efd5..5731329c1a 100644 --- a/variants/gat562_mesh_watch13/variant.h +++ b/variants/gat562_mesh_watch13/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; diff --git a/variants/rak3401/variant.h b/variants/rak3401/variant.h index 0fa8d4253d..33d8e54cad 100644 --- a/variants/rak3401/variant.h +++ b/variants/rak3401/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 055ea96754..22eeced3a9 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -41,23 +41,23 @@ extern "C" /* * WisBlock Base GPIO definitions */ -#define PIN_WB_IO1 (17); // SLOT_A P.12 / SLOT_B P.10 -#define PIN_WB_IO2 (34); // SLOT_A P.10 / SLOT_B P.12 -#define PIN_WB_IO3 (21); // SLOT_C P.12 -#define PIN_WB_IO4 (4); // SLOT_C P.10 -#define PIN_WB_IO5 (9); // SLOT_D P.12 -#define PIN_WB_IO6 (10); // SLOT_D P.10 -#define PIN_WB_SW1 (33); // IO_SLOT -#define PIN_WB_A0 (5); // IO_SLOT -#define PIN_WB_A1 (31); // IO_SLOT -#define PIN_WB_I2C1_SDA (13); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C1_SCL (14); // SENSOR_SLOT IO_SLOT -#define PIN_WB_I2C2_SDA (24); // IO_SLOT -#define PIN_WB_I2C2_SCL (25); // IO_SLOT -#define PIN_WB_SPI_CS (26); // IO_SLOT -#define PIN_WB_SPI_CLK (3); // IO_SLOT -#define PIN_WB_SPI_MISO (29); // IO_SLOT -#define PIN_WB_SPI_MOSI (30); // IO_SLOT +#define PIN_WB_IO1 (17) // SLOT_A P.12 / SLOT_B P.10 +#define PIN_WB_IO2 (34) // SLOT_A P.10 / SLOT_B P.12 +#define PIN_WB_IO3 (21) // SLOT_C P.12 +#define PIN_WB_IO4 (4) // SLOT_C P.10 +#define PIN_WB_IO5 (9) // SLOT_D P.12 +#define PIN_WB_IO6 (10) // SLOT_D P.10 +#define PIN_WB_SW1 (33) // IO_SLOT +#define PIN_WB_A0 (5) // IO_SLOT +#define PIN_WB_A1 (31) // IO_SLOT +#define PIN_WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define PIN_WB_I2C2_SDA (24) // IO_SLOT +#define PIN_WB_I2C2_SCL (25) // IO_SLOT +#define PIN_WB_SPI_CS (26) // IO_SLOT +#define PIN_WB_SPI_CLK (3) // IO_SLOT +#define PIN_WB_SPI_MISO (29) // IO_SLOT +#define PIN_WB_SPI_MOSI (30) // IO_SLOT static const uint8_t WB_IO1 = PIN_WB_IO1; static const uint8_t WB_IO2 = PIN_WB_IO2; From 2f013367477d838b9633ee46bf560cb3c91fea31 Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Mon, 3 Aug 2026 06:29:19 +1000 Subject: [PATCH 13/14] Add basic GPS optimisations - Add `configure` method to LocationProvider, which is called once after GPS init - ublox I2C GPS - enable AssistNow Autonomous feature for faster positioning - UART L76K GPS - Enable use of GLONASS constellation --- .../sensors/EnvironmentSensorManager.cpp | 81 ++++++++++--------- src/helpers/sensors/LocationProvider.h | 1 + .../sensors/MicroNMEALocationProvider.h | 8 ++ 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index 5ff32f91e5..42f395e630 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -173,7 +173,7 @@ static bool serialGPSFlag = false; #include static SFE_UBLOX_GNSS ublox_GNSS; // RAK12500 u-blox ZOE-M8Q GPS via UART -class RAKI2CLocationProvider : public LocationProvider { +class UbloxLocationProvider : public LocationProvider { long _lat = 0; long _lng = 0; long _alt = 0; @@ -189,8 +189,38 @@ class RAKI2CLocationProvider : public LocationProvider { long getTimestamp() override { return _epoch; } void sendSentence(const char * sentence) override { } void reset() override { } - void begin() override { } - void stop() override { } + void configure() override { + ublox_GNSS.setI2COutput(COM_TYPE_UBX); // Disable NMEA output (the ublox library can use the more efficient proprietary UBX protocol) + // Configure constellations + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GALILEO); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GLONASS); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_SBAS); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_BEIDOU); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_IMES); + ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_QZSS); + + ublox_GNSS.setAopCfg(1); // Enable AssistNow Autonomous for faster positioning + ublox_GNSS.setMeasurementRate(1000); // Take one measurement per second + ublox_GNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); + } + void begin() override { + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); + } + void stop() override { + #ifdef ETHERNET_ENABLED + MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable Ethernet."); + return; + #endif + #ifdef SKY66122 + MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable SKY66122."); + return; + #endif + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, LOW); + return; + } void loop() override { if (ublox_GNSS.getGnssFixOk(8)) { _fix = true; @@ -206,7 +236,7 @@ class RAKI2CLocationProvider : public LocationProvider { bool isEnabled() override { return true; } }; -static RAKI2CLocationProvider RAK12500_provider; +static UbloxLocationProvider Ublox_provider; #endif // ============================================================ @@ -759,6 +789,7 @@ void EnvironmentSensorManager::initBasicGPS() { if (gps_detected) { MESH_DEBUG_PRINTLN("GPS detected"); + _location->configure(); #ifdef PERSISTANT_GPS gps_active = true; return; @@ -807,27 +838,23 @@ bool EnvironmentSensorManager::gpsIsAwake(){ //Try to init RAK12500 on I2C if (ublox_GNSS.begin(Wire) == true){ MESH_DEBUG_PRINTLN("RAK12500 I2C GPS init"); - ublox_GNSS.setI2COutput(COM_TYPE_UBX); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GALILEO); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GLONASS); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_SBAS); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_BEIDOU); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_IMES); - ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_QZSS); - ublox_GNSS.setMeasurementRate(1000); - ublox_GNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); i2cGPSFlag = true; gps_active = true; gps_detected = true; - _location = &RAK12500_provider; + _location = &Ublox_provider; + + _location->begin(); + _location->configure(); + return true; } else if (Serial1.available()) { MESH_DEBUG_PRINTLN("Serial GPS init correctly"); serialGPSFlag = true; gps_active = true; gps_detected = true; + + _location->configure(); return true; } @@ -837,39 +864,21 @@ bool EnvironmentSensorManager::gpsIsAwake(){ void EnvironmentSensorManager::start_gps() { gps_active = true; - #ifdef RAK_WISBLOCK_GPS - pinMode(PIN_3V3_EN, OUTPUT); - digitalWrite(PIN_3V3_EN, HIGH); - return; - #endif _location->begin(); _location->reset(); -#ifndef PIN_GPS_EN + #if !defined(PIN_GPS_EN) && !defined(RAK_WISBLOCK_GPS) MESH_DEBUG_PRINTLN("Start GPS is N/A on this board. Actual GPS state unchanged"); -#endif + #endif } void EnvironmentSensorManager::stop_gps() { gps_active = false; - #ifdef RAK_WISBLOCK_GPS - #ifdef ETHERNET_ENABLED - MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable Ethernet."); - return; - #endif - #ifdef SKY66122 - MESH_DEBUG_PRINTLN("GPS cannot be disabled as this would also disable SKY66122."); - return; - #endif - pinMode(PIN_3V3_EN, OUTPUT); - digitalWrite(PIN_3V3_EN, LOW); - return; - #endif _location->stop(); - #ifndef PIN_GPS_EN + #if !defined(PIN_GPS_EN) && !defined(RAK_WISBLOCK_GPS) MESH_DEBUG_PRINTLN("Stop GPS is N/A on this board. Actual GPS state unchanged"); #endif } diff --git a/src/helpers/sensors/LocationProvider.h b/src/helpers/sensors/LocationProvider.h index 81d08652ed..4e3a95cd9c 100644 --- a/src/helpers/sensors/LocationProvider.h +++ b/src/helpers/sensors/LocationProvider.h @@ -18,6 +18,7 @@ class LocationProvider { virtual long getTimestamp() = 0; virtual void sendSentence(const char * sentence); virtual void reset() = 0; + virtual void configure() = 0; virtual void begin() = 0; virtual void stop() = 0; virtual void loop() = 0; diff --git a/src/helpers/sensors/MicroNMEALocationProvider.h b/src/helpers/sensors/MicroNMEALocationProvider.h index b66cb11458..2344334e69 100644 --- a/src/helpers/sensors/MicroNMEALocationProvider.h +++ b/src/helpers/sensors/MicroNMEALocationProvider.h @@ -75,6 +75,14 @@ public : if (_peripher_power) _peripher_power->release(); } + void configure() override { + // Attempt to use proprietary NMEA sentences to configure GPS + // Unsupported sentences will be ignored + + // Quectel L76K + sendSentence("$PCAS04,7"); // Set constellation - GPS + BeiDou + GLONASS + } + void begin() override { claim(); if (_pin_en != -1) { From 3ad667ef7f5e8e17bca79e509c9121a4fa5f716d Mon Sep 17 00:00:00 2001 From: Yoshi Walsh Date: Wed, 5 Aug 2026 02:28:20 +1000 Subject: [PATCH 14/14] RAK12500 refactoring 1. Replace RAK_WISBLOCK_GPS and RAK_BOARD constants with ENV_INCLUDE_12500, functionally what they were doing 2. Remove ENV_INCLUDE_RAK12500 from GAT562_30S_Mesh_Kit, which has a soldered L76K instead 3. Remove u-blox GNSS library dependency from multiple variants that weren't using it 4. Add support for syncing time from RAK12500 GNSS module --- .../sensors/EnvironmentSensorManager.cpp | 43 ++++++++++++------- .../sensors/EnvironmentSensorManager.h | 11 +++-- src/helpers/sensors/LocationProvider.h | 22 ++++++++++ .../sensors/MicroNMEALocationProvider.h | 19 ++------ variants/gat562_30s_mesh_kit/platformio.ini | 2 - variants/gat562_30s_mesh_kit/target.cpp | 2 +- variants/gat562_mesh_evb_pro/platformio.ini | 1 - .../gat562_mesh_tracker_pro/platformio.ini | 1 - variants/gat562_mesh_watch13/platformio.ini | 1 - variants/muziworks_r1_neo/platformio.ini | 1 - variants/rak3401/platformio.ini | 2 +- variants/rak3401/target.cpp | 2 +- variants/rak4631/platformio.ini | 2 +- variants/rak4631/target.cpp | 2 +- variants/rak_wismesh_tag/platformio.ini | 1 - 15 files changed, 66 insertions(+), 46 deletions(-) diff --git a/src/helpers/sensors/EnvironmentSensorManager.cpp b/src/helpers/sensors/EnvironmentSensorManager.cpp index 42f395e630..e6f09bb52b 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.cpp +++ b/src/helpers/sensors/EnvironmentSensorManager.cpp @@ -160,11 +160,7 @@ static Adafruit_VL53L0X VL53L0X; static RAK12035_SoilMoisture RAK12035; #endif -#if ENV_INCLUDE_GPS && defined(RAK_BOARD) && !defined(RAK_WISMESH_TAG) -#define RAK_WISBLOCK_GPS -#endif - -#ifdef RAK_WISBLOCK_GPS +#ifdef ENV_INCLUDE_RAK12500 static bool i2cGPSFlag = false; static bool serialGPSFlag = false; #ifndef TELEM_RAK12500_ADDRESS @@ -179,18 +175,26 @@ class UbloxLocationProvider : public LocationProvider { long _alt = 0; int _sats = 0; long _epoch = 0; + bool _initialised = false; bool _fix = false; public: + void setRTC(mesh::RTCClock* clock) { + _clock = clock; + } long getLatitude() override { return _lat; } long getLongitude() override { return _lng; } long getAltitude() override { return _alt; } long satellitesCount() override { return _sats; } - bool isValid() override { return _fix; } + bool isValid() override { + return _initialised && _fix; + } long getTimestamp() override { return _epoch; } void sendSentence(const char * sentence) override { } void reset() override { } void configure() override { - ublox_GNSS.setI2COutput(COM_TYPE_UBX); // Disable NMEA output (the ublox library can use the more efficient proprietary UBX protocol) + // Disable NMEA output (the ublox library can use the more efficient proprietary UBX protocol) + ublox_GNSS.setI2COutput(COM_TYPE_UBX); + // Configure constellations ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS); ublox_GNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GALILEO); @@ -230,13 +234,21 @@ class UbloxLocationProvider : public LocationProvider { _sats = ublox_GNSS.getSIV(2); } else { _fix = false; + + // When the ublox GPS first turns on, GNSS fix reads ok + // until it realises it doesn't actually have a fix. + // So we need to wait until fix reads false at least + // once before we can trust a read of "true". + _initialised = true; } _epoch = ublox_GNSS.getUnixEpoch(2); + + _syncTimeIfNeeded(); } bool isEnabled() override { return true; } }; -static UbloxLocationProvider Ublox_provider; +static UbloxLocationProvider ublox_provider; #endif // ============================================================ @@ -643,7 +655,7 @@ static const size_t SENSOR_TABLE_SIZE = (sizeof(SENSOR_TABLE) / sizeof(SENSOR_TA bool EnvironmentSensorManager::begin() { #if ENV_INCLUDE_GPS - #ifdef RAK_WISBLOCK_GPS + #ifdef ENV_INCLUDE_RAK12500 rakGPSInit(); #else initBasicGPS(); @@ -760,7 +772,6 @@ bool EnvironmentSensorManager::setSettingValue(const char* name, const char* val #if ENV_INCLUDE_GPS void EnvironmentSensorManager::initBasicGPS() { - Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); #ifdef GPS_BAUD_RATE @@ -803,8 +814,10 @@ void EnvironmentSensorManager::initBasicGPS() { // gps code for rak might be moved to MicroNMEALoactionProvider // or make a new location provider ... -#ifdef RAK_WISBLOCK_GPS +#ifdef ENV_INCLUDE_RAK12500 void EnvironmentSensorManager::rakGPSInit(){ + ublox_provider.setRTC(_clock); + Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); #ifdef GPS_BAUD_RATE @@ -842,7 +855,7 @@ bool EnvironmentSensorManager::gpsIsAwake(){ gps_active = true; gps_detected = true; - _location = &Ublox_provider; + _location = &ublox_provider; _location->begin(); _location->configure(); @@ -868,7 +881,7 @@ void EnvironmentSensorManager::start_gps() { _location->begin(); _location->reset(); - #if !defined(PIN_GPS_EN) && !defined(RAK_WISBLOCK_GPS) + #if !defined(PIN_GPS_EN) && !defined(ENV_INCLUDE_RAK12500) MESH_DEBUG_PRINTLN("Start GPS is N/A on this board. Actual GPS state unchanged"); #endif } @@ -878,7 +891,7 @@ void EnvironmentSensorManager::stop_gps() { _location->stop(); - #if !defined(PIN_GPS_EN) && !defined(RAK_WISBLOCK_GPS) + #if !defined(PIN_GPS_EN) && !defined(ENV_INCLUDE_RAK12500) MESH_DEBUG_PRINTLN("Stop GPS is N/A on this board. Actual GPS state unchanged"); #endif } @@ -895,7 +908,7 @@ void EnvironmentSensorManager::loop() { if ((long)(millis() - next_gps_update) > 0) { if(gps_active){ - #ifdef RAK_WISBLOCK_GPS + #ifdef ENV_INCLUDE_RAK12500 if ((i2cGPSFlag || serialGPSFlag) && _location->isValid()) { node_lat = ((double)_location->getLatitude())/1000000.; node_lon = ((double)_location->getLongitude())/1000000.; diff --git a/src/helpers/sensors/EnvironmentSensorManager.h b/src/helpers/sensors/EnvironmentSensorManager.h index be1195dce3..96d559ed87 100644 --- a/src/helpers/sensors/EnvironmentSensorManager.h +++ b/src/helpers/sensors/EnvironmentSensorManager.h @@ -28,7 +28,8 @@ class EnvironmentSensorManager : public SensorManager { void start_gps(); void stop_gps(); void initBasicGPS(); - #ifdef RAK_BOARD + #ifdef ENV_INCLUDE_RAK12500 + mesh::RTCClock* _clock; void rakGPSInit(); bool gpsIsAwake(); #endif @@ -36,8 +37,12 @@ class EnvironmentSensorManager : public SensorManager { public: #if ENV_INCLUDE_GPS - EnvironmentSensorManager(LocationProvider &location): _location(&location){}; - LocationProvider* getLocationProvider() { return _location; } + #ifdef ENV_INCLUDE_RAK12500 + EnvironmentSensorManager(LocationProvider &location, mesh::RTCClock* rtc_clock): _location(&location), _clock(rtc_clock) {}; + #else + EnvironmentSensorManager(LocationProvider &location): _location(&location) {}; + #endif + LocationProvider* getLocationProvider() { return _location; } #else EnvironmentSensorManager(){}; #endif diff --git a/src/helpers/sensors/LocationProvider.h b/src/helpers/sensors/LocationProvider.h index 4e3a95cd9c..b8fe966cd9 100644 --- a/src/helpers/sensors/LocationProvider.h +++ b/src/helpers/sensors/LocationProvider.h @@ -5,9 +5,31 @@ class LocationProvider { protected: + mesh::RTCClock* _clock; bool _time_sync_needed = true; + unsigned long _last_time_sync = 0; + long _time_valid = 0; + + void _syncTimeIfNeeded() { + if (isValid()) { + _time_valid ++; + } else { + _time_valid = 0; + } + + if (_time_sync_needed && _time_valid > 3) { + if (_clock != NULL) { + _clock->setCurrentTime(getTimestamp()); + MESH_DEBUG_PRINTLN("Synced time from GPS: %u", _clock->getCurrentTime()); + _time_sync_needed = false; + _last_time_sync = millis(); + } + } + }; public: + LocationProvider(mesh::RTCClock* clock = NULL) : + _clock(clock) {} virtual void syncTime() { _time_sync_needed = true; } virtual bool waitingTimeSync() { return _time_sync_needed; } virtual long getLatitude() = 0; diff --git a/src/helpers/sensors/MicroNMEALocationProvider.h b/src/helpers/sensors/MicroNMEALocationProvider.h index 2344334e69..2cd481c081 100644 --- a/src/helpers/sensors/MicroNMEALocationProvider.h +++ b/src/helpers/sensors/MicroNMEALocationProvider.h @@ -40,20 +40,17 @@ class MicroNMEALocationProvider : public LocationProvider { char _nmeaBuffer[100]; MicroNMEA nmea; - mesh::RTCClock* _clock; Stream* _gps_serial; RefCountedDigitalPin* _peripher_power; int8_t _claims = 0; int _pin_reset; int _pin_en; unsigned long next_check = 0; - long time_valid = 0; - unsigned long _last_time_sync = 0; static const unsigned long TIME_SYNC_INTERVAL = 1800000; // Re-sync every 30 minutes public : MicroNMEALocationProvider(Stream& ser, mesh::RTCClock* clock = NULL, int pin_reset = GPS_RESET, int pin_en = GPS_EN,RefCountedDigitalPin* peripher_power=NULL) : - nmea(_nmeaBuffer, sizeof(_nmeaBuffer)), _clock(clock), _gps_serial(&ser), _peripher_power(peripher_power), _pin_reset(pin_reset), _pin_en(pin_en) { + LocationProvider(clock), nmea(_nmeaBuffer, sizeof(_nmeaBuffer)), _gps_serial(&ser), _peripher_power(peripher_power), _pin_reset(pin_reset), _pin_en(pin_en) { if (_pin_reset != -1) { pinMode(_pin_reset, OUTPUT); digitalWrite(_pin_reset, GPS_RESET_ACTIVE); @@ -151,24 +148,14 @@ public : nmea.process(c); } - if (!isValid()) time_valid = 0; - if ((long)(millis() - next_check) > 0) { next_check = millis() + 1000; // Re-enable time sync periodically when GPS has valid fix if (!_time_sync_needed && _clock != NULL && (millis() - _last_time_sync) > TIME_SYNC_INTERVAL) { _time_sync_needed = true; } - if (_time_sync_needed && time_valid > 2) { - if (_clock != NULL) { - _clock->setCurrentTime(getTimestamp()); - _time_sync_needed = false; - _last_time_sync = millis(); - } - } - if (isValid()) { - time_valid ++; - } } + + _syncTimeIfNeeded(); } }; diff --git a/variants/gat562_30s_mesh_kit/platformio.ini b/variants/gat562_30s_mesh_kit/platformio.ini index 89276a49a7..f383fe2c28 100644 --- a/variants/gat562_30s_mesh_kit/platformio.ini +++ b/variants/gat562_30s_mesh_kit/platformio.ini @@ -6,7 +6,6 @@ build_flags = ${nrf52_base.build_flags} ${sensor_base.build_flags} -I variants/gat562_30s_mesh_kit -D RAK_4631 - -D RAK_BOARD -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 @@ -28,7 +27,6 @@ lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 - sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27 [env:GAT562_30S_Mesh_Kit_repeater] diff --git a/variants/gat562_30s_mesh_kit/target.cpp b/variants/gat562_30s_mesh_kit/target.cpp index 8f84a7a19e..abfe29c4b4 100644 --- a/variants/gat562_30s_mesh_kit/target.cpp +++ b/variants/gat562_30s_mesh_kit/target.cpp @@ -28,7 +28,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #if ENV_INCLUDE_GPS #include MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); + EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea, &rtc_clock); #else EnvironmentSensorManager sensors; #endif diff --git a/variants/gat562_mesh_evb_pro/platformio.ini b/variants/gat562_mesh_evb_pro/platformio.ini index b3e894174a..914cbffb89 100644 --- a/variants/gat562_mesh_evb_pro/platformio.ini +++ b/variants/gat562_mesh_evb_pro/platformio.ini @@ -20,7 +20,6 @@ build_src_filter = ${nrf52_base.build_src_filter} lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} - sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27 [env:GAT562_Mesh_EVB_Pro_repeater] extends = GAT562_Mesh_EVB_Pro diff --git a/variants/gat562_mesh_tracker_pro/platformio.ini b/variants/gat562_mesh_tracker_pro/platformio.ini index 142cfe4b8f..9e27dfc8bc 100644 --- a/variants/gat562_mesh_tracker_pro/platformio.ini +++ b/variants/gat562_mesh_tracker_pro/platformio.ini @@ -24,7 +24,6 @@ lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} adafruit/Adafruit SSD1306 @ ^2.5.13 - sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27 [env:GAT562_Mesh_Tracker_Pro_repeater] diff --git a/variants/gat562_mesh_watch13/platformio.ini b/variants/gat562_mesh_watch13/platformio.ini index f3510b74aa..4c2e69ddb1 100644 --- a/variants/gat562_mesh_watch13/platformio.ini +++ b/variants/gat562_mesh_watch13/platformio.ini @@ -7,7 +7,6 @@ build_flags = ${nrf52_base.build_flags} -UENV_INCLUDE_GPS -I variants/gat562_mesh_watch13 -D RAK_4631 - -D RAK_BOARD -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 diff --git a/variants/muziworks_r1_neo/platformio.ini b/variants/muziworks_r1_neo/platformio.ini index 52dc3e38fe..44a57e3886 100644 --- a/variants/muziworks_r1_neo/platformio.ini +++ b/variants/muziworks_r1_neo/platformio.ini @@ -27,7 +27,6 @@ build_src_filter = ${nrf52_base.build_src_filter} lib_deps = ${nrf52_base.lib_deps} ${sensor_base.lib_deps} - sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27 [env:R1Neo_repeater] extends = R1Neo diff --git a/variants/rak3401/platformio.ini b/variants/rak3401/platformio.ini index c285e3ec50..654806be68 100644 --- a/variants/rak3401/platformio.ini +++ b/variants/rak3401/platformio.ini @@ -6,7 +6,7 @@ build_flags = ${nrf52_base.build_flags} ${sensor_base.build_flags} -I variants/rak3401 -D RAK_3401 - -D RAK_BOARD + -D ENV_INCLUDE_RAK12500 -D NRF52_POWER_MANAGEMENT -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper diff --git a/variants/rak3401/target.cpp b/variants/rak3401/target.cpp index 5309e6b22b..5a0bc74fe4 100644 --- a/variants/rak3401/target.cpp +++ b/variants/rak3401/target.cpp @@ -27,7 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #if ENV_INCLUDE_GPS #include MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); + EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea, &rtc_clock); #else EnvironmentSensorManager sensors; #endif diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 4e37fcfda2..8ae5557897 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -8,7 +8,7 @@ build_flags = ${nrf52_base.build_flags} ${sensor_base.build_flags} -I variants/rak4631 -D RAK_4631 - -D RAK_BOARD + -D ENV_INCLUDE_RAK12500 -D NRF52_POWER_MANAGEMENT -D PIN_BOARD_SCL=14 -D PIN_BOARD_SDA=13 diff --git a/variants/rak4631/target.cpp b/variants/rak4631/target.cpp index a41ba72075..5a98bac5fd 100644 --- a/variants/rak4631/target.cpp +++ b/variants/rak4631/target.cpp @@ -27,7 +27,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #if ENV_INCLUDE_GPS #include MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); + EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea, &rtc_clock); #else EnvironmentSensorManager sensors; #endif diff --git a/variants/rak_wismesh_tag/platformio.ini b/variants/rak_wismesh_tag/platformio.ini index d614018717..c9fc3ccaa7 100644 --- a/variants/rak_wismesh_tag/platformio.ini +++ b/variants/rak_wismesh_tag/platformio.ini @@ -7,7 +7,6 @@ build_flags = ${nrf52_base.build_flags} -I variants/rak_wismesh_tag -I src/helpers/ui -D RAK_WISMESH_TAG - -D RAK_BOARD -D P_LORA_TX_LED=LED_GREEN -D P_LORA_DIO_1=SX126X_DIO1 -D P_LORA_NSS=PIN_SPI_NSS