Adding the RAK13300 / RAK11200 ESP32 pair variant#800
Conversation
de189e5 to
00425c2
Compare
|
Per Discord message it is possible that the I2C errors are normal. Opening for review and feedback. |
|
Fixed the pin assignment and also disabled some sensors causing long startup times and adjusted the voltage multiplier to be closer to real measurements. |
0c53a63 to
1795fc2
Compare
|
Any support/help needed to get this merged? Running this on my RAK13300/RAK11200 right now and working fine. |
1795fc2 to
f59e2b5
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds support for the RAK11200 WisBlock ESP32 module paired with the RAK13300 LoRa module (SX1262). The implementation follows the pattern of similar ESP32-based variants like Heltec boards and uses the RAK4631 as a base reference. The variant includes configuration for LoRa communication, I2C sensors, GPIO mappings, and uses the min_spiffs partition scheme to accommodate the 4MB flash limitation.
Changes:
- Added RAK11200 board variant files including pin definitions, board-specific class, and build configurations
- Configured SX1262 radio with DIO2 as RF switch and 1.8V TCXO
- Created PlatformIO build environments for repeater, room server, companion radio (USB/BLE), terminal chat, and sensor applications
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| variants/rak11200/variant.h | Pin definitions and WisBlock GPIO mappings for RAK11200 + RAK13300 |
| variants/rak11200/target.h | Header declarations for radio driver, board, sensors, and RTC |
| variants/rak11200/target.cpp | Implementation of radio initialization and configuration functions |
| variants/rak11200/platformio.ini | Build configurations for multiple RAK11200 application environments |
| variants/rak11200/pins_arduino.h | Arduino-compatible pin mappings for the RAK11200 |
| variants/rak11200/RAK11200Board.h | Board class definition with LoRa pin assignments and battery monitoring |
| variants/rak11200/RAK11200Board.cpp | Board initialization and battery voltage reading implementation |
| boards/wiscore_rak11200.json | PlatformIO board definition with ESP32 specifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #define I2C_SDA 21 | ||
| #define I2C_SCL 22 |
There was a problem hiding this comment.
The I2C pins defined here (SDA=21, SCL=22) conflict with the platformio.ini configuration (PIN_BOARD_SDA=4, PIN_BOARD_SCL=5) and pins_arduino.h (SDA=4, SCL=5). This inconsistency is likely the root cause of the I2C errors mentioned in the PR description. According to the RAK11200 documentation, the correct I2C pins should be GPIO4 (SDA) and GPIO5 (SCL). Please update these values to match the other files.
| #define I2C_SDA 21 | |
| #define I2C_SCL 22 | |
| #define I2C_SDA 4 | |
| #define I2C_SCL 5 |
| #define LED_PIN_2 2 // WB_LED2 - Secondary LED | ||
|
|
||
| // LoRa radio module pins for RAK11200 + RAK13300 SX1262 | ||
| #define P_LORA_DIO_1 22 // WB_IO6 - DIO1 interrupt pin |
There was a problem hiding this comment.
Pin conflict detected: P_LORA_DIO_1 is assigned to GPIO22, which is the same pin as WB_IO6 (line 53). Additionally, GPIO22 is defined as I2C_SCL at line 7. This creates a three-way pin conflict. According to the RAK13300 documentation and WisBlock slot mapping, DIO1 should typically be on WB_IO6 (GPIO22), but I2C_SCL should be on GPIO5. Please resolve this conflict by correcting the I2C pin definitions.
| #define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET) | ||
| #define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5) |
There was a problem hiding this comment.
P_LORA_BUSY is redefined here as GPIO13, which conflicts with the definition in variant.h (line 28) where it's set to RADIOLIB_NC. The RAK11200Board.h definition should be removed or both files need to be aligned. According to the RAK13300 module documentation, if BUSY is connected, it should be on WB_IO5 (GPIO13), but variant.h indicates it's not connected (RADIOLIB_NC). Please clarify the actual hardware configuration and make these definitions consistent.
| #define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET) | |
| #define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5) | |
| #define P_LORA_RESET 23 // GPIO23 (ESP32 pin 37 -> IO4/NRESET) | |
| #ifndef P_LORA_BUSY | |
| #define P_LORA_BUSY 13 // GPIO13 (ESP32 pin 16 -> IO5) | |
| #endif |
| void RAK11200Board::begin() { | ||
| ESP32Board::begin(); | ||
|
|
||
| pinMode(PIN_VBAT_READ, INPUT); | ||
|
|
||
| pinMode(SX126X_POWER_EN, OUTPUT); | ||
| digitalWrite(SX126X_POWER_EN, HIGH); | ||
| delay(10); // give sx1262 some time to power up | ||
|
|
||
| #ifdef PIN_USER_BTN | ||
| pinMode(PIN_USER_BTN, INPUT_PULLUP); | ||
| #endif | ||
|
|
||
| #ifdef PIN_USER_BTN_ANA | ||
| pinMode(PIN_USER_BTN_ANA, INPUT_PULLUP); | ||
| #endif | ||
| } |
There was a problem hiding this comment.
The RAK11200Board::begin() method is missing a call to Wire.begin(). While ESP32Board::begin() already calls Wire.begin() with PIN_BOARD_SDA and PIN_BOARD_SCL, this board class doesn't call the parent begin() method. Without calling ESP32Board::begin(), the I2C bus will not be initialized, which explains the I2C errors mentioned in the PR description. Add ESP32Board::begin() as the first line of this method.
| #define P_LORA_MOSI 25 // GPIO25 (ESP32 pin 10 -> SPI_MOSI) | ||
| #define SX126X_POWER_EN 27 // GPIO27 (ESP32 pin 12 -> IO2) | ||
| #define PIN_VBAT_READ 36 // WB_A0 for battery reading | ||
| #define ADC_MULTIPLIER (3 * 1.73 * 1.110 * 1000) |
There was a problem hiding this comment.
Inconsistent ADC_MULTIPLIER values: variant.h defines it as 1.85 (line 20) while RAK11200Board.h defines it as (3 * 1.73 * 1.110 * 1000) which equals approximately 5763.9. These values are dramatically different and will result in incorrect battery voltage readings. According to the WisBlock RAK11200 documentation and similar RAK boards, the ADC_MULTIPLIER should typically account for the voltage divider ratio and ADC characteristics. Please verify the correct voltage divider configuration and use a consistent value across both files.
| #define ADC_MULTIPLIER (3 * 1.73 * 1.110 * 1000) | |
| #define ADC_MULTIPLIER 1.85f |
| "connectivity": [ | ||
| "wifi", | ||
| "bluetooth", | ||
| "ethernet", |
There was a problem hiding this comment.
The RAK11200 module does not have Ethernet capability. The connectivity list incorrectly includes "ethernet" alongside wifi, bluetooth, and CAN. According to the RAK11200 datasheet, it only supports WiFi 2.4GHz (802.11b/g/n) and Bluetooth 5.0. Please remove "ethernet" from the connectivity array.
| "ethernet", |
| "ethernet", | ||
| "can" |
There was a problem hiding this comment.
The RAK11200 module does not have CAN (Controller Area Network) capability. The connectivity list incorrectly includes "can" alongside wifi and bluetooth. According to the RAK11200 datasheet, it only supports WiFi 2.4GHz (802.11b/g/n) and Bluetooth 5.0. Please remove "can" from the connectivity array.
| "ethernet", | |
| "can" | |
| "ethernet" |
|
@andyshinn do you still want this variant? If so I can help you tidy up and get this merged. |
|
It would be nice to have, yes! |
Made a PR to your fork andyshinn#1 - if you merge that I think this will be good to go. |
|
Thanks! |
|
Closed in favor of #1925 - all PR comments are addressed there. |
This is mostly a copy of RAK4631 as a base and then modeled after the Heltec ESP32 variants. Needed the min spiffs partition since it is a little too large to fit on the default.
One issue I have right now is that it takes a bit of time to boot with errors from I2C:
I am not sure if that is a sensor issue or not. Would like some guidance on the I2C errors.