+
+static const uint8_t TX = 21;
+static const uint8_t RX = 20;
+
+static const uint8_t SDA = 1;
+static const uint8_t SCL = 0;
+
+static const uint8_t SS = 8;
+static const uint8_t MOSI = 7;
+static const uint8_t MISO = 6;
+static const uint8_t SCK = 10;
+
+static const uint8_t A0 = 0;
+static const uint8_t A1 = 1;
+static const uint8_t A2 = 2;
+static const uint8_t A3 = 3;
+static const uint8_t A4 = 4;
+static const uint8_t A5 = 5;
+
+#endif /* Pins_Arduino_h */
diff --git a/variants/diy/esp32c3_super_mini/variant.h b/variants/diy/esp32c3_super_mini/variant.h
new file mode 100644
index 000000000..48c275912
--- /dev/null
+++ b/variants/diy/esp32c3_super_mini/variant.h
@@ -0,0 +1,61 @@
+#ifndef _VARIANT_ESP32C3_SUPER_MINI_
+#define _VARIANT_ESP32C3_SUPER_MINI_
+
+/*----------------------------------------------------------------------------
+ * Headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+// I2C (Wire) & OLED
+#define WIRE_INTERFACES_COUNT (1)
+#define I2C_SDA (1)
+#define I2C_SCL (0)
+
+#define USE_SSD1306
+
+// GPS
+#undef GPS_RX_PIN
+#undef GPS_TX_PIN
+#define GPS_RX_PIN (20)
+#define GPS_TX_PIN (21)
+
+// Button
+#define BUTTON_PIN (9) // BOOT button
+
+// LoRa
+#define USE_LLCC68
+#define USE_SX1262
+// #define USE_RF95
+#define USE_SX1268
+
+#define LORA_DIO0 RADIOLIB_NC
+#define LORA_RESET (5)
+#define LORA_DIO1 (3)
+#define LORA_RXEN (2)
+#define LORA_BUSY (4)
+#define LORA_SCK (10)
+#define LORA_MISO (6)
+#define LORA_MOSI (7)
+#define LORA_CS (8)
+
+#define SX126X_CS LORA_CS
+#define SX126X_DIO1 LORA_DIO1
+#define SX126X_BUSY LORA_BUSY
+#define SX126X_RESET LORA_RESET
+#define SX126X_RXEN LORA_RXEN
+
+#define SX126X_DIO3_TCXO_VOLTAGE (1.8)
+#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
+
+#ifdef __cplusplus
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * Arduino objects - C++ only
+ *----------------------------------------------------------------------------*/
+
+#endif
diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini
index 153796daf..1f0f6d126 100644
--- a/variants/diy/platformio.ini
+++ b/variants/diy/platformio.ini
@@ -96,6 +96,20 @@ board_level = extra
build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DXIAO_BLE_LEGACY_PINOUT -DEBYTE_E22 -DEBYTE_E22_900M30S
build_unflags = -DGPS_L76K
+; Seeed XIAO nRF52840 + EBYTE E22-900M30S - Pinout matching Wio-SX1262 (SKU 113010003)
+[env:seeed_xiao_nrf52840_e22_900m30s]
+extends = env:seeed_xiao_nrf52840_kit
+board_level = extra
+build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M30S
+build_unflags = -DGPS_L76K
+
+; Seeed XIAO nRF52840 + EBYTE E22-900M33S - Pinout matching Wio-SX1262 (SKU 113010003)
+[env:seeed_xiao_nrf52840_e22_900m33s]
+extends = env:seeed_xiao_nrf52840_kit
+board_level = extra
+build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M33S
+build_unflags = -DGPS_L76K
+
; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY
[env:seeed-xiao-nrf52840-wio-sx1262]
board = xiao_ble_sense
@@ -127,3 +141,16 @@ build_flags =
-D ARDUINO_USB_MODE=0
-D ARDUINO_USB_CDC_ON_BOOT=1
-I variants/diy/t-energy-s3_e22
+
+; ESP32 C3 Super Mini Development Board
+; https://www.espboards.dev/esp32/esp32-c3-super-mini/
+[env:esp32c3_super_mini]
+extends = esp32c3_base
+board = esp32-c3-devkitm-1
+build_flags =
+ ${esp32_base.build_flags}
+ -D PRIVATE_HW
+ -I variants/diy/esp32c3_super_mini
+ -D ARDUINO_USB_MODE=1
+ -D ARDUINO_USB_CDC_ON_BOOT=1
+board_level = extra
diff --git a/variants/diy/xiao_ble/README.md b/variants/diy/xiao_ble/README.md
index 2a08138ba..fe6dcba2d 100644
--- a/variants/diy/xiao_ble/README.md
+++ b/variants/diy/xiao_ble/README.md
@@ -1,264 +1,168 @@
-#
+# XIAO nrf52840/nrf52840 Sense + Ebyte E22-900M30S
-
- Xiao BLE/BLE Sense + Ebyte E22-900M30S
-
-
-
- A step-by-step guide for macOS and Linux
-
+_A step-by-step guide for macOS and Linux._
## Introduction
-This guide will walk you through everything needed to get the Xiao BLE (or BLE Sense) running Meshtastic using an Ebyte E22-900M30S LoRa module. The combination of the E22 with an nRF52840 MCU is desirable because it allows for both very low idle (Rx) power draw and high transmit power. The Xiao BLE is a small but surprisingly well-appointed nRF52840 board, with enough GPIO for most Meshtastic applications and a built-in LiPo charger. The E22, on the other hand, is a famously inscrutable and mysterious beast. It is one of the more readily available LoRa modules capable of transmitting at 30 dBm, and includes an LNA to boost its Rx sensitivity a few dB beyond that of the SX1262. However, its documentation is relatively sparse overall, and seems to merely hint at (or completely omit) several key details regarding its functionality. Thus, much of what follows is a synthesis of my observations and inferences over the course of many hours of trial and error.
+This guide will walk you through everything needed to get the XIAO nrf52840 (or XIAO nrf52840 Sense) running Meshtastic using an Ebyte E22-900M30S LoRa module. The combination of the E22 with an nRF52840 MCU is desirable because it allows for both very low idle (Rx) power draw _and_ high transmit power.
-Acknowledgement and friendly disclaimer
+The XIAO nrf52840 is a small but surprisingly well-appointed nRF52840 board, with enough GPIO for most Meshtastic applications and a built-in LiPo charger.
+
+The E22, on the other hand, is a famously inscrutable and mysterious beast. It is one of the more readily available LoRa modules capable of transmitting at 30 dBm, and includes an LNA to boost its Rx sensitivity a few dB beyond that of the SX1262.
+
+However, its documentation is relatively sparse overall, and seems to merely hint at (or completely omit) several key details regarding its functionality. Thus, much of what follows is a synthesis of my observations and inferences over the course of many hours of trial and error.
+
+### Acknowledgement and Friendly Disclaimer
Huge thanks to those in the community who have forged the way with the E22, without whose hard work none of this would have been possible! (thebentern, riddick, rainer_vie, beegee-tokyo, geeksville, caveman99, Der_Bear, PlumRugOfDoom, BigCorvus, and many others.)
-
-
Please take the conclusions here as a tentative work in progress, representing my current (and fairly limited) understanding of the E22 when paired with this particular MCU. It is my hope that this guide will be helpful to others who are interested in trying a DIY Meshtastic build, and also be subject to revision by folks with more experience and better test equipment.
-### Obligatory liability disclaimer
+### Obligatory Liability Disclaimer
This guide and all associated content is for informational purposes only. The information presented is intended for consumption only by persons having appropriate technical skill and judgement, to be used entirely at their own discretion and risk. The authors of this guide in no way provide any warranty, express or implied, toward the content herein, nor its correctness, safety, or suitability to any particular purpose. By following the instructions in this guide in part or in full, you assume all responsibility for all potential risks, including but not limited to fire, property damage, bodily injury, and death.
-### Note
+## 1. Wire the board
-These instructions assume you are running macOS or Linux, but it should be relatively easy to translate each command for Windows. (In this case, in step 2 below, each line of `xiao_ble.sh` would also need to be converted to the equivalent Windows CLI command and run individually.)
+Connecting the E22 to the XIAO nrf52840 is straightforward, but there are a few gotchas to be mindful of.
-## 1. Update Bootloader
+### On the XIAO nrf52840
-The first thing you will need to do is update the Xiao BLE's bootloader. The stock bootloader is functionally very similar to the Adafruit nRF52 UF2 bootloader, but apparently not quite enough so to work with Meshtastic out of the box.
+- Pins D4 and D5 are currently mapped to `PIN_WIRE_SDA` and `PIN_WIRE_SCL`, respectively. If you are not using I²C and would like to free up pins D4 and D5 for use as GPIO, `PIN_WIRE_SDA` and `PIN_WIRE_SCL` can be reassigned to any two other unused pin numbers.
+- Pins D6 and D7 were originally mapped to the TX and RX pins for serial interface 1 (`PIN_SERIAL1_RX` and `PIN_SERIAL1_TX`) but are currently set to -1 in `variant.h`. If you need to expose a serial interface, you can restore these pins and move e.g. `SX126X_RXEN` to pin 4 or 5 (the opposite should work too).
-1. Connect the Xiao BLE to your computer via USB-C.
+### On the E22
-2. Install `adafruit-nrfutil` by following the instructions here.
+- There are two options for the E22's `TXEN` pin:
+ 1. It can be connected to the MCU on the pin defined as `SX126X_TXEN` in `variant.h`. In this configuration, the MCU will control Tx/Rx switching "manually". As long as `SX126X_TXEN` and `SX126X_RXEN` are both defined in `variant.h` (and neither is set to `RADIOLIB_NC`), `SX126xInterface.cpp` will initialize the E22 correctly for this mode.
+ 2. Alternately, it can be connected to the E22's `DIO2` pin only, with neither `TXEN` nor `DIO2` being connected to the MCU. In this configuration, the E22 will control Tx/Rx switching automatically. In `variant.h`, as long as `SX126X_TXEN` is defined as `RADIOLIB_NC`, and `SX126X_RXEN` is defined and connected to the E22's `RXEN` pin, and `E22_TXEN_CONNECTED_TO_DIO2` is defined, `SX126xInterface.cpp` will initialize the E22 correctly for this mode. This configuration frees up a GPIO, and presents no drawbacks that I have found.
+- Note that any combination other than the two described above will likely result in unexpected behavior. In my testing, some of these other configurations appeared to "work" at first glance, but every one I tried had at least one of the following flaws: weak Tx power, extremely poor Rx sensitivity, or the E22 overheating because TXEN was never pulled low, causing its PA to stay on indefinitely.
+- Along the same lines, it is a good idea to check the E22's temperature frequently by lightly touching the shield. If you feel the shield getting hot (i.e. approaching uncomfortable to touch) near pins 1, 2, and 3, something is probably misconfigured; disconnect both the XIAO nrf52840 and E22 from power and double check wiring and pin mapping.
+- Whether you opt to let the E22 control Rx and Tx or handle this manually, **the E22's `RXEN` pin must always be connected to the MCU** on the pin defined as `SX126X_RXEN` in `variant.h`.
-3. Open a terminal window and navigate to `firmware/variants/xiao_ble` (where `firmware` is the directory into which you have cloned the Meshtastic firmware repo).
+#### Note
-4. Run the following command, replacing `/dev/cu.usbmodem2101` with the serial port your Xiao BLE is connected to:
+The default pin mapping in `variant.h` uses "Automatic Tx/Rx switching" mode.
- ```bash
- adafruit-nrfutil --verbose dfu serial --package xiao_nrf52840_ble_bootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip --port /dev/cu.usbmodem2101 -b 115200 --singlebank --touch 1200
- ```
+If you wire your board for Manual Tx/Rx Switching Mode, `SX126X_TXEN` must be defined (`#define #define SX126X_TXEN D6`) in `variants/seeed_xiao_nrf52840_kit/variant.h` in the code block following:
-5. If all goes well, the Xiao BLE's red LED should start to pulse slowly, and you should see a new USB storage device called `XIAO-BOOT` appear under `Locations` in Finder.
+```c
+#ifdef XIAO_BLE_LEGACY_PINOUT
+// Legacy xiao_ble variant pinout for third-party SX126x modules e.g. EBYTE E22
+```
-
+### Example Wiring for Automatic Tx/Rx Switching Mode
-## 2. PlatformIO Environment Preparation
+#### MCU -> E22 Connections
-Before building Meshtastic for the Xiao BLE + E22, it is necessary to pull in SoftDevice 7.3.0 and its associated linker script (nrf52840_s140_v7.ld) from Seeed Studio's Arduino core. The `xiao_ble.sh` script does this.
+| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes |
+| :---------------- | :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------- |
+| D0 | SX126X_CS | 19 (NSS) | |
+| D1 | SX126X_DIO1 | 13 (DIO1) | |
+| D2 | SX126X_BUSY | 14 (BUSY) | |
+| D3 | SX126X_RESET | 15 (NRST) | |
+| D7 | SX126X_RXEN | 6 (RXEN) | These pins must still be connected, and `SX126X_RXEN` defined in `variant.h`, otherwise Rx sensitivity will be poor. |
+| D8 | PIN_SPI_SCK | 18 (SCK) | |
+| D9 | PIN_SPI_MISO | 16 (MISO) | |
+| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
-1. In your terminal window, run the following command:
-
- ```bash
- sudo ./xiao_ble.sh
- ```
-
-
-
-## 3. Build Meshtastic
-
-At this point, you should be able to build the firmware successfully.
-
-1. In VS Code, press `Command Shift P` to bring up the command palette.
-
-2. Search for and run the `Developer: Reload Window` command.
-
-3. Bring up the command palette again with `Command Shift P`. Search for and run the `PlatformIO: Pick Project Environment` command.
-
-4. In the list of environments, select `env:xiao_ble`. PlatformIO may update itself for a minute or two, and should let you know once done.
-
-5. Return to the command palette once again (`Command Shift P`). Search for and run the `PlatformIO: Build` command.
-
-6. PlatformIO will build the project. After a few minutes you should see a green `SUCCESS` message.
-
-
-
-## 4. Wire the board
-
-Connecting the E22 to the Xiao BLE is straightforward, but there are a few gotchas to be mindful of.
-
-- On the Xiao BLE:
-
- - Pins D4 and D5 are currently mapped to `PIN_WIRE_SDA` and `PIN_WIRE_SCL`, respectively. If you are not using I²C and would like to free up pins D4 and D5 for use as GPIO, `PIN_WIRE_SDA` and `PIN_WIRE_SCL` can be reassigned to any two other unused pin numbers.
-
- - Pins D6 and D7 were originally mapped to the TX and RX pins for serial interface 1 (`PIN_SERIAL1_RX` and `PIN_SERIAL1_TX`) but are currently set to -1 in `variant.h`. If you need to expose a serial interface, you can restore these pins and move e.g. `SX126X_RXEN` to pin 4 or 5 (the opposite should work too).
-
-- On the E22:
-
- - There are two options for the E22's `TXEN` pin:
-
- 1. It can be connected to the MCU on the pin defined as `SX126X_TXEN` in `variant.h`. In this configuration, the MCU will control Tx/Rx switching "manually". As long as `SX126X_TXEN` and `SX126X_RXEN` are both defined in `variant.h` (and neither is set to `RADIOLIB_NC`), `SX126xInterface.cpp` will initialize the E22 correctly for this mode.
-
- 2. Alternately, it can be connected to the E22's `DIO2` pin only, with neither `TXEN` nor `DIO2` being connected to the MCU. In this configuration, the E22 will control Tx/Rx switching automatically. In `variant.h`, as long as `SX126X_TXEN` is defined as `RADIOLIB_NC`, and `SX126X_RXEN` is defined and connected to the E22's `RXEN` pin, and `E22_TXEN_CONNECTED_TO_DIO2` is defined, `SX126xInterface.cpp` will initialize the E22 correctly for this mode. This configuration frees up a GPIO, and presents no drawbacks that I have found.
-
- - Note that any combination other than the two described above will likely result in unexpected behavior. In my testing, some of these other configurations appeared to "work" at first glance, but every one I tried had at least one of the following flaws: weak Tx power, extremely poor Rx sensitivity, or the E22 overheating because TXEN was never pulled low, causing its PA to stay on indefinitely.
-
- - Along the same lines, it is a good idea to check the E22's temperature frequently by lightly touching the shield. If you feel the shield getting hot (i.e. approaching uncomfortable to touch) near pins 1, 2, and 3, something is probably misconfigured; disconnect both the Xiao BLE and E22 from power and double check wiring and pin mapping.
-
- - Whether you opt to let the E22 control Rx and Tx or handle this manually, the E22's `RXEN` pin must always be connected to the MCU on the pin defined as `SX126X_RXEN` in `variant.h`.
-
-Note
-
-The default pin mapping in `variant.h` uses 'automatic Tx/Rx switching' mode. If you wire your board for manual Rx/Tx switching, make sure to update `variant.h` accordingly by commenting/uncommenting the necessary lines in the 'E22 Tx/Rx control options' section.
-
-
-
----
-
-
-
-Example wiring for "E22 automatic Tx/Rx switching" mode:
-
-
-MCU -> E22 connections
-
-| Xiao BLE pin | variant.h definition | E22 pin | Notes |
-| :----------- | :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------- |
-| D0 | SX126X_CS | 19 (NSS) | |
-| D1 | SX126X_DIO1 | 13 (DIO1) | |
-| D2 | SX126X_BUSY | 14 (BUSY) | |
-| D3 | SX126X_RESET | 15 (NRST) | |
-| D7 | SX126X_RXEN | 6 (RXEN) | These pins must still be connected, and `SX126X_RXEN` defined in `variant.h`, otherwise Rx sensitivity will be poor. |
-| D8 | PIN_SPI_SCK | 18 (SCK) | |
-| D9 | PIN_SPI_MISO | 16 (MISO) | |
-| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
-
-
-
-
-E22 -> E22 connections:
+#### E22 -> E22 Connections
| E22 pin | E22 pin | Notes |
| :------ | :------ | :------------------------------------------------------------------------ |
| TXEN | DIO2 | These must be physically connected for automatic Tx/Rx switching to work. |
-Note
+#### Note
The schematic (`xiao-ble-e22-schematic.png`) in the `eagle-project` directory uses this wiring.
-
+### Example Wiring for Manual Tx/Rx Switching Mode
----
+#### MCU -> E22 Connections
-
+| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes |
+| :---------------- | :------------------- | :-------- | :---- |
+| D0 | SX126X_CS | 19 (NSS) | |
+| D1 | SX126X_DIO1 | 13 (DIO1) | |
+| D2 | SX126X_BUSY | 14 (BUSY) | |
+| D3 | SX126X_RESET | 15 (NRST) | |
+| D6 | SX126X_TXEN | 7 (TXEN) | |
+| D7 | SX126X_RXEN | 6 (RXEN) | |
+| D8 | PIN_SPI_SCK | 18 (SCK) | |
+| D9 | PIN_SPI_MISO | 16 (MISO) | |
+| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
-Example wiring for "Manual Tx/Rx switching" mode:
+#### E22 -> E22 connections
-MCU -> E22 connections
+_(none)_
-| Xiao BLE pin | variant.h definition | E22 pin | Notes |
-| :----------- | :------------------- | :-------- | :---- |
-| D0 | SX126X_CS | 19 (NSS) | |
-| D1 | SX126X_DIO1 | 13 (DIO1) | |
-| D2 | SX126X_BUSY | 14 (BUSY) | |
-| D3 | SX126X_RESET | 15 (NRST) | |
-| D6 | SX126X_TXEN | 7 (TXEN) | |
-| D7 | SX126X_RXEN | 6 (RXEN) | |
-| D8 | PIN_SPI_SCK | 18 (SCK) | |
-| D9 | PIN_SPI_MISO | 16 (MISO) | |
-| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
+## 2. Build Meshtastic
-E22 -> E22 connections: (none)
+1. Follow the [Building Meshtastic Firmware](https://meshtastic.org/docs/development/firmware/build/) documentation, stop after **Build** → **Step 2**
+2. For **Build** → **Step 3**, select `xiao_ble` as your target
+3. Adjust source code if you:
+ - Wired your board for Manual Tx/Rx Switching Mode: see [Wire the Board](#1-wire-the-board)
+ - Used an E22-900M33S module
+ (this step is important to avoid **damaging the power amplifier** in the M33S module and **transmitting power above legal limits**!):
+ 1. Open `variants/diy/platformio.ini`
+ 2. Search for `[env:xiao_ble]`
+ 3. In the line starting with `build_flags` within this section, change `-DEBYTE_E22_900M30S` to `-DEBYTE_E22_900M33S`
+4. Follow **Build** → **Step 4** to build the firmware
+5. Stop here, because the **PlatformIO: Upload** step does not work for factory-fresh XIAO nrf52840 (the automatic reset to bootloader only works if Meshtastic firmware is already running)
+6. The built `firmware.uf2` binary can be found in the folder `.pio/build/xiao_ble/firmware.uf2` (relative to where you cloned the Git repository to), we will need it for [flashing the firmware](#3-flash-the-firmware-to-the-xiao-nrf52840) (manually)
-
+## 3. Flash the Firmware to the XIAO nrf52840
-## 5. Flash the firmware to the Xiao BLE
+1. Double press the XIAO nrf52840's `reset` button to put it in bootloader mode, and a USB volume named `XIAO SENSE` will appear
+2. Copy the `firmware.uf2` file to the `XIAO SENSE` volume (refer to the last step of [Build Meshtastic](#2-build-meshtastic))
+3. The XIAO nrf52840's red LED will flash for several seconds as the firmware is copied
+4. Once Meshtastic firmware succesfully boots, the:
+ 1. Green LED will turn on
+ 2. Red LED will flash several times to indicate flash memory writes during initial settings file creation
+ 3. Green LED will blink every second once the firmware is running normally
+5. If you do not see the above LED patters, proceed to [Troubleshooting](#4-troubleshooting)
-1. Double press the Xiao's `reset` button to put it in bootloader mode.
-2. In a terminal window, navigate to the Meshtastic firmware repo's root directory, and from there to `.pio/build/xiao_ble`.
-3. Convert the generated `.hex` file into a `.uf2` file:
-
- ```bash
- ../../../bin/uf2conv.py firmware.hex -c -o firmware.uf2 -f 0xADA52840
- ```
-
-4. Copy the new `.uf2` file to the Xiao's mass storage volume:
-
- ```bash
- cp firmware.uf2 /Volumes/XIAO-BOOT
- ```
-
-5. The Xiao's red LED will flash for several seconds as the firmware is copied.
-6. Once the firmware is copied, to verify it is running, run the following command:
-
- ```bash
- meshtastic --noproto
- ```
-
-7. Then, press the Xiao's `reset` button again. You should see a lot of debug output logged in the terminal window.
-
-
-
-## 6. Troubleshooting
-
-- If after flashing Meshtastic, the Xiao is bootlooped, look at the serial output (you can see this by running `meshtastic --noproto` with the device connected to your computer via USB).
+## 4. Troubleshooting
+- If after flashing Meshtastic, the XIAO is bootlooped, look at the serial output (you can see this by running `meshtastic --noproto` with the device connected to your computer via USB).
- If you see that the SX1262 init result was -2, this likely indicates a wiring problem; double check your wiring and pin mapping in `variant.h`.
-
- - If you see an error mentioning tinyFS, this may mean you need to reformat the Xiao's storage:
-
- 1. Double press the `reset` button to put the Xiao in bootloader mode.
-
- 2. In a terminal window, navigate to the Meshtastic firmware repo's root directory, and from there to `variants/xiao_ble`.
-
- 3. Run the following command: `cp xiao-ble-internal-format.uf2 /Volumes/XIAO-BOOT`
-
- 4. The Xiao's red LED will flash briefly as the filesystem format firmware is copied.
-
- 5. Run the following command: `meshtastic --noproto`
-
- 6. In the output of the above command, you should see a message saying "Formatting...done".
-
- 7. To flash Meshtastic again, repeat the steps in section 5 above.
-
+ - If you see an error mentioning tinyFS, this may mean you need to reformat the XIAO's storage:
+ 1. Open the [Meshtastic web flasher](https://flasher.meshtastic.org/)
+ 2. Select the **_Seeed XIAO NRF52840 Kit_**
+ 3. Click the **_trash can icon_** to the right of **_Flash_**
+ 4. Follow the instructions on the screen
+ **Do not flash the Seeed XIAO NRF52840 Kit firmware** if you have wired the LoRa module according to this variant, as the Seeed XIAO NRF52840 Kit uses different wiring for the SX1262 LoRa chip
- If you don't see any specific error message, but the boot process is stuck or not proceeding as expected, this might also mean there is a conflict in `variant.h`. If you have made any changes to the pin mapping, ensure they do not result in a conflict. If all else fails, try reverting your changes and using the known-good configuration included here.
-
- The above might also mean something is wired incorrectly. Try reverting to one of the known-good example wirings in section 4.
-
- If the E22 gets hot to the touch:
- - The power amplifier is likely running continually. Disconnect it and the Xiao from power immediately, and double check wiring and pin mapping. In my experimentation this occurred in cases where TXEN was inadvertenly high (usually due to a pin mapping conflict).
+ - The power amplifier is likely running continually. Disconnect it and the XIAO from power immediately, and double check wiring and pin mapping. In my experimentation this occurred in cases where TXEN was inadvertenly high (usually due to a pin mapping conflict).
-
+## 5. Notes
-## 7. Notes
+- **Transmit Power**
+ - There is a power amplifier after the SX1262's Tx, so the actual Tx power is just over 7 dB greater than the SX1262's set Tx power (the E22-900M30S actually tops out just over 29dB at 5V according to the datasheet)
+ - Meshtastic firmware is aware of the gain of the E22-900M30S module, so the Meshtastic clients' Tx power setting reflects the actual output power, i.e. setting 30 dBm in the Meshtastic app programs the E22 module to correctly output 30 dBm, setting 24 dBm will output 24 dBm, etc.
+- **Adequate 5V Power Supply to the E22 Module**
+ - Have a bypass capacitor from its 5V supply to ground; 100 µF works well
+ - Voltage must be between 5V–5.5V, lower supply voltage results in less output power; for example, with a fully charged LiPo at 4.2V, Tx power appears to max out around 26-27 dBm
-- There are several anecdotal recommendations regarding the Tx power the E22's internal SX1262 should be set to in order to achieve the advertised output of 30 dBm, ranging from 4 (per this article in the RadioLib github repo) to 22 (per this conversation from the Meshtastic Discord). When paired with the Xiao BLE in the configurations described above, I observed that the output is at its maximum when Tx power is set to 22.
+### Additional Reading
-- To achieve its full output, the E22 should have a bypass capacitor from its 5V supply to ground. 100 µF works well.
+- [S5NC/CDEBYTE_Modules](https://github.com/S5NC/CDEBYTE_Modules) has additional information about EBYTE E22 modules' internal workings, including photographs
+- [RadioLib High power Radio Modules Guide](https://github.com/jgromes/RadioLib/wiki/High-power-Radio-Modules-Guide)
-- The E22 will happily run on voltages lower than 5V, but the full output power will not be realized. For example, with a fully charged LiPo at 4.2V, Tx power appears to max out around 26-27 dBm.
-
-
-
-## 8. Testing Methodology
+## 6. Testing Methodology
During what became a fairly long trial-and-error process, I did a lot of careful testing of Tx power and Rx sensitivity. My methodology in these tests was as follows:
- All tests were conducted between two nodes:
-
- 1. The Xiao BLE + E22 coupled with an Abracon ARRKP4065-S915A ceramic patch antenna
-
- 2. A RAK 5005/4631 coupled with a Laird MA9-5N antenna via a 4" U.FL to Type N pigtail.
-
+ 1. The XIAO nrf52840 + E22 coupled with an [Abracon ARRKP4065-S915A](https://www.digikey.com/en/products/detail/abracon-llc/ARRKP4065-S915A/8593263") ceramic patch antenna
+ 2. A RAK 5005/4631 coupled with a [Laird MA9-5N](https://www.streakwave.com/laird-technologies-ma9-5n-55dbi-900mhz-mobile-omni-select-mount) antenna via a 4" U.FL to Type N pigtail.
- No other nodes were powered up onsite or nearby.
-
-
-
- Each node and its antenna was kept in exactly the same position and orientation throughout testing.
-
- Other environmental factors (e.g. the location and resting position of my body in the room while testing) were controlled as carefully as possible.
-
- Each test comprised at least five (and often ten) runs, after which the results were averaged.
-
- All testing was done by sending single-character messages between nodes and observing the received RSSI reported in the message acknowledgement. Messages were sent one by one, waiting for each to be acknowledged or time out before sending the next.
-
-- The E22's Tx power was observed by sending messages from the RAK to the Xiao BLE + E22 and recording the received RSSI.
-
-- The opposite was done to observe the E22's Rx sensitivity: messages were sent from the Xiao BLE + E22 to the RAK, and the received RSSI was recorded.
-
-While this cannot match the level of accuracy achievable with actual test equipment in a lab setting, it was nonetheless sufficient to demonstrate the (sometimes very large) differences in Tx power and Rx sensitivity between various configurations.
+- The E22's Tx power was observed by sending messages from the RAK to the XIAO nrf52840 + E22 and recording the received RSSI.
+- The opposite was done to observe the E22's Rx sensitivity: messages were sent from the XIAO nrf52840 + E22 to the RAK, and the received RSSI was recorded.
+ While this cannot match the level of accuracy achievable with actual test equipment in a lab setting, it was nonetheless sufficient to demonstrate the (sometimes very large) differences in Tx power and Rx sensitivity between various configurations.
diff --git a/variants/heltec_vision_master_e213/einkDetect.h b/variants/heltec_vision_master_e213/einkDetect.h
new file mode 100644
index 000000000..35140db60
--- /dev/null
+++ b/variants/heltec_vision_master_e213/einkDetect.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "configuration.h"
+
+enum class EInkDetectionResult : uint8_t {
+ LCMEN213EFC1 = 0, // Initial version
+ E0213A367 = 1, // E213 PCB marked V1.1 (Mid 2025)
+};
+
+EInkDetectionResult detectEInk()
+{
+ // Test 1: Logic of BUSY pin
+
+ // Determines controller IC manufacturer
+ // Fitipower: busy when LOW
+ // Solomon Systech: busy when HIGH
+
+ // Force display BUSY by holding reset pin active
+ pinMode(PIN_EINK_RES, OUTPUT);
+ digitalWrite(PIN_EINK_RES, LOW);
+
+ delay(10);
+
+ // Read whether pin is HIGH or LOW while busy
+ pinMode(PIN_EINK_BUSY, INPUT);
+ bool busyLogic = digitalRead(PIN_EINK_BUSY);
+
+ // Test complete. Release pin
+ pinMode(PIN_EINK_RES, INPUT);
+
+ if (busyLogic == LOW)
+ return EInkDetectionResult::LCMEN213EFC1;
+ else // busy HIGH
+ return EInkDetectionResult::E0213A367;
+}
\ No newline at end of file
diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h
index 5f443e4da..1b1291424 100644
--- a/variants/heltec_vision_master_e213/nicheGraphics.h
+++ b/variants/heltec_vision_master_e213/nicheGraphics.h
@@ -18,16 +18,22 @@
// Shared NicheGraphics components
// --------------------------------
+#include "graphics/niche/Drivers/EInk/E0213A367.h"
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
#include "graphics/niche/Inputs/TwoButton.h"
-// Button feedback
-#include "buzz.h"
+#include "buzz.h" // Button feedback
+#include "einkDetect.h" // Detect display model at runtime
void setupNicheGraphics()
{
using namespace NicheGraphics;
+ // Detect E-Ink Model
+ // -------------------
+
+ EInkDetectionResult displayModel = detectEInk();
+
// SPI
// -----------------------------
@@ -38,7 +44,13 @@ void setupNicheGraphics()
// E-Ink Driver
// -----------------------------
- Drivers::EInk *driver = new Drivers::LCMEN213EFC1;
+ Drivers::EInk *driver;
+
+ if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked)
+ driver = new Drivers::LCMEN213EFC1;
+ else if (displayModel == EInkDetectionResult::E0213A367) // V1.1
+ driver = new Drivers::E0213A367;
+
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
// InkHUD
@@ -51,7 +63,11 @@ void setupNicheGraphics()
// Set how many FAST updates per FULL update
// Set how unhealthy additional FAST updates beyond this number are
- inkhud->setDisplayResilience(10, 1.5);
+
+ if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked)
+ inkhud->setDisplayResilience(10, 1.5);
+ else if (displayModel == EInkDetectionResult::E0213A367) // V1.1
+ inkhud->setDisplayResilience(15, 3);
// Select fonts
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
@@ -91,7 +107,7 @@ void setupNicheGraphics()
buttons->setWiring(1, PIN_BUTTON2);
buttons->setHandlerShortPress(1, [inkhud]() {
inkhud->nextTile();
- playBoop();
+ playChirp();
});
// Begin handling button events
diff --git a/variants/heltec_vision_master_e213/platformio.ini b/variants/heltec_vision_master_e213/platformio.ini
index 34cebb6e3..028caaeff 100644
--- a/variants/heltec_vision_master_e213/platformio.ini
+++ b/variants/heltec_vision_master_e213/platformio.ini
@@ -7,7 +7,8 @@ build_flags =
-Ivariants/heltec_vision_master_e213
-DHELTEC_VISION_MASTER_E213
-DUSE_EINK
- -DEINK_DISPLAY_MODEL=GxEPD2_213_FC1
+ -DGXEPD2_DRIVER_0=GxEPD2_213_FC1
+ -DGXEPD2_DRIVER_1=GxEPD2_213_E0213A367
-DEINK_WIDTH=250
-DEINK_HEIGHT=122
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
@@ -16,7 +17,7 @@ build_flags =
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
lib_deps =
${esp32s3_base.lib_deps}
- https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
+ https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip
lewisxhe/PCF8563_Library@^1.0.1
upload_speed = 115200
diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h
index f29873c15..61b08c740 100644
--- a/variants/heltec_vision_master_e290/nicheGraphics.h
+++ b/variants/heltec_vision_master_e290/nicheGraphics.h
@@ -104,7 +104,7 @@ void setupNicheGraphics()
buttons->setWiring(1, PIN_BUTTON2);
buttons->setHandlerShortPress(1, [inkhud]() {
inkhud->nextTile();
- playBoop();
+ playChirp();
});
// Begin handling button events
diff --git a/variants/heltec_wireless_paper/einkDetect.h b/variants/heltec_wireless_paper/einkDetect.h
new file mode 100644
index 000000000..93b3f86e3
--- /dev/null
+++ b/variants/heltec_wireless_paper/einkDetect.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "configuration.h"
+
+enum class EInkDetectionResult : uint8_t {
+ LCMEN213EFC1 = 0, // V1.1
+ E0213A367 = 1, // V1.1.1, V1.2
+};
+
+EInkDetectionResult detectEInk()
+{
+ // Test 1: Logic of BUSY pin
+
+ // Determines controller IC manufacturer
+ // Fitipower: busy when LOW
+ // Solomon Systech: busy when HIGH
+
+ // Force display BUSY by holding reset pin active
+ pinMode(PIN_EINK_RES, OUTPUT);
+ digitalWrite(PIN_EINK_RES, LOW);
+
+ delay(10);
+
+ // Read whether pin is HIGH or LOW while busy
+ pinMode(PIN_EINK_BUSY, INPUT);
+ bool busyLogic = digitalRead(PIN_EINK_BUSY);
+
+ // Test complete. Release pin
+ pinMode(PIN_EINK_RES, INPUT);
+
+ if (busyLogic == LOW)
+ return EInkDetectionResult::LCMEN213EFC1;
+ else // busy HIGH
+ return EInkDetectionResult::E0213A367;
+}
\ No newline at end of file
diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h
index cbf80bc5e..445b57714 100644
--- a/variants/heltec_wireless_paper/nicheGraphics.h
+++ b/variants/heltec_wireless_paper/nicheGraphics.h
@@ -18,13 +18,21 @@
// Shared NicheGraphics components
// --------------------------------
+#include "graphics/niche/Drivers/EInk/E0213A367.h"
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
#include "graphics/niche/Inputs/TwoButton.h"
+#include "einkDetect.h" // Detect display model at runtime
+
void setupNicheGraphics()
{
using namespace NicheGraphics;
+ // Detect E-Ink Model
+ // -------------------
+
+ EInkDetectionResult displayModel = detectEInk();
+
// SPI
// -----------------------------
@@ -35,7 +43,13 @@ void setupNicheGraphics()
// E-Ink Driver
// -----------------------------
- Drivers::EInk *driver = new Drivers::LCMEN213EFC1;
+ Drivers::EInk *driver;
+
+ if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1
+ driver = new Drivers::LCMEN213EFC1;
+ else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2
+ driver = new Drivers::E0213A367;
+
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
// InkHUD
@@ -48,7 +62,11 @@ void setupNicheGraphics()
// Set how many FAST updates per FULL update
// Set how unhealthy additional FAST updates beyond this number are
- inkhud->setDisplayResilience(10, 1.5);
+
+ if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1 (unmarked)
+ inkhud->setDisplayResilience(10, 1.5);
+ else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2
+ inkhud->setDisplayResilience(15, 3);
// Select fonts
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini
index ce5b5e533..790646056 100644
--- a/variants/heltec_wireless_paper/platformio.ini
+++ b/variants/heltec_wireless_paper/platformio.ini
@@ -7,7 +7,8 @@ build_flags =
${esp32s3_base.build_flags}
-I variants/heltec_wireless_paper
-D HELTEC_WIRELESS_PAPER
- -D EINK_DISPLAY_MODEL=GxEPD2_213_FC1
+ -D GXEPD2_DRIVER_0=GxEPD2_213_FC1
+ -D GXEPD2_DRIVER_1=GxEPD2_213_E0213A367
-D EINK_WIDTH=250
-D EINK_HEIGHT=122
-D USE_EINK
@@ -17,7 +18,7 @@ build_flags =
-D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
lib_deps =
${esp32s3_base.lib_deps}
- https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
+ https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip
lewisxhe/PCF8563_Library@^1.0.1
upload_speed = 115200
diff --git a/variants/rak2560/variant.h b/variants/rak2560/variant.h
index a03fc3933..f922e8a61 100644
--- a/variants/rak2560/variant.h
+++ b/variants/rak2560/variant.h
@@ -222,6 +222,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
// #define PIN_GPS_EN PIN_3V3_EN
#define PIN_GPS_PPS (17) // Pulse per second input from the GPS
+#define GPS_SERIAL_PORT Serial2
// On RAK2560 the GPS is be on a different UART
// #define GPS_RX_PIN PIN_SERIAL2_RX
// #define GPS_TX_PIN PIN_SERIAL2_TX
diff --git a/variants/rak3172/platformio.ini b/variants/rak3172/platformio.ini
index 99610b17c..df2500f31 100644
--- a/variants/rak3172/platformio.ini
+++ b/variants/rak3172/platformio.ini
@@ -7,18 +7,8 @@ build_flags =
-Ivariants/rak3172
-DPIN_WIRE_SDA=PA11
-DPIN_WIRE_SCL=PA12
- -DHAL_DAC_MODULE_ONLY
- -DHAL_RNG_MODULE_ENABLED
- -DRADIOLIB_EXCLUDE_SX128X=1
- -DRADIOLIB_EXCLUDE_SX127X=1
- -DRADIOLIB_EXCLUDE_LR11X0=1
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
-DMESHTASTIC_EXCLUDE_I2C=1
- -DMESHTASTIC_EXCLUDE_WIFI=1
- -DMESHTASTIC_EXCLUDE_BLUETOOTH=1
-DMESHTASTIC_EXCLUDE_GPS=1
- -DMESHTASTIC_EXCLUDE_SCREEN=1
- -DMESHTASTIC_EXCLUDE_MQTT=1
- -DMESHTASTIC_EXCLUDE_POWERMON=1
;-DCFG_DEBUG
upload_port = stlink
diff --git a/variants/rak_wismeshtag/platformio.ini b/variants/rak_wismeshtag/platformio.ini
new file mode 100644
index 000000000..a066e5282
--- /dev/null
+++ b/variants/rak_wismeshtag/platformio.ini
@@ -0,0 +1,15 @@
+; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921
+[env:rak_wismeshtag]
+extends = nrf52840_base
+board = wiscore_rak4631
+board_check = true
+build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtag -D WISMESH_TAG -D RAK_4631
+ -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
+ -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
+ -DRADIOLIB_EXCLUDE_SX128X=1
+ -DRADIOLIB_EXCLUDE_SX127X=1
+ -DRADIOLIB_EXCLUDE_LR11X0=1
+ -DMESHTASTIC_EXCLUDE_WIFI=1
+build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtag>
+lib_deps =
+ ${nrf52840_base.lib_deps}
\ No newline at end of file
diff --git a/variants/rak_wismeshtag/variant.cpp b/variants/rak_wismeshtag/variant.cpp
new file mode 100644
index 000000000..e84b60b3b
--- /dev/null
+++ b/variants/rak_wismeshtag/variant.cpp
@@ -0,0 +1,45 @@
+/*
+ Copyright (c) 2014-2015 Arduino LLC. All right reserved.
+ Copyright (c) 2016 Sandeep Mistry All right reserved.
+ Copyright (c) 2018, Adafruit Industries (adafruit.com)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "variant.h"
+#include "nrf.h"
+#include "wiring_constants.h"
+#include "wiring_digital.h"
+
+const uint32_t g_ADigitalPinMap[] = {
+ // P0
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+
+ // P1
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
+
+void initVariant()
+{
+ // LED1 & LED2
+ pinMode(PIN_LED1, OUTPUT);
+ ledOff(PIN_LED1);
+
+ pinMode(PIN_LED2, OUTPUT);
+ ledOff(PIN_LED2);
+
+ // 3V3 Power Rail
+ pinMode(PIN_3V3_EN, OUTPUT);
+ digitalWrite(PIN_3V3_EN, HIGH);
+}
diff --git a/variants/rak_wismeshtag/variant.h b/variants/rak_wismeshtag/variant.h
new file mode 100644
index 000000000..dd82b76a1
--- /dev/null
+++ b/variants/rak_wismeshtag/variant.h
@@ -0,0 +1,245 @@
+/*
+ Copyright (c) 2014-2015 Arduino LLC. All right reserved.
+ Copyright (c) 2016 Sandeep Mistry All right reserved.
+ Copyright (c) 2018, Adafruit Industries (adafruit.com)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _VARIANT_RAK4630_
+#define _VARIANT_RAK4630_
+
+#define RAK4630
+
+/** Master clock frequency */
+#define VARIANT_MCK (64000000ul)
+
+#define USE_LFXO // Board uses 32khz crystal for LF
+// define USE_LFRC // Board uses RC for LF
+
+/*----------------------------------------------------------------------------
+ * Headers
+ *----------------------------------------------------------------------------*/
+
+#include "WVariant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+// Number of pins defined in PinDescription array
+#define PINS_COUNT (48)
+#define NUM_DIGITAL_PINS (48)
+#define NUM_ANALOG_INPUTS (6)
+#define NUM_ANALOG_OUTPUTS (0)
+
+// LEDs
+#define PIN_LED1 (35)
+#define PIN_LED2 (36)
+
+#define LED_BUILTIN PIN_LED1
+#define LED_CONN PIN_LED2
+
+#define LED_GREEN PIN_LED1
+#define LED_BLUE PIN_LED2
+
+#define LED_STATE_ON 1 // State when LED is litted
+
+/*
+ * Buttons
+ */
+
+#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
+#define BUTTON_NEED_PULLUP
+#define PIN_BUTTON2 12
+#define PIN_BUTTON3 24
+#define PIN_BUTTON4 25
+
+/*
+ * Analog pins
+ */
+#define PIN_A0 (5)
+#define PIN_A1 (31)
+#define PIN_A2 (28)
+#define PIN_A3 (29)
+#define PIN_A4 (30)
+#define PIN_A5 (31)
+#define PIN_A6 (0xff)
+#define PIN_A7 (0xff)
+
+static const uint8_t A0 = PIN_A0;
+static const uint8_t A1 = PIN_A1;
+static const uint8_t A2 = PIN_A2;
+static const uint8_t A3 = PIN_A3;
+static const uint8_t A4 = PIN_A4;
+static const uint8_t A5 = PIN_A5;
+static const uint8_t A6 = PIN_A6;
+static const uint8_t A7 = PIN_A7;
+#define ADC_RESOLUTION 14
+
+// Other pins
+#define PIN_AREF (2)
+#define PIN_NFC1 (9)
+#define PIN_NFC2 (10)
+
+static const uint8_t AREF = PIN_AREF;
+
+/*
+ * Serial interfaces
+ */
+#define PIN_SERIAL1_RX (15)
+#define PIN_SERIAL1_TX (16)
+
+// Connected to Jlink CDC
+#define PIN_SERIAL2_RX (8)
+#define PIN_SERIAL2_TX (6)
+
+/*
+ * SPI Interfaces
+ */
+#define SPI_INTERFACES_COUNT 2
+
+#define PIN_SPI_MISO (45)
+#define PIN_SPI_MOSI (44)
+#define PIN_SPI_SCK (43)
+
+#define PIN_SPI1_MISO (29) // (0 + 29)
+#define PIN_SPI1_MOSI (30) // (0 + 30)
+#define PIN_SPI1_SCK (3) // (0 + 3)
+
+static const uint8_t SS = 42;
+static const uint8_t MOSI = PIN_SPI_MOSI;
+static const uint8_t MISO = PIN_SPI_MISO;
+static const uint8_t SCK = PIN_SPI_SCK;
+
+/*
+ * eink display pins
+ */
+
+#define PIN_EINK_CS (0 + 26)
+#define PIN_EINK_BUSY (0 + 4)
+#define PIN_EINK_DC (0 + 17)
+#define PIN_EINK_RES (-1)
+#define PIN_EINK_SCLK (0 + 3)
+#define PIN_EINK_MOSI (0 + 30) // also called SDI
+
+/*
+ * Wire Interfaces
+ */
+#define WIRE_INTERFACES_COUNT 1
+
+// RAK WISMESHTAG
+#define PIN_WIRE_SDA (25)
+#define PIN_WIRE_SCL (24)
+
+// QSPI Pins
+#define PIN_QSPI_SCK 3
+#define PIN_QSPI_CS 26
+#define PIN_QSPI_IO0 30
+#define PIN_QSPI_IO1 29
+#define PIN_QSPI_IO2 28
+#define PIN_QSPI_IO3 2
+
+
+/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports
+ RAK5005-O <-> nRF52840
+ IO1 <-> P0.17 (Arduino GPIO number 17)
+ IO2 <-> P1.02 (Arduino GPIO number 34)
+ IO3 <-> P0.21 (Arduino GPIO number 21)
+ IO4 <-> P0.04 (Arduino GPIO number 4)
+ IO5 <-> P0.09 (Arduino GPIO number 9)
+ IO6 <-> P0.10 (Arduino GPIO number 10)
+ IO7 <-> P0.28 (Arduino GPIO number 28)
+ SW1 <-> P0.01 (Arduino GPIO number 1)
+ A0 <-> P0.04/AIN2 (Arduino Analog A2
+ A1 <-> P0.31/AIN7 (Arduino Analog A7
+ SPI_CS <-> P0.26 (Arduino GPIO number 26)
+ */
+
+// RAK4630 LoRa module
+
+/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ )
+
+P1.10 NSS SPI NSS (Arduino GPIO number 42)
+P1.11 SCK SPI CLK (Arduino GPIO number 43)
+P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
+P1.13 MISO SPI MISO (Arduino GPIO number 45)
+P1.14 BUSY BUSY signal (Arduino GPIO number 46)
+P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
+P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
+
+Important for successful SX1262 initialization:
+
+* Setup DIO2 to control the antenna switch
+* Setup DIO3 to control the TCXO power supply
+* Setup the SX1262 to use it's DCDC regulator and not the LDO
+* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the
+control of the antenna switch
+
+SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
+
+*/
+
+#define DETECTION_SENSOR_EN 4
+
+#define USE_SX1262
+#define SX126X_CS (42)
+#define SX126X_DIO1 (47)
+#define SX126X_BUSY (46)
+#define SX126X_RESET (38)
+// #define SX126X_TXEN (39)
+// #define SX126X_RXEN (37)
+#define SX126X_POWER_EN (37)
+// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
+#define SX126X_DIO2_AS_RF_SWITCH
+#define SX126X_DIO3_TCXO_VOLTAGE 1.8
+
+// Testing USB detection
+#define NRF_APM
+
+// enables 3.3V periphery like GPS or IO Module
+// Do not toggle this for GPS power savings
+#define PIN_3V3_EN (34)
+
+// RAK WISMESHTAG
+#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
+#define GPS_TX_PIN PIN_SERIAL1_TX
+
+// RAK WISMESHTAG
+#define PIN_BUZZER 21
+
+// Battery
+// The battery sense is hooked to pin A0 (5)
+#define BATTERY_PIN PIN_A0
+// and has 12 bit resolution
+#define BATTERY_SENSE_RESOLUTION_BITS 12
+#define BATTERY_SENSE_RESOLUTION 4096.0
+#undef AREF_VOLTAGE
+#define AREF_VOLTAGE 3.0
+#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
+#define ADC_MULTIPLIER 1.73
+
+#define RAK_4631 1
+
+#ifdef __cplusplus
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * Arduino objects - C++ only
+ *----------------------------------------------------------------------------*/
+
+#endif
\ No newline at end of file
diff --git a/variants/seeed_wio_tracker_L1_eink/platformio.ini b/variants/seeed_wio_tracker_L1_eink/platformio.ini
index b84757b9d..b310cce83 100644
--- a/variants/seeed_wio_tracker_L1_eink/platformio.ini
+++ b/variants/seeed_wio_tracker_L1_eink/platformio.ini
@@ -4,7 +4,8 @@ extends = nrf52840_base, inkhud
;board_level = extra
build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags}
-I $PROJECT_DIR/variants/seeed_wio_tracker_L1_eink
- -D SEEED_WIO_TRACKER_L1
+ -D SEEED_WIO_TRACKER_L1_EINK
+ -D SEEED_WIO_TRACKER_L1
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter}
diff --git a/variants/seeed_xiao_nrf52840_kit/platformio.ini b/variants/seeed_xiao_nrf52840_kit/platformio.ini
index 8c4c5a57b..0e1e94cd5 100644
--- a/variants/seeed_xiao_nrf52840_kit/platformio.ini
+++ b/variants/seeed_xiao_nrf52840_kit/platformio.ini
@@ -1,4 +1,4 @@
-; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893
+; Seeed Xiao BLE: https://wiki.seeedstudio.com/XIAO_BLE/
[env:seeed_xiao_nrf52840_kit]
extends = nrf52840_base
board = xiao_ble_sense
diff --git a/variants/t-deck/variant.h b/variants/t-deck/variant.h
index 9fa0018ec..9b0de631a 100644
--- a/variants/t-deck/variant.h
+++ b/variants/t-deck/variant.h
@@ -68,6 +68,7 @@
#define TB_LEFT 1
#define TB_RIGHT 2
#define TB_PRESS 0 // BUTTON_PIN
+#define TB_DIRECTION FALLING
// microphone
#define ES7210_SCK 47
diff --git a/variants/wio-e5/platformio.ini b/variants/wio-e5/platformio.ini
index 1ef7abd78..5c9f433d4 100644
--- a/variants/wio-e5/platformio.ini
+++ b/variants/wio-e5/platformio.ini
@@ -10,12 +10,12 @@ build_flags =
-DPIN_SERIAL_TX=PB6
-DPIN_WIRE_SDA=PA15
-DPIN_WIRE_SCL=PB15
- -DHAL_DAC_MODULE_ONLY
- -DHAL_RNG_MODULE_ENABLED
- -DRADIOLIB_EXCLUDE_SX128X=1
- -DRADIOLIB_EXCLUDE_SX127X=1
- -DRADIOLIB_EXCLUDE_LR11X0=1
- -DHAS_SENSOR
+ -DHAS_SENSOR=1
+ -DENABLE_HWSERIAL2
+ -DPIN_SERIAL2_TX=PA2
+ -DPIN_SERIAL2_RX=PA3
+ -DHAS_GPS=1
+ -DGPS_SERIAL_PORT=Serial2
upload_port = stlink
diff --git a/variants/wio-e5/variant.h b/variants/wio-e5/variant.h
index 5421eaeb9..6098b4ce6 100644
--- a/variants/wio-e5/variant.h
+++ b/variants/wio-e5/variant.h
@@ -17,6 +17,8 @@ Do not expect a working Meshtastic device with this target.
#define LED_PIN PB5
#define LED_STATE_ON 1
+#define WIO_E5
+
#if (defined(LED_BUILTIN) && LED_BUILTIN == PNUM_NOT_DEFINED)
#undef LED_BUILTIN
#define LED_BUILTIN (LED_PIN)
diff --git a/version.properties b/version.properties
index 69f2d6af5..5de810523 100644
--- a/version.properties
+++ b/version.properties
@@ -1,4 +1,4 @@
[VERSION]
major = 2
minor = 7
-build = 2
+build = 3