Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
#define BOARD_TECHO 0x44
#define MODEL_16 0x16 // T-Echo 433 MHz
#define MODEL_17 0x17 // T-Echo 868/915 MHz

#define PRODUCT_WIO_L1 0x18 // Seeed Wio Tracker L1 devices
#define BOARD_WIO_L1 0x45
#define MODEL_18 0x18 // Wio Tracker L1, 433 MHz
#define MODEL_19 0x19 // Wio Tracker L1, 868/915 MHz

#define PRODUCT_RAK4631 0x10
#define BOARD_RAK4631 0x51
Expand Down Expand Up @@ -809,6 +814,45 @@
const int pin_led_rx = PIN_LED_BLUE;
const int pin_led_tx = PIN_LED_RED;

#elif BOARD_MODEL == BOARD_WIO_L1
#define MODEM SX1262
#define HAS_EEPROM false
#define HAS_DISPLAY true
#define HAS_BLUETOOTH false
#define HAS_BLE true
#define HAS_CONSOLE false
#define HAS_PMU false
#define HAS_NP false
#define HAS_SD false
#define HAS_TCXO true
#define HAS_RF_SWITCH_RX_TX true
#define HAS_BUSY true
#define HAS_INPUT true
#define DIO2_AS_RF_SWITCH true
#define CONFIG_UART_BUFFER_SIZE 6144
#define CONFIG_QUEUE_SIZE 6144
#define CONFIG_QUEUE_MAX_LENGTH 200
#define EEPROM_SIZE 296
#define EEPROM_OFFSET EEPROM_SIZE-EEPROM_RESERVED
#define BLE_MANUFACTURER "Seeed Studio"
#define BLE_MODEL "Wio Tracker L1"

const int pin_btn_usr1 = 13; // Menu key (P0.08)

// SX1262 (Wio-SX1262 module)
const int pin_rxen = 5; // Lora_sw (P1.08)
const int pin_txen = -1;
const int pin_reset = 2; // Lora_rst (P1.07)
const int pin_cs = 4; // Lora_cs (P1.14)
const int pin_sclk = 8; // Lora_sck (P0.30)
const int pin_mosi = 10; // Lora_mosi (P0.28)
const int pin_miso = 9; // Lora_miso (P0.03)
const int pin_busy = 3; // Lora_busy (P1.10)
const int pin_dio = 1; // Lora_dio1 (P0.07)
const int pin_led_rx = 11; // Mesh LED (P1.01)
const int pin_led_tx = 11;
const int pin_tcxo_enable = -1;

#elif BOARD_MODEL == BOARD_HELTEC_T114
#define MODEM SX1262
#define HAS_EEPROM false
Expand Down
3 changes: 2 additions & 1 deletion Console/source/supported.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ The RNode Firmware supports the following boards:
- LilyGO LoRa32 v2.0 devices
- LilyGO LoRa32 v2.1 devices
- Heltec LoRa32 v2 devices
- Seeed Wio Tracker L1 devices (915 MHz)
- Homebrew RNodes based on ATmega1284p boards
- Homebrew RNodes based on ATmega2560 boards
- Homebrew RNodes based on Adafruit Feather ESP32 boards
- Homebrew RNodes based on generic ESP32 boards

## Supported Transceiver Modules
The RNode Firmware supports all transceiver modules based on **Semtech SX1276** or **Semtech SX1278** chips, that have an **SPI interface** and expose the **DIO_0** interrupt pin from the chip.
The RNode Firmware supports all transceiver modules based on **Semtech SX1276** or **Semtech SX1278** chips, that have an **SPI interface** and expose the **DIO_0** interrupt pin from the chip.
25 changes: 21 additions & 4 deletions Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#elif BOARD_MODEL == BOARD_HELTEC_T114
#include "ST7789.h"
#define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3))
#elif BOARD_MODEL == BOARD_TBEAM_S_V1
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_WIO_L1
#include <Adafruit_SH110X.h>
#else
#include <Wire.h>
Expand Down Expand Up @@ -71,6 +71,12 @@
#define DISP_ADDR 0x3C
#define SCL_OLED 14
#define SDA_OLED 13
#elif BOARD_MODEL == BOARD_WIO_L1
#define DISP_RST -1
#define DISP_ADDR 0x3D
#define SCL_OLED 15
#define SDA_OLED 14
#define DISP_CUSTOM_ADDR true
#elif BOARD_MODEL == BOARD_RNODE_NG_21
#define DISP_RST -1
#define DISP_ADDR 0x3C
Expand Down Expand Up @@ -112,7 +118,7 @@
ST7789Spi display(&SPI1, DISPLAY_RST, DISPLAY_DC, DISPLAY_CS);
#define SSD1306_WHITE ST77XX_WHITE
#define SSD1306_BLACK ST77XX_BLACK
#elif BOARD_MODEL == BOARD_TBEAM_S_V1
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_WIO_L1
Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire, -1);
#define SSD1306_WHITE SH110X_WHITE
#define SSD1306_BLACK SH110X_BLACK
Expand Down Expand Up @@ -225,7 +231,7 @@ void update_area_positions() {
}

uint8_t display_contrast = 0x00;
#if BOARD_MODEL == BOARD_TBEAM_S_V1
#if BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_WIO_L1
void set_contrast(Adafruit_SH1106G *display, uint8_t value) {
}
#elif BOARD_MODEL == BOARD_HELTEC_T114
Expand Down Expand Up @@ -323,6 +329,8 @@ bool display_init() {
Wire.begin(SDA_OLED, SCL_OLED);
#elif BOARD_MODEL == BOARD_XIAO_S3
Wire.begin(SDA_OLED, SCL_OLED);
#elif BOARD_MODEL == BOARD_WIO_L1
Wire.begin();
#endif

#if HAS_EEPROM
Expand Down Expand Up @@ -376,7 +384,7 @@ bool display_init() {
// set white as default pixel colour for Heltec T114
display.setRGB(COLOR565(0xFF, 0xFF, 0xFF));
if (false) {
#elif BOARD_MODEL == BOARD_TBEAM_S_V1
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_WIO_L1
if (!display.begin(display_address, true)) {
#else
if (!display.begin(SSD1306_SWITCHCAPVCC, display_address)) {
Expand Down Expand Up @@ -440,6 +448,15 @@ bool display_init() {
#endif
}

#if BOARD_MODEL == BOARD_WIO_L1
// Force a clean OLED state on boot to clear any prior firmware remnants.
display.clearDisplay();
display.display();
delay(25);
display.clearDisplay();
display.display();
#endif

update_area_positions();

for (int i = 0; i < WATERFALL_SIZE; i++) { waterfall[i] = 0; }
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ prep-nrf:
arduino-cli core install rakwireless:nrf52 --config-file arduino-cli.yaml
arduino-cli core install Heltec_nRF52:Heltec_nRF52 --config-file arduino-cli.yaml
arduino-cli core install adafruit:nrf52 --config-file arduino-cli.yaml
arduino-cli lib install "Adafruit GFX Library"
arduino-cli lib install "Adafruit SSD1306"
arduino-cli lib install "Adafruit SH110X"
arduino-cli lib install "Crypto"
arduino-cli lib install "GxEPD2"
arduino-cli config set library.enable_unsafe_install true
arduino-cli lib install --git-url https://github.com/liamcottle/esp8266-oled-ssd1306#e16cee124fe26490cb14880c679321ad8ac89c95
Expand Down Expand Up @@ -149,6 +153,9 @@ firmware-heltec_t114:
firmware-techo:
arduino-cli compile --log --fqbn adafruit:nrf52:pca10056 -e --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\""

firmware-wio_l1:
arduino-cli compile --log --fqbn Seeeduino:nrf52:seeed_wio_tracker_L1 -e --build-cache-path /tmp/arduino-cache-$${USER} --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x45\""

firmware-xiao_s3:
arduino-cli compile --log --fqbn "esp32:esp32:XIAO_ESP32S3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3E\""

Expand Down Expand Up @@ -515,4 +522,4 @@ release-xiao_s3:
cp build/esp32.esp32.XIAO_ESP32S3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_xiao_esp32s3.bootloader
cp build/esp32.esp32.XIAO_ESP32S3/RNode_Firmware.ino.partitions.bin build/rnode_firmware_xiao_esp32s3.partitions
zip --junk-paths ./Release/rnode_firmware_xiao_esp32s3.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_xiao_esp32s3.boot_app0 build/rnode_firmware_xiao_esp32s3.bin build/rnode_firmware_xiao_esp32s3.bootloader build/rnode_firmware_xiao_esp32s3.partitions
rm -r build
rm -r build
26 changes: 25 additions & 1 deletion Power.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,23 @@ float pmu_temperature = PMU_TEMP_MIN-1;
bool bat_voltage_dropping = false;
float bat_delay_v = 0;
float bat_state_change_v = 0;
#elif BOARD_MODEL == BOARD_WIO_L1
#define BAT_V_MIN 3.15
#define BAT_V_MAX 4.2
#define BAT_V_CHG 4.48
#define BAT_V_FLOAT 4.33
#define BAT_SAMPLES 7
const uint8_t pin_vbat = 16; // D16, P0.31
const uint8_t pin_ctrl = 30; // D30, P0.04 (BAT_adc_CTR)
float bat_p_samples[BAT_SAMPLES];
float bat_v_samples[BAT_SAMPLES];
uint8_t bat_samples_count = 0;
int bat_discharging_samples = 0;
int bat_charging_samples = 0;
int bat_charged_samples = 0;
bool bat_voltage_dropping = false;
float bat_delay_v = 0;
float bat_state_change_v = 0;
#endif

uint32_t last_pmu_update = 0;
Expand All @@ -202,7 +219,7 @@ void measure_temperature() {
}

void measure_battery() {
#if BOARD_MODEL == BOARD_RNODE_NG_21 || BOARD_MODEL == BOARD_LORA32_V2_1 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC_T114 || BOARD_MODEL == BOARD_TECHO
#if BOARD_MODEL == BOARD_RNODE_NG_21 || BOARD_MODEL == BOARD_LORA32_V2_1 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC_T114 || BOARD_MODEL == BOARD_TECHO || BOARD_MODEL == BOARD_WIO_L1
battery_installed = true;
#if BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4
battery_indeterminate = false;
Expand All @@ -220,6 +237,8 @@ void measure_battery() {
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.017165;
#elif BOARD_MODEL == BOARD_TECHO
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.007067;
#elif BOARD_MODEL == BOARD_WIO_L1
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.00704;
#else
float battery_measurement = (float)(analogRead(pin_vbat)) / 4095.0*7.26;
#endif
Expand Down Expand Up @@ -414,6 +433,11 @@ bool init_pmu() {
#if BOARD_MODEL == BOARD_RNODE_NG_21 || BOARD_MODEL == BOARD_LORA32_V2_1 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_TECHO
pinMode(pin_vbat, INPUT);
return true;
#elif BOARD_MODEL == BOARD_WIO_L1
pinMode(pin_ctrl, OUTPUT);
digitalWrite(pin_ctrl, HIGH);
pinMode(pin_vbat, INPUT);
return true;
#elif BOARD_MODEL == BOARD_HELTEC32_V3
// there are three version of V3: V3, V3.1, and V3.2
// V3 and V3.1 have a pull up on pin_ctrl and are active low
Expand Down
2 changes: 1 addition & 1 deletion RNode_Firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void setup() {
boot_seq();
#endif

#if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_HELTEC_T114 && BOARD_MODEL != BOARD_TECHO && BOARD_MODEL != BOARD_T3S3 && BOARD_MODEL != BOARD_TBEAM_S_V1 && BOARD_MODEL != BOARD_HELTEC32_V4
#if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_HELTEC_T114 && BOARD_MODEL != BOARD_TECHO && BOARD_MODEL != BOARD_T3S3 && BOARD_MODEL != BOARD_TBEAM_S_V1 && BOARD_MODEL != BOARD_HELTEC32_V4 && BOARD_MODEL != BOARD_WIO_L1
// Some boards need to wait until the hardware UART is set up before booting
// the full firmware. In the case of the RAK4631 and Heltec T114, the line below will wait
// until a serial connection is actually established with a master. Thus, it
Expand Down
16 changes: 14 additions & 2 deletions Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ uint8_t boot_vector = 0x00;
void led_tx_off() { digitalWrite(pin_led_tx, LED_OFF); }
void led_id_on() { }
void led_id_off() { }
#elif BOARD_MODEL == BOARD_WIO_L1
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
void led_id_on() { }
void led_id_off() { }
#endif
#endif

Expand Down Expand Up @@ -1381,6 +1388,9 @@ void setTXPower() {
if (model == MODEL_E3) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_E8) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);

if (model == MODEL_18) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_19) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);

if (model == MODEL_FE) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_FF) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN);
}
Expand Down Expand Up @@ -1597,7 +1607,7 @@ bool eeprom_product_valid() {
#elif PLATFORM == PLATFORM_ESP32
if (rval == PRODUCT_RNODE || rval == BOARD_RNODE_NG_20 || rval == BOARD_RNODE_NG_21 || rval == PRODUCT_HMBRW || rval == PRODUCT_TBEAM || rval == PRODUCT_T32_10 || rval == PRODUCT_T32_20 || rval == PRODUCT_T32_21 || rval == PRODUCT_H32_V2 || rval == PRODUCT_H32_V3 || rval == PRODUCT_H32_V4 || rval == PRODUCT_TDECK_V1 || rval == PRODUCT_TBEAM_S_V1 || rval == PRODUCT_XIAO_S3) {
#elif PLATFORM == PLATFORM_NRF52
if (rval == PRODUCT_RAK4631 || rval == PRODUCT_HELTEC_T114 || rval == PRODUCT_TECHO || rval == PRODUCT_HMBRW) {
if (rval == PRODUCT_RAK4631 || rval == PRODUCT_HELTEC_T114 || rval == PRODUCT_TECHO || rval == PRODUCT_WIO_L1 || rval == PRODUCT_HMBRW) {
#else
if (false) {
#endif
Expand Down Expand Up @@ -1649,6 +1659,8 @@ bool eeprom_model_valid() {
if (model == MODEL_C6 || model == MODEL_C7) {
#elif BOARD_MODEL == BOARD_RAK4631
if (model == MODEL_11 || model == MODEL_12) {
#elif BOARD_MODEL == BOARD_WIO_L1
if (model == MODEL_18 || model == MODEL_19) {
#elif BOARD_MODEL == BOARD_HUZZAH32
if (model == MODEL_FF) {
#elif BOARD_MODEL == BOARD_GENERIC_ESP32
Expand Down Expand Up @@ -2019,4 +2031,4 @@ void host_disconnected() {
last_rssi = -292;
last_rssi_raw = 0x00;
last_snr_raw = 0x80;
}
}
1 change: 1 addition & 0 deletions arduino-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ board_manager:
- https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json
- https://github.com/HelTecAutomation/Heltec_nRF52/releases/download/1.7.0/package_heltec_nrf_index.json
- https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
- http://unsigned.io/arduino/package_unsignedio_UnsignedBoards_index.json
96 changes: 96 additions & 0 deletions boards/seeed_wio_tracker_L1/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* variant.cpp - Digital pin mapping for TRACKER L1
*
* This file defines the pin mapping array that maps logical digital pins (D0-D17)
* to physical GPIO ports/pins on the Nordic nRF52 series microcontroller.
*
* Board: [Seeed Studio WIO TRACKER L1]
* Hardware Features:
* - LoRa module (CS/SCK/MISO/MOSI control pins)
* - GNSS module (TX/RX/Reset/Wakeup)
* - User LEDs (D11-D12)
* - User button (D13)
* - Grove/NFC interface (D14-D15)
* - Battery voltage monitoring (D16)
*
* Created [20250521]
* By [Dylan]
*/

#include "variant.h"
#include "nrf.h"
#include "wiring_constants.h"
#include "wiring_digital.h"

/**
* @brief Digital pin to GPIO port/pin mapping table
*
* Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx)
*
*/

extern "C" {
const uint32_t g_ADigitalPinMap[] = {
// D0 .. D10 - Peripheral control pins
41, // D0 P1.09 GNSS_WAKEUP
7, // D1 P0.07 LORA_DIO1
39, // D2 P1,07 LORA_RESET
42, // D3 P1.10 LORA_BUSY
46, // D4 P1.14 (A4/SDA) LORA_CS
40, // D5 P1.08 (A5/SCL) LORA_SW
27, // D6 P0.27 (UART_TX) GNSS_TX
26, // D7 P0.26 (UART_RX) GNSS_RX
30, // D8 P0.30 (SPI_SCK) LORA_SCK
3, // D9 P0.3 (SPI_MISO) LORA_MISO
28, // D10 P0.28 (SPI_MOSI) LORA_MOSI

// D11-D12 - LED outputs
33, // D11 P1.1 User LED
// Buzzzer
32, // D12 P1.0 Buzzer

// D13 - User input
8, // D13 P0.08 User Button

// D14-D15 - Grove interface
6, // D14 P0.06 OLED SDA
5, // D15 P0.05 OLED SCL

// D16 - Battery voltage ADC input
31, // D16 P0.31 VBAT_ADC
// GROVE
43, // D17 P0.00 GROVESDA
44, // D18 P0.01 GROVESCL

// FLASH
21, // D19 P0.21 (QSPI_SCK)
25, // D20 P0.25 (QSPI_CSN)
20, // D21 P0.20 (QSPI_SIO_0 DI)
24, // D22 P0.24 (QSPI_SIO_1 DO)
22, // D23 P0.22 (QSPI_SIO_2 WP)
23, // D24 P0.23 (QSPI_SIO_3 HOLD)

36, // D25 TB_UP
12, // D26 TB_DOWN
11, // D27 TB_LEFT
35, // D28 TB_RIGHT
37, // D29 TB_PRESS
4, // D30 BAT_CTL
};
}

void initVariant()
{
pinMode(PIN_QSPI_CS, OUTPUT);
digitalWrite(PIN_QSPI_CS, HIGH);
// This setup is crucial for ensuring low power consumption and proper initialization of the hardware components.
// VBAT_ENABLE
pinMode(BAT_READ, OUTPUT);
digitalWrite(BAT_READ, HIGH);

pinMode(PIN_LED1, OUTPUT);
digitalWrite(PIN_LED1, LOW);
pinMode(PIN_LED2, OUTPUT);
digitalWrite(PIN_LED2, LOW);
pinMode(PIN_LED2, OUTPUT);
}
Loading