Compare commits

..

21 Commits

Author SHA1 Message Date
2a6eacb151 TX power clamping for MODEL_FD 2026-04-26 18:17:37 +03:00
e6983eaf07 Added model for 33dBm E22 boards 2026-04-26 18:17:08 +03:00
af8647d239 Added MeshPoE-S3 board 2026-04-26 10:30:50 +03:00
91df82b6cf Added LilyGo T-Beam Supreme V3 2026-04-26 10:30:50 +03:00
d7594dfa03 Increase OCP limit 2026-04-26 10:30:47 +03:00
d925afc2f8 Added Heltec V4.3 support/FEM autodetection 2026-04-26 10:29:28 +03:00
e1029912e6 Added TXEN pin handling for sx126x 2026-04-26 10:11:11 +03:00
d31c6f8168 fallback tx_power increased from 17 to 20 2026-04-26 10:11:11 +03:00
7ae7aa659d Updated README.md 2026-04-26 10:11:00 +03:00
94c33be6b4 Updated README.md 2026-04-26 10:06:51 +03:00
c080295b49 PMU edits 2026-04-26 10:05:26 +03:00
46c04649ca Added MeshAdventurer-S3 and DIY-V1 variants 2026-04-26 10:05:26 +03:00
7f5b20d028 Initial commit 2026-04-26 10:05:21 +03:00
Mark Qvist
d39339f8ec Updated readme 2026-04-24 12:26:35 +02:00
Mark Qvist
9b39b6ce59 Prepare release 2026-04-24 10:42:13 +02:00
Mark Qvist
3167a3e679 Cleanup 2026-04-21 00:33:53 +02:00
Mark Qvist
fe594b2048 Turn off display on T114 2026-04-21 00:33:18 +02:00
Mark Qvist
9fd0ae33d2 Added support for Heltec v4.3 PA and LNA 2026-04-20 17:16:39 +02:00
Mark Qvist
0c07c1b856 Updated version 2026-04-19 15:10:06 +02:00
markqvist
ae0434726b Merge pull request #132 from GlassOnTin/sx1262-errata-fixes
Fix SX1262 errata 15.4 (IQ polarity) and 15.1 (modulation quality)
2026-04-19 14:50:16 +02:00
GlassOnTin
5d2f0b93e3 Fix SX1262 errata 15.4 (IQ polarity) and 15.1 (modulation quality)
Errata 15.4: SetPacketParams resets register 0x0736 to an incorrect
default for IQ polarity. For standard IQ (no inversion), bit 2 must
be SET after every SetPacketParams call. Without this, LoRa RX
demodulation can fail silently while TX continues to work — the
symptom mimics a hardware failure.

Errata 15.1: Register 0x0889 bit 2 controls modulation quality at
different bandwidths. It must be cleared for 500 kHz BW and set for
all others. The previous implementation was a no-op stub.

Both fixes are from the SX1262 datasheet errata (DS_SX1261-2_V2.1)
and apply to all SX1262-based boards.
2026-03-29 17:53:28 +01:00
15 changed files with 465 additions and 388 deletions

131
Boards.h
View File

@@ -61,7 +61,9 @@
#define MODEL_D9 0xD9 // LilyGO T-Deck, 868 MHz #define MODEL_D9 0xD9 // LilyGO T-Deck, 868 MHz
#define PRODUCT_TBEAM_S_V1 0xEA #define PRODUCT_TBEAM_S_V1 0xEA
#define PRODUCT_TBEAM_S_V3 0xEC
#define BOARD_TBEAM_S_V1 0x3D #define BOARD_TBEAM_S_V1 0x3D
#define BOARD_TBEAM_S_V3 0x43
#define MODEL_DB 0xDB // LilyGO T-Beam Supreme, 433 MHz #define MODEL_DB 0xDB // LilyGO T-Beam Supreme, 433 MHz
#define MODEL_DC 0xDC // LilyGO T-Beam Supreme, 868 MHz #define MODEL_DC 0xDC // LilyGO T-Beam Supreme, 868 MHz
@@ -119,9 +121,11 @@
#define BOARD_HUZZAH32 0x34 #define BOARD_HUZZAH32 0x34
#define BOARD_GENERIC_ESP32 0x35 #define BOARD_GENERIC_ESP32 0x35
#define BOARD_GENERIC_NRF52 0x50 #define BOARD_GENERIC_NRF52 0x50
#define MODEL_FD 0xFD // Homebrew board with E22-xxxM33S, max 33dBm output power (clamped max txpower to 8)
#define MODEL_FE 0xFE // Homebrew board, max 17dBm output power #define MODEL_FE 0xFE // Homebrew board, max 17dBm output power
#define MODEL_FF 0xFF // Homebrew board, max 14dBm output power #define MODEL_FF 0xFF // Homebrew board, max 14dBm output power
#define BOARD_MESHPOE_S3 0xF1 // MeshPoE-S3
#define BOARD_MESHADVENTURER_S3 0xF2 // MeshAdventurer-S3 #define BOARD_MESHADVENTURER_S3 0xF2 // MeshAdventurer-S3
#define BOARD_AETHERNODE 0xF3 // Aethernode #define BOARD_AETHERNODE 0xF3 // Aethernode
#define BOARD_MESHADVENTURER 0xF4 // MeshAdventurer #define BOARD_MESHADVENTURER 0xF4 // MeshAdventurer
@@ -155,6 +159,10 @@
#endif #endif
#endif #endif
#define LORA_PA_UNKNOWN 0x00
#define LORA_PA_GC1109 0x01
#define LORA_PA_KCT8103L 0x02
#define HAS_DISPLAY false #define HAS_DISPLAY false
#define HAS_BLUETOOTH false #define HAS_BLUETOOTH false
#define HAS_BLE false #define HAS_BLE false
@@ -251,6 +259,49 @@
const int pin_led_rx = 2; const int pin_led_rx = 2;
const int pin_led_tx = 4; const int pin_led_tx = 4;
#elif BOARD_MODEL == BOARD_MESHPOE_S3
#define IS_ESP32S3 true
#define HAS_DISPLAY true
#define HAS_NP true
#define HAS_BLUETOOTH false
#define HAS_BLE true
#define HAS_WIFI true
#define HAS_CONSOLE true
#define HAS_EEPROM true
#define HAS_BUSY true
#define HAS_INPUT true
#define HAS_TCXO true
#define MODEM SX1262
#define DIO2_AS_RF_SWITCH true
#define HAS_RF_SWITCH_RX_TX false
#define HAS_LORA_LNA true
#define LORA_LNA_GAIN 30
#define LORA_LNA_GVT 14
const int pin_cs = 39;
const int pin_sclk = 38;
const int pin_miso = 36;
const int pin_mosi = 37;
const int pin_busy = 34;
const int pin_reset = 35;
const int pin_dio = 33;
const int pin_txen = 43;
const int pin_rxen = 44;
const int pin_tcxo_enable = -1;
const int pin_btn_usr1 = 40;
const int pin_np = 48;
#if HAS_NP == false
#if defined(EXTERNAL_LEDS)
const int pin_led_rx = 48;
const int pin_led_tx = 48;
#else
const int pin_led_rx = 48;
const int pin_led_tx = 48;
#endif
#endif
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
#define IS_ESP32S3 true #define IS_ESP32S3 true
#define HAS_DISPLAY true #define HAS_DISPLAY true
@@ -373,10 +424,10 @@
const int pin_miso = 19; const int pin_miso = 19;
const int pin_mosi = 23; const int pin_mosi = 23;
const int pin_busy = 32; const int pin_busy = 32;
const int pin_reset = 34; const int pin_reset = 25;
const int pin_dio = 33; const int pin_dio = 33;
const int pin_txen = -1; const int pin_rxen = 16;
const int pin_rxen = -1; const int pin_txen = 17;
const int pin_tcxo_enable = -1; const int pin_tcxo_enable = -1;
const int pin_btn_usr1 = 39; const int pin_btn_usr1 = 39;
@@ -387,6 +438,7 @@
#define HAS_DISPLAY true #define HAS_DISPLAY true
#define HAS_PMU true #define HAS_PMU true
#define HAS_BLUETOOTH true #define HAS_BLUETOOTH true
#define HAS_WIFI true
#define HAS_CONSOLE true #define HAS_CONSOLE true
#define HAS_SD false #define HAS_SD false
#define HAS_EEPROM true #define HAS_EEPROM true
@@ -406,7 +458,7 @@
#define HAS_TCXO true #define HAS_TCXO true
#define HAS_BUSY true #define HAS_BUSY true
#define DIO2_AS_RF_SWITCH true #define DIO2_AS_RF_SWITCH true
#define OCP_TUNED 0x18 #define OCP_TUNED 0x28
const int pin_busy = 32; const int pin_busy = 32;
const int pin_dio = 33; const int pin_dio = 33;
const int pin_tcxo_enable = -1; const int pin_tcxo_enable = -1;
@@ -512,7 +564,7 @@
#define HAS_SLEEP true #define HAS_SLEEP true
#define PIN_WAKEUP GPIO_NUM_0 #define PIN_WAKEUP GPIO_NUM_0
#define WAKEUP_LEVEL 0 #define WAKEUP_LEVEL 0
#define OCP_TUNED 0x18 #define OCP_TUNED 0x28
const int pin_btn_usr1 = 0; const int pin_btn_usr1 = 0;
@@ -554,8 +606,9 @@
#define HAS_LORA_LNA true #define HAS_LORA_LNA true
#define PIN_WAKEUP GPIO_NUM_0 #define PIN_WAKEUP GPIO_NUM_0
#define WAKEUP_LEVEL 0 #define WAKEUP_LEVEL 0
#define OCP_TUNED 0x18 #define OCP_TUNED 0x28
#define Vext GPIO_NUM_36 #define Vext GPIO_NUM_36
#define LORA_PA_MODEL LORA_PA_UNKNOWN;
const int pin_btn_usr1 = 0; const int pin_btn_usr1 = 0;
@@ -577,14 +630,17 @@
#define LORA_LNA_GAIN 17 #define LORA_LNA_GAIN 17
#define LORA_LNA_GVT 12 #define LORA_LNA_GVT 12
#define LORA_PA_GC1109 true
#define LORA_PA_PWR_EN 7 #define LORA_PA_PWR_EN 7
#define LORA_PA_CSD 2 #define LORA_PA_CSD 2 // Same pin on GC1109
#define LORA_PA_CPS 46 #define LORA_PA_CPS 46 // Same pin on GC1109
#define LORA_PA_CTX 5 // Only used on KCT8103
#define PA_MAX_OUTPUT 28 #define PA_MAX_OUTPUT 28
#define PA_GAIN_POINTS 22 #define PA_GAIN_POINTS 22
#define PA_GAIN_VALUES 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
#define LORA_LNA_KCT8103L_GAIN 21
const int PA_GC1109_VALUES[PA_GAIN_POINTS] = {11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7};
const int PA_KCT8103L_VALUES[PA_GAIN_POINTS] = {13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 10, 9, 8, 7};
const int pin_cs = 8; const int pin_cs = 8;
const int pin_busy = 13; const int pin_busy = 13;
@@ -768,6 +824,59 @@
#endif #endif
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1
#define IS_ESP32S3 true
#define MODEM SX1262
#define DIO2_AS_RF_SWITCH true
#define HAS_BUSY true
#define HAS_TCXO true
#define OCP_TUNED 0x28
#define HAS_DISPLAY true
#define HAS_CONSOLE true
#define HAS_WIFI true
#define HAS_BLUETOOTH false
#define HAS_BLE true
#define HAS_PMU true
#define HAS_NP false
#define HAS_SD false
#define HAS_EEPROM true
#define HAS_INPUT true
#define HAS_SLEEP false
#define PMU_IRQ 40
#define I2C_SCL 41
#define I2C_SDA 42
const int pin_btn_usr1 = 0;
const int pin_cs = 10;
const int pin_reset = 5;
const int pin_sclk = 12;
const int pin_mosi = 11;
const int pin_miso = 13;
const int pin_tcxo_enable = -1;
const int pin_dio = 1;
const int pin_busy = 4;
const int SD_MISO = 37;
const int SD_MOSI = 35;
const int SD_CLK = 36;
const int SD_CS = 47;
const int IMU_CS = 34;
#if HAS_NP == false
#if defined(EXTERNAL_LEDS)
const int pin_led_rx = 43;
const int pin_led_tx = 43;
#else
const int pin_led_rx = 43;
const int pin_led_tx = 43;
#endif
#endif
#elif BOARD_MODEL == BOARD_TBEAM_S_V3
#define IS_ESP32S3 true #define IS_ESP32S3 true
#define MODEM SX1262 #define MODEM SX1262
#define DIO2_AS_RF_SWITCH true #define DIO2_AS_RF_SWITCH true
@@ -1132,7 +1241,7 @@
// Default OCP value if not specified // Default OCP value if not specified
// in board configuration // in board configuration
#ifndef OCP_TUNED #ifndef OCP_TUNED
#define OCP_TUNED 0x18 #define OCP_TUNED 0x28
#endif #endif
#ifndef NP_M #ifndef NP_M

View File

@@ -20,7 +20,7 @@
#define CONFIG_H #define CONFIG_H
#define MAJ_VERS 0x01 #define MAJ_VERS 0x01
#define MIN_VERS 0x55 #define MIN_VERS 0x56
#define MODE_HOST 0x11 #define MODE_HOST 0x11
#define MODE_TNC 0x12 #define MODE_TNC 0x12
@@ -115,7 +115,7 @@
#if BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER #if BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER
#define CSMA_INFR_THRESHOLD_DB 14 #define CSMA_INFR_THRESHOLD_DB 14
#elif BOARD_MODEL == BOARD_PROMICRO #elif BOARD_MODEL == BOARD_PROMICRO
#define CSMA_INFR_THRESHOLD_DB 13 #define CSMA_INFR_THRESHOLD_DB 20
#else #else
#define CSMA_INFR_THRESHOLD_DB 11 #define CSMA_INFR_THRESHOLD_DB 11
#endif #endif

View File

@@ -4,10 +4,10 @@ import sys
import shutil import shutil
packages = { packages = {
"rns": "rns-1.0.3-py3-none-any.whl", "rns": "rns-1.1.9-py3-none-any.whl",
"nomadnet": "nomadnet-0.9.1-py3-none-any.whl", "nomadnet": "nomadnet-0.9.11-py3-none-any.whl",
"lxmf": "lxmf-0.9.3-py3-none-any.whl", "lxmf": "lxmf-0.9.6-py3-none-any.whl",
"rnsh": "rnsh-0.1.5-py3-none-any.whl", "rnsh": "rnsh-0.1.9-py3-none-any.whl",
} }
DEFAULT_TITLE = "RNode Bootstrap Console" DEFAULT_TITLE = "RNode Bootstrap Console"
@@ -194,8 +194,29 @@ def optimise_manual(path):
("_images/meshchat_1.webp", pm), ("_images/meshchat_1.webp", pm),
("_images/radio_is5ac.png", pm), ("_images/radio_is5ac.png", pm),
("_images/radio_rblhg5.png", pm), ("_images/radio_rblhg5.png", pm),
("_images/rbrowser.webp", pm),
("_images/rnphone.webp", pm),
("_images/retibbs.webp", pm),
("_images/meshchatx.webp", pm),
("_images/lxst_phone.webp", pm),
("_images/columba.webp", pm),
("_static/rns_logo_512.png", 256), ("_static/rns_logo_512.png", 256),
("../images/bg_h_1.webp", pm), ("../images/bg_h_1.webp", pm),
("../../images/3_conv.webp", pm/2),
("../../images/an1.webp", pm/2),
("../../images/bg1ds1.webp", pm/2),
("../../images/bg1ds2.webp", pm/2),
("../../images/bg_h_1.webp", pm/2),
("../../images/bg_h_2.webp", pm/2),
("../../images/g1p.webp", pm/2),
("../../images/g2p.webp", pm/2),
("../../images/g3p.webp", pm/2),
("../../images/g4p.webp", pm/2),
("../../images/lora_rnodes.webp", pm/2),
("../../images/nn_an.webp", pm/2),
("../../images/nn_conv.webp", pm/2),
("../../images/nn_init.webp", pm/2),
] ]
import subprocess import subprocess

View File

@@ -22,7 +22,7 @@
#elif BOARD_MODEL == BOARD_HELTEC_T114 #elif BOARD_MODEL == BOARD_HELTEC_T114
#include "ST7789.h" #include "ST7789.h"
#define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) #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_TBEAM_S_V3
#include <Adafruit_SH110X.h> #include <Adafruit_SH110X.h>
#else #else
#include <Wire.h> #include <Wire.h>
@@ -53,7 +53,7 @@
#elif BOARD_MODEL == BOARD_HELTEC32_V2 || BOARD_MODEL == BOARD_LORA32_V1_0 #elif BOARD_MODEL == BOARD_HELTEC32_V2 || BOARD_MODEL == BOARD_LORA32_V1_0
#define DISP_RST 16 #define DISP_RST 16
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
#define OBSCL_OLED 15 #define SCL_OLED 15
#define SDA_OLED 4 #define SDA_OLED 4
#elif BOARD_MODEL == BOARD_HELTEC32_V3 #elif BOARD_MODEL == BOARD_HELTEC32_V3
#define DISP_RST 21 #define DISP_RST 21
@@ -70,10 +70,15 @@
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
#define SCL_OLED 22 #define SCL_OLED 22
#define SDA_OLED 11 #define SDA_OLED 11
#elif BOARD_MODEL == BOARD_MESHPOE_S3
#define DISP_RST -1
#define DISP_ADDR 0x3C
#define SCL_OLED 1
#define SDA_OLED 0
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
#define DISP_RST -1 #define DISP_RST -1
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
#define SCL_OLED 44 #define SCL_OLED 0
#define SDA_OLED 42 #define SDA_OLED 42
#elif BOARD_MODEL == BOARD_MESHADVENTURER #elif BOARD_MODEL == BOARD_MESHADVENTURER
#define DISP_RST -1 #define DISP_RST -1
@@ -120,6 +125,12 @@
#define SCL_OLED 18 #define SCL_OLED 18
#define SDA_OLED 17 #define SDA_OLED 17
#define DISP_CUSTOM_ADDR false #define DISP_CUSTOM_ADDR false
#elif BOARD_MODEL == BOARD_TBEAM_S_V3
#define DISP_RST -1
#define DISP_ADDR 0x3D
#define SCL_OLED 18
#define SDA_OLED 17
#define DISP_CUSTOM_ADDR false
#elif BOARD_MODEL == BOARD_XIAO_S3 #elif BOARD_MODEL == BOARD_XIAO_S3
#define DISP_RST -1 #define DISP_RST -1
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
@@ -142,7 +153,7 @@
ST7789Spi display(&SPI1, DISPLAY_RST, DISPLAY_DC, DISPLAY_CS); ST7789Spi display(&SPI1, DISPLAY_RST, DISPLAY_DC, DISPLAY_CS);
#define SSD1306_WHITE ST77XX_WHITE #define SSD1306_WHITE ST77XX_WHITE
#define SSD1306_BLACK ST77XX_BLACK #define SSD1306_BLACK ST77XX_BLACK
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire, -1); Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire, -1);
#define SSD1306_WHITE SH110X_WHITE #define SSD1306_WHITE SH110X_WHITE
#define SSD1306_BLACK SH110X_BLACK #define SSD1306_BLACK SH110X_BLACK
@@ -255,7 +266,7 @@ void update_area_positions() {
} }
uint8_t display_contrast = 0x00; uint8_t display_contrast = 0x00;
#if BOARD_MODEL == BOARD_TBEAM_S_V1 #if BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
void set_contrast(Adafruit_SH1106G *display, uint8_t value) { void set_contrast(Adafruit_SH1106G *display, uint8_t value) {
} }
#elif BOARD_MODEL == BOARD_HELTEC_T114 #elif BOARD_MODEL == BOARD_HELTEC_T114
@@ -355,7 +366,7 @@ bool display_init() {
pinMode(pin_backlight, OUTPUT); pinMode(pin_backlight, OUTPUT);
analogWrite(pin_backlight, 0); analogWrite(pin_backlight, 0);
#endif #endif
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
Wire.begin(SDA_OLED, SCL_OLED); Wire.begin(SDA_OLED, SCL_OLED);
#elif BOARD_MODEL == BOARD_XIAO_S3 #elif BOARD_MODEL == BOARD_XIAO_S3
Wire.begin(SDA_OLED, SCL_OLED); Wire.begin(SDA_OLED, SCL_OLED);
@@ -412,7 +423,7 @@ bool display_init() {
// set white as default pixel colour for Heltec T114 // set white as default pixel colour for Heltec T114
display.setRGB(COLOR565(0xFF, 0xFF, 0xFF)); display.setRGB(COLOR565(0xFF, 0xFF, 0xFF));
if (false) { if (false) {
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
if (!display.begin(display_address, true)) { if (!display.begin(display_address, true)) {
#else #else
if (!display.begin(SSD1306_SWITCHCAPVCC, display_address)) { if (!display.begin(SSD1306_SWITCHCAPVCC, display_address)) {
@@ -446,7 +457,7 @@ bool display_init() {
#elif BOARD_MODEL == BOARD_TBEAM #elif BOARD_MODEL == BOARD_TBEAM
disp_mode = DISP_MODE_LANDSCAPE; disp_mode = DISP_MODE_LANDSCAPE;
display.setRotation(0); display.setRotation(0);
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
disp_mode = DISP_MODE_PORTRAIT; disp_mode = DISP_MODE_PORTRAIT;
display.setRotation(1); display.setRotation(1);
#elif BOARD_MODEL == BOARD_HELTEC32_V2 #elif BOARD_MODEL == BOARD_HELTEC32_V2
@@ -1143,6 +1154,7 @@ void update_display(bool blank = false) {
#if BOARD_MODEL == BOARD_HELTEC_T114 #if BOARD_MODEL == BOARD_HELTEC_T114
display.clear(); display.clear();
digitalWrite(PIN_T114_TFT_BLGT, LOW);
#elif BOARD_MODEL != BOARD_TDECK && BOARD_MODEL != BOARD_TECHO #elif BOARD_MODEL != BOARD_TDECK && BOARD_MODEL != BOARD_TECHO
display.clearDisplay(); display.clearDisplay();
#endif #endif

171
Makefile
View File

@@ -30,7 +30,6 @@ prep: prep-avr prep-esp32 prep-samd
prep-avr: prep-avr:
arduino-cli core update-index --config-file arduino-cli.yaml arduino-cli core update-index --config-file arduino-cli.yaml
arduino-cli core install arduino:avr --config-file arduino-cli.yaml arduino-cli core install arduino:avr --config-file arduino-cli.yaml
arduino-cli core install unsignedio:avr --config-file arduino-cli.yaml
prep-esp32: prep-esp32:
arduino-cli core update-index --config-file arduino-cli.yaml arduino-cli core update-index --config-file arduino-cli.yaml
@@ -76,29 +75,29 @@ check_bt_buffers:
firmware: firmware:
arduino-cli compile --log --fqbn unsignedio:avr:rnode arduino-cli compile --log --fqbn unsignedio:avr:rnode
firmware-mega2560: firmware-aethernode: check_bt_buffers
arduino-cli compile --log --fqbn arduino:avr:mega arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-tbeam: check_bt_buffers firmware-diy_v1: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\"" arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\""
firmware-tbeam_sx126x: check_bt_buffers firmware-featheresp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\"" arduino-cli compile --log --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\""
firmware-t3s3: firmware-heltec32_v2: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x03\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\""
firmware-t3s3_sx127x: firmware-heltec32_v2_extled: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x01\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\""
firmware-t3s3_sx1280_pa: firmware-heltec32_v3:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x04\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3A\""
firmware-tdeck: firmware-heltec32_v4:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3B\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3F\""
firmware-tbeam_supreme: firmware-heltec_t114:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=-DBOARD_MODEL=0x3D" arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\""
firmware-lora32_v10: check_bt_buffers firmware-lora32_v10: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
@@ -118,17 +117,17 @@ firmware-lora32_v21_extled: check_bt_buffers
firmware-lora32_v21_tcxo: check_bt_buffers firmware-lora32_v21_tcxo: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DENABLE_TCXO=true\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DENABLE_TCXO=true\""
firmware-heltec32_v2: check_bt_buffers firmware-meshadventurer: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\"" arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\""
firmware-heltec32_v2_extled: check_bt_buffers firmware-meshpoe_s3: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF1\""
firmware-heltec32_v3: firmware-meshadventurer_s3: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3A\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-heltec32_v4: firmware-meshadventurer_s3_nocdc: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3F\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-rnode_ng_20: check_bt_buffers firmware-rnode_ng_20: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x40\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x40\""
@@ -136,32 +135,35 @@ firmware-rnode_ng_20: check_bt_buffers
firmware-rnode_ng_21: check_bt_buffers firmware-rnode_ng_21: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x41\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x41\""
firmware-featheresp32: check_bt_buffers firmware-promicro:
arduino-cli compile --log --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\"" arduino-cli compile --log --fqbn promicro:nrf52:nicenanov2:softdevice=s140v6 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF5\""
firmware-genericesp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-meshadventurer_s3: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-meshadventurer: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\""
firmware-diy_v1: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\""
firmware-aethernode: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-rak4631: firmware-rak4631:
arduino-cli compile --log --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\"" arduino-cli compile --log --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\""
firmware-heltec_t114: firmware-t3s3:
arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x03\""
firmware-promicro: firmware-t3s3_sx127x:
arduino-cli compile --log --fqbn promicro:nrf52:nicenanov2:softdevice=s140v6 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF5\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x01\""
firmware-t3s3_sx1280_pa:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x04\""
firmware-tbeam: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\""
firmware-tbeam_supreme:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=-DBOARD_MODEL=0x3D"
firmware-tbeam_supreme_v3:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=-DBOARD_MODEL=0x43"
firmware-tbeam_sx126x: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\""
firmware-tdeck:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3B\""
firmware-techo: firmware-techo:
arduino-cli compile --log --fqbn adafruit:nrf52:pca10056 -e --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\"" arduino-cli compile --log --fqbn adafruit:nrf52:pca10056 -e --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\""
@@ -169,6 +171,12 @@ firmware-techo:
firmware-xiao_s3: 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\"" 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\""
firmware-genericesp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-mega2560:
arduino-cli compile --log --fqbn arduino:avr:mega
upload: upload:
arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode
@@ -179,12 +187,26 @@ upload-genericesp32:
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshpoe_s3:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
# @sleep 1
# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3
python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshadventurer_s3: upload-meshadventurer_s3:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
# @sleep 1 # @sleep 1
# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) # rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshadventurer_s3_usb:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32s3
# @sleep 1
# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3
python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshadventurer: upload-meshadventurer:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32 arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32
@@ -257,28 +279,35 @@ upload-heltec32_v3:
@sleep 1 @sleep 1
rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-heltec32_v4: upload-heltec32_v4:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-tdeck: upload-tdeck:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-tbeam_supreme: upload-tbeam_supreme:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-tbeam_supreme_v3:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3
python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-rnode_ng_20: upload-rnode_ng_20:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32 arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32
@@ -337,7 +366,7 @@ upload-xiao_s3:
release: release-all release: release-all
release-all: console-site spiffs-image release-tbeam release-tbeam_sx1262 release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-lora32_v21_tcxo release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v3 release-heltec32_v4 release-heltec32_v2_extled release-heltec_t114 release-techo release-rnode_ng_20 release-rnode_ng_21 release-t3s3 release-t3s3_sx127x release-t3s3_sx1280_pa release-tdeck release-tbeam_supreme release-rak4631 release-xiao_s3 release-hashes release-all: console-site spiffs-image release-tbeam release-tbeam_sx1262 release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-lora32_v21_tcxo release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v3 release-heltec32_v4 release-heltec32_v2_extled release-heltec_t114 release-techo release-rnode_ng_20 release-rnode_ng_21 release-t3s3 release-t3s3_sx127x release-t3s3_sx1280_pa release-tdeck release-tbeam_supreme release-tbeam_supreme_v3 release-rak4631 release-xiao_s3 release-hashes
release-hashes: release-hashes:
python ./release_hashes.py > ./Release/release.json python ./release_hashes.py > ./Release/release.json
@@ -527,6 +556,15 @@ release-tbeam_supreme:
zip --junk-paths ./Release/rnode_firmware_tbeam_supreme.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_tbeam_supreme.boot_app0 build/rnode_firmware_tbeam_supreme.bin build/rnode_firmware_tbeam_supreme.bootloader build/rnode_firmware_tbeam_supreme.partitions zip --junk-paths ./Release/rnode_firmware_tbeam_supreme.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_tbeam_supreme.boot_app0 build/rnode_firmware_tbeam_supreme.bin build/rnode_firmware_tbeam_supreme.bootloader build/rnode_firmware_tbeam_supreme.partitions
rm -r build rm -r build
release-tbeam_supreme_v3:
arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x43\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_tbeam_supreme_v3.boot_app0
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin build/rnode_firmware_tbeam_supreme_v3.bin
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_tbeam_supreme_v3.bootloader
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.partitions.bin build/rnode_firmware_tbeam_supreme_v3.partitions
zip --junk-paths ./Release/rnode_firmware_tbeam_supreme_v3.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_tbeam_supreme_v3.boot_app0 build/rnode_firmware_tbeam_supreme_v3.bin build/rnode_firmware_tbeam_supreme_v3.bootloader build/rnode_firmware_tbeam_supreme_v3.partitions
rm -r build
release-featheresp32: check_bt_buffers release-featheresp32: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\"" arduino-cli compile --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_featheresp32.boot_app0 cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_featheresp32.boot_app0
@@ -545,6 +583,15 @@ release-genericesp32: check_bt_buffers
zip --junk-paths ./Release/rnode_firmware_esp32_generic.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_esp32_generic.boot_app0 build/rnode_firmware_esp32_generic.bin build/rnode_firmware_esp32_generic.bootloader build/rnode_firmware_esp32_generic.partitions zip --junk-paths ./Release/rnode_firmware_esp32_generic.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_esp32_generic.boot_app0 build/rnode_firmware_esp32_generic.bin build/rnode_firmware_esp32_generic.bootloader build/rnode_firmware_esp32_generic.partitions
rm -r build rm -r build
release-meshpoe_s3: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:esp32s3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF1\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshpoe_s3.boot_app0
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin build/rnode_firmware_meshpoe_s3.bin
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_meshpoe_s3.bootloader
cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.partitions.bin build/rnode_firmware_meshpoe_s3.partitions
zip --junk-paths ./Release/rnode_firmware_meshpoe_s3.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_meshpoe_s3.boot_app0 build/rnode_firmware_meshpoe_s3.bin build/rnode_firmware_meshpoe_s3.bootloader build/rnode_firmware_meshpoe_s3.partitions
rm -r build
release-meshadventurer_s3: check_bt_buffers release-meshadventurer_s3: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:esp32s3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\"" arduino-cli compile --fqbn esp32:esp32:esp32s3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshadventurer_s3.boot_app0 cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshadventurer_s3.boot_app0
@@ -572,6 +619,26 @@ release-diy_v1: check_bt_buffers
zip --junk-paths ./Release/rnode_firmware_diy_v1.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_diy_v1.boot_app0 build/rnode_firmware_diy_v1.bin build/rnode_firmware_diy_v1.bootloader build/rnode_firmware_diy_v1.partitions zip --junk-paths ./Release/rnode_firmware_diy_v1.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_diy_v1.boot_app0 build/rnode_firmware_diy_v1.bin build/rnode_firmware_diy_v1.bootloader build/rnode_firmware_diy_v1.partitions
rm -r build rm -r build
release-merged-diy_v1: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_diy_v1.boot_app0
cp build/esp32.esp32.esp32/RNode_Firmware.ino.bin build/rnode_firmware_diy_v1.bin
cp build/esp32.esp32.esp32/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_diy_v1.bootloader
cp build/esp32.esp32.esp32/RNode_Firmware.ino.partitions.bin build/rnode_firmware_diy_v1.partitions
python ./Release/esptool/esptool.py --chip esp32 merge_bin -o build/rnode_firmware_diy_v1.merged.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 build/rnode_firmware_diy_v1.bootloader 0x8000 build/rnode_firmware_diy_v1.partitions 0xe000 build/rnode_firmware_diy_v1.boot_app0 0x10000 build/rnode_firmware_diy_v1.bin
cp build/rnode_firmware_diy_v1.merged.bin ./Release/rnode_firmware_diy_v1.merged.bin
rm -r build
release-merged-meshadventurer: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshadventurer.boot_app0
cp build/esp32.esp32.esp32/RNode_Firmware.ino.bin build/rnode_firmware_meshadventurer.bin
cp build/esp32.esp32.esp32/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_meshadventurer.bootloader
cp build/esp32.esp32.esp32/RNode_Firmware.ino.partitions.bin build/rnode_firmware_meshadventurer.partitions
python ./Release/esptool/esptool.py --chip esp32 merge_bin -o build/rnode_firmware_meshadventurer.merged.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 build/rnode_firmware_meshadventurer.bootloader 0x8000 build/rnode_firmware_meshadventurer.partitions 0xe000 build/rnode_firmware_meshadventurer.boot_app0 0x10000 build/rnode_firmware_meshadventurer.bin
cp build/rnode_firmware_meshadventurer.merged.bin ./Release/rnode_firmware_meshadventurer.merged.bin
rm -r build
release-aethernode: check_bt_buffers release-aethernode: check_bt_buffers
arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\"" arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_aethernode.boot_app0 cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_aethernode.boot_app0

10
Power.h
View File

@@ -19,12 +19,12 @@
bool pmu_temp_sensor_ready = false; bool pmu_temp_sensor_ready = false;
float pmu_temperature = PMU_TEMP_MIN-1; float pmu_temperature = PMU_TEMP_MIN-1;
#if BOARD_MODEL == BOARD_TBEAM || BOARD_MODEL == BOARD_TBEAM_S_V1 #if BOARD_MODEL == BOARD_TBEAM || BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
#include <XPowersLib.h> #include <XPowersLib.h>
XPowersLibInterface* PMU = NULL; XPowersLibInterface* PMU = NULL;
#ifndef PMU_WIRE_PORT #ifndef PMU_WIRE_PORT
#if BOARD_MODEL == BOARD_TBEAM_S_V1 #if BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
#define PMU_WIRE_PORT Wire1 #define PMU_WIRE_PORT Wire1
#else #else
#define PMU_WIRE_PORT Wire #define PMU_WIRE_PORT Wire
@@ -235,7 +235,7 @@ void measure_battery() {
#elif BOARD_MODEL == BOARD_HELTEC_T114 #elif BOARD_MODEL == BOARD_HELTEC_T114
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.017165; float battery_measurement = (float)(analogRead(pin_vbat)) * 0.017165;
#elif BOARD_MODEL == BOARD_PROMICRO #elif BOARD_MODEL == BOARD_PROMICRO
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.017165; float battery_measurement = (float)(analogRead(pin_vbat)) * 0.006263;
#elif BOARD_MODEL == BOARD_TECHO #elif BOARD_MODEL == BOARD_TECHO
float battery_measurement = (float)(analogRead(pin_vbat)) * 0.007067; float battery_measurement = (float)(analogRead(pin_vbat)) * 0.007067;
#else #else
@@ -327,7 +327,7 @@ void measure_battery() {
// } // }
} }
#elif BOARD_MODEL == BOARD_TBEAM || BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM || BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
if (PMU) { if (PMU) {
float discharge_current = 0; float discharge_current = 0;
float charge_current = 0; float charge_current = 0;
@@ -583,7 +583,7 @@ bool init_pmu() {
PMU->setPowerKeyPressOffTime(XPOWERS_POWEROFF_4S); PMU->setPowerKeyPressOffTime(XPOWERS_POWEROFF_4S);
return true; return true;
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1 || BOARD_MODEL == BOARD_TBEAM_S_V3
Wire1.begin(I2C_SDA, I2C_SCL); Wire1.begin(I2C_SDA, I2C_SCL);
if (!PMU) { if (!PMU) {

156
README.md
View File

@@ -1,150 +1,20 @@
*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere.*
***Important!** This repository is currently functioning as a stable reference for the default RNode Firmware, and only receives bugfix and security updates. Further development, new features and expanded board support is now happening at the [RNode Firmware Community Edition](https://github.com/liberatedsystems/RNode_Firmware_CE) repository, and is maintained by [Liberated Embedded Systems](https://github.com/liberatedsystems). Thanks for all contributions so far!*
# RNode Firmware # RNode Firmware
This is the open firmware that powers RNode devices. This is a fork of [RNode_Firmware](https://github.com/markqvist/RNode_Firmware) by Mark Qvist
An RNode is an open, free and unrestricted digital radio transceiver. It enables anyone to send and receive any kind of data over both short and very long distances. RNodes can be used with many different kinds of programs and systems, but they are especially well suited for use with [Reticulum](https://reticulum.network). As Mark no longer accepts PRs and RNode_Firmware_CE is inactive, it was decided to make a private fork to fix issues and add additional hardware.
The fork contains several DIY devices by me and other developers and has a few small tweaks to the firmware like interference thresholds.
RNode is not a product, and not any *one* specific device in particular. It is a system that is easy to replicate across space and time, that produces highly functional communications tools, which respects user autonomy and empowers individuals and communities to protect their sovereignty, privacy and ability to communicate and exchange data and ideas freely. ---
<img src="Documentation/images/rnv21_bgp.webp" width="100%"> ## Added devices
<center><i>An RNode made from readily available and cheap parts, in a durable 3D printed case</i></center><br/><br/> - [Aethernode](https://github.com/ahedproductions/aethernode) by aetherlab LZ1SWE
- [MeshAdventurer-S3](https://git.rns.moscow/deuxyeux/MeshAdventurer-S3) by Nickie Deuxyeux
- [MeshAdventurer](https://github.com/chrismyers2000/MeshAdventurer) by Frequency Labs
- [DIY-V1](https://github.com/NanoVHF/Meshtastic-DIY/) by NanoVHF
- [Faketec (ProMicro)](https://github.com/gargomoma/fakeTec_pcb) by gargomoma, ShimonHoranek, lupusworax
The RNode system is primarily software, which *transforms* different kinds of available hardware devices into functional, physical RNodes, which can then be used to solve a wide range of communications tasks. Such RNodes can be modified and built to suit the specific time, locale and environment they need to exist in. ## Improvements
- Heltec T114 LCD backlight powers off when screen blanks
## Latest Release - LNA-equipped boards have interference detection threshold increased from 11 to 14dB
The latest release, installable through `rnodeconf`, is version `1.82`. You must have at least version `2.4.1` of `rnodeconf` installed to update the RNode Firmware to version `1.82`. Get it by updating the `rns` package to at least version `0.9.4`.
## A Self-Replicating System
If you notice the presence of a circularity in the naming of the system as a whole, and the physical devices, it is no coincidence. Every RNode contains the seeds necessary to reproduce the system, the [RNode Bootstrap Console](https://unsigned.io/rnode_bootstrap_console), which is hosted locally on every RNode, and can be activated and accesses at any time - no Internet required.
The designs, guides and software stored within allows users to create more RNodes, and even to bootstrap entire communications networks, completely independently of existing infrastructure, or in situations where infrastructure has become unreliable or is broken.
<img src="Documentation/images/126dcfe92fb7.webp" width="100%"/>
<center><i>Where there is no Internet, RNodes will still communicate</i></center><br/><br/>
The production of one particular RNode device is not an end, but the potential starting point of a new branch of devices on the tree of the RNode system as a whole.
This tree fits into the larger biome of Free & Open Communications Systems, which I hope that you - by using communications tools like RNode - will help grow and prosper.
## One Tool, Many Uses
The RNode design is meant to flexible and hackable. At it's core, it is a low-power, but extremely long-range digital radio transceiver. Coupled with Reticulum, it provides encrypted and secure communications.
Depending on configuration, it can be used for local networking purposes, or to send data over very long distances. Once you have an RNode, there is a wide variety of possible uses:
- As a network adapter for [Reticulum](https://reticulum.network)
- Messaging using [Sideband](https://unsigned.io/software/Sideband.html)
- Information sharing and communication using [Nomad Network](https://unsigned.io/software/Nomad_Network.html)
- LoRa-based [KISS-compatible amateur radio TNC](https://unsigned.io/guides/2020_05_03_using_rnodes_with_amateur_radio_software.html)
- LoRa development platform
- [Packet sniffer](https://unsigned.io/software/LoRaMon.html) for LoRa networks
- Long range [Ethernet and IP network interface](https://unsigned.io/guides/2020_05_27_ethernet-and-ip-over-packet-radio-tncs.html) on Linux
- As a general-purpose long-range data radio
## Types & Performance
RNodes can be made in many different configurations, and can use many different radio bands, but they will generally operate in the **433 MHz**, **868 MHz**, **915 MHZ** and **2.4 GHz** bands. They will usually offer configurable on-air data speeds between just a **few hundred bits per second**, up to **a couple of megabits per second**. Maximum output power will depend on the transceiver and PA setup used, but will generally lie between **17 dbm** and **27 dBm**.
The RNode system has been designed to allow reliable systems for basic human communications, over very wide areas, while using very little power, being cheap to build, free to operate, and near impossible to censor.
While **speeds are lower** than WiFi, typical communication **ranges are many times higher**. Several kilometers can be acheived with usable bitrates, even in urban areas, and over **100 kilometers** can be achieved in line-of-sight conditions.
## Supported Boards & Devices
It's easy to create your own RNodes from one of the supported development boards and devices. If a device or board you want to use is not yet supported, you are welcome to join the effort and help creating a board definition and pin mapping for it!
<img src="Documentation/images/devboards_1.webp" width="100%"/>
The RNode Firmware supports the following boards:
- LilyGO T-Beam v1.1 devices with SX1276/8 LoRa chips
- LilyGO T-Beam v1.1 devices with SX1262/8 LoRa chips
- LilyGO T-Beam Supreme devices
- LilyGO T-Deck devices (currently display is disabled)
- LilyGO LoRa32 v1.0 devices
- LilyGO LoRa32 v2.0 devices
- LilyGO LoRa32 v2.1 devices (with and without TCXO)
- LilyGO T3S3 devices with SX1276/8 LoRa chips
- LilyGO T3S3 devices with SX1262/8 LoRa chips
- LilyGO T3S3 devices with SX1280 LoRa chips
- LilyGO T-Echo devices
- Heltec LoRa32 v2 devices
- Heltec LoRa32 v3 devices
- Heltec LoRa32 v4 devices
- Heltec T114 devices
- RAK4631 devices
- SeeedStudio XIAO ESP32S3 devices (with Wio-SX1262)
- 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**, **SX1278**, **SX1262**, **SX1268** and **SX1280** chips, that have an **SPI interface** and expose the relevant **DIO** interrupt pins from the chip.
## Getting Started Fast
You can download and flash the firmware to all the supported boards using the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil). All firmware releases are now handled and installed directly through the `rnodeconf` utility, which is included in the `rns` package. It can be installed via `pip`:
```
# Install rnodeconf via rns package
pip install rns --upgrade
# Install the firmware on a board with the install guide
rnodeconf --autoinstall
```
For most of the supported device types, it is also possible to use [Liam Cottle's Web-based RNode Flasher](https://liamcottle.github.io/rnode-flasher/). This option may be easier if you're not familiar with using a command line interface.
For more detailed instruction and in-depth guides, you can have a look at some of these resources:
- Create a [basic RNode from readily available development boards](https://unsigned.io/guides/2022_01_25_installing-rnode-firmware-on-supported-devices.html)
- Follow a complete build recipe for [making a handheld RNode](https://unsigned.io/guides/2023_01_14_Making_A_Handheld_RNode.html), like the one pictured above
- Learn the basics on how to [create and build your own RNode designs](https://unsigned.io/guides/2022_01_26_how-to-make-your-own-rnodes.html) from scratch
- Once you've got the hang of it, start building RNodes for your community, or [even for selling them](https://unsigned.io/sell_rnodes.html)
If you would rather just buy a pre-made unit, you can visit one of the community vendors that produce and sell RNodes:
- [Liberated Embedded Systems](https://store.liberatedsystems.co.uk/)
- [Simply Equipped](https://simplyequipped.com/)
If you'd like to have your shop added to this list, let me know.
## Support RNode Development
You can help support the continued development of open, free and private communications systems by donating via one of the following channels:
- Monero:
```
84FpY1QbxHcgdseePYNmhTHcrgMX4nFfBYtz2GKYToqHVVhJp8Eaw1Z1EedRnKD19b3B8NiLCGVxzKV17UMmmeEsCrPyA5w
```
- Bitcoin
```
bc1pgqgu8h8xvj4jtafslq396v7ju7hkgymyrzyqft4llfslz5vp99psqfk3a6
```
- Ethereum
```
0x91C421DdfB8a30a49A71d63447ddb54cEBe3465E
```
- Liberapay: https://liberapay.com/Reticulum/
- Ko-Fi: https://ko-fi.com/markqvist
## License & Use
The RNode Firmware is Copyright © 2024 Mark Qvist / [unsigned.io](https://unsigned.io), and is made available under the **GNU General Public License v3.0**. The source code includes an SX1276 driver that is released under MIT License, and Copyright © 2018 Sandeep Mistry / Mark Qvist.
You can obtain the source code from [git.unsigned.io](https://git.unsigned.io/markqvist/RNode_Firmware) or [GitHub](https://github.com/markqvist/rnode_firmware).
Every RNode also includes an internal copy of it's own firmware source code, that can be downloaded through the [RNode Bootstrap Console](https://unsigned.io/rnode_bootstrap_console), by putting the RNode into Console Mode (which can be activated by pressing the reset button two times within two seconds).
The RNode Ecosystem is free and non-proprietary, and actively seeks to distribute it's ownership and control. If you want to build RNodes for commercial purposes, including selling them, you must do so adhering to the Open Source licenses that the various parts of the RNode project is released under, and under your own responsibility.
If you distribute or modify this work, you **must** adhere to the terms of the GPLv3, including, but not limited to, providing up-to-date source code upon distribution, displaying appropriate copyright and license notices in prominent positions of all conveyed works, and making users aware of their rights to the software under the GPLv3.
In practice, this means that you can use the firmware commercially, but you must understand your obligation to provide all future users of the system with the same rights, that you have been provided by the GPLv3. If you intend using the RNode Firmware commercially, it is worth reading [this page](https://unsigned.io/sell_rnodes.html).

View File

@@ -135,7 +135,7 @@ void setup() {
boot_seq(); boot_seq();
#endif #endif
#if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_HELTEC_T114 && BOARD_MODEL != BOARD_MESHADVENTURER_S3 && BOARD_MODEL != BOARD_PROMICRO && 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_MESHPOE_S3 && BOARD_MODEL != BOARD_MESHADVENTURER_S3 && BOARD_MODEL != BOARD_PROMICRO && BOARD_MODEL != BOARD_TECHO && BOARD_MODEL != BOARD_T3S3 && BOARD_MODEL != BOARD_TBEAM_S_V1 && BOARD_MODEL != BOARD_TBEAM_S_V3 && BOARD_MODEL != BOARD_HELTEC32_V4
// Some boards need to wait until the hardware UART is set up before booting // 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 // 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 // until a serial connection is actually established with a master. Thus, it
@@ -183,7 +183,7 @@ void setup() {
#if MODEM == SX1276 || MODEM == SX1278 #if MODEM == SX1276 || MODEM == SX1278
LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy); LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy);
#elif MODEM == SX1262 #elif MODEM == SX1262
LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy, pin_rxen); LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy, pin_rxen, pin_txen);
#elif MODEM == SX1280 #elif MODEM == SX1280
LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy, pin_rxen, pin_txen); LoRa->setPins(pin_cs, pin_reset, pin_dio, pin_busy, pin_rxen, pin_txen);
#endif #endif
@@ -882,7 +882,7 @@ void serial_callback(uint8_t sbyte) {
if (txp > 13) txp = 13; if (txp > 13) txp = 13;
#endif #endif
#else #else
if (txp > 17) txp = 17; if (txp > 20) txp = 20;
#endif #endif
lora_txp = txp; lora_txp = txp;
@@ -1781,7 +1781,13 @@ void sleep_now() {
#endif #endif
#endif #endif
#if BOARD_MODEL == BOARD_HELTEC32_V4 #if BOARD_MODEL == BOARD_HELTEC32_V4
digitalWrite(LORA_PA_CPS, LOW); #if LORA_PA_AUTO_DETECT
if (sx126x_modem.isKCT8103L()) {
digitalWrite(LORA_PA_CTX, LOW);
} else {
digitalWrite(LORA_PA_CPS, LOW);
}
#endif
digitalWrite(LORA_PA_CSD, LOW); digitalWrite(LORA_PA_CSD, LOW);
digitalWrite(LORA_PA_PWR_EN, LOW); digitalWrite(LORA_PA_PWR_EN, LOW);
digitalWrite(Vext, HIGH); digitalWrite(Vext, HIGH);

Binary file not shown.

Binary file not shown.

View File

@@ -250,6 +250,13 @@ uint8_t boot_vector = 0x00;
void led_tx_off() { } void led_tx_off() { }
void led_id_on() { } void led_id_on() { }
void led_id_off() { } void led_id_off() { }
#elif BOARD_MODEL == BOARD_TBEAM_S_V3
void led_rx_on() { }
void led_rx_off() { }
void led_tx_on() { }
void led_tx_off() { }
void led_id_on() { }
void led_id_off() { }
#elif BOARD_MODEL == BOARD_LORA32_V1_0 #elif BOARD_MODEL == BOARD_LORA32_V1_0
#if defined(EXTERNAL_LEDS) #if defined(EXTERNAL_LEDS)
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
@@ -340,6 +347,13 @@ uint8_t boot_vector = 0x00;
void led_tx_off() { digitalWrite(pin_led_tx, LOW); } void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
void led_id_on() { } void led_id_on() { }
void led_id_off() { } void led_id_off() { }
#elif BOARD_MODEL == BOARD_MESHPOE_S3
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() { }
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
void led_rx_off() { digitalWrite(pin_led_rx, LOW); } void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
@@ -1322,11 +1336,33 @@ int getTxPower() {
} }
#if HAS_LORA_PA #if HAS_LORA_PA
#if BOARD_MODEL == BOARD_HELTEC32_V4
bool pa_values_determined = false;
int tx_gain[PA_GAIN_POINTS] = {100};
#else
bool pa_values_determined = true;
const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES}; const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES};
#endif
#endif #endif
extern uint8_t lora_pa_model;
void determine_pa_values() {
#if BOARD_MODEL == BOARD_HELTEC32_V4
if (lora_pa_model == LORA_PA_GC1109) {
for (int i=0; i < PA_GAIN_POINTS; i++) { tx_gain[i] = PA_GC1109_VALUES[i]; }
pa_values_determined = true;
for (int i=0; i < PA_GAIN_POINTS; i++) { Serial.print(" "); Serial.printf("%d", tx_gain[i]); }
} else if (lora_pa_model == LORA_PA_KCT8103L) {
for (int i=0; i < PA_GAIN_POINTS; i++) { tx_gain[i] = PA_KCT8103L_VALUES[i]; }
pa_values_determined = true;
for (int i=0; i < PA_GAIN_POINTS; i++) { Serial.print(" "); Serial.printf("%d", tx_gain[i]); }
}
#endif
}
int map_target_power_to_modem_output(int target_tx_power) { int map_target_power_to_modem_output(int target_tx_power) {
#if HAS_LORA_PA #if HAS_LORA_PA
if (!pa_values_determined) { determine_pa_values(); }
int modem_output_dbm = -9; int modem_output_dbm = -9;
for (int i = 0; i < PA_GAIN_POINTS; i++) { for (int i = 0; i < PA_GAIN_POINTS; i++) {
int gain = tx_gain[i]; int gain = tx_gain[i];
@@ -1371,6 +1407,10 @@ void setTXPower() {
lora_txp = real_lora_txp; lora_txp = real_lora_txp;
#endif #endif
if (model == MODEL_FD && mapped_lora_txp > 8) {
mapped_lora_txp = 8;
}
if (model == MODEL_11) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN); if (model == MODEL_11) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN);
if (model == MODEL_12) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN); if (model == MODEL_12) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN);
@@ -1416,6 +1456,7 @@ void setTXPower() {
if (model == MODEL_E3) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN); 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_E8) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_FD) 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_FE) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_FF) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN); if (model == MODEL_FF) LoRa->setTxPower(mapped_lora_txp, PA_OUTPUT_RFO_PIN);
} }
@@ -1657,7 +1698,7 @@ bool eeprom_model_valid() {
#elif BOARD_MODEL == BOARD_T3S3 #elif BOARD_MODEL == BOARD_T3S3
if (model == MODEL_A1 || model == MODEL_A6 || model == MODEL_A5 || model == MODEL_AA || model == MODEL_AC) { if (model == MODEL_A1 || model == MODEL_A6 || model == MODEL_A5 || model == MODEL_AA || model == MODEL_AC) {
#elif BOARD_MODEL == BOARD_HMBRW #elif BOARD_MODEL == BOARD_HMBRW
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE || model = MODEL_FD) {
#elif BOARD_MODEL == BOARD_TBEAM #elif BOARD_MODEL == BOARD_TBEAM
if (model == MODEL_E4 || model == MODEL_E9 || model == MODEL_E3 || model == MODEL_E8) { if (model == MODEL_E4 || model == MODEL_E9 || model == MODEL_E3 || model == MODEL_E8) {
#elif BOARD_MODEL == BOARD_TDECK #elif BOARD_MODEL == BOARD_TDECK
@@ -1688,14 +1729,16 @@ bool eeprom_model_valid() {
if (model == MODEL_FF) { if (model == MODEL_FF) {
#elif BOARD_MODEL == BOARD_GENERIC_ESP32 #elif BOARD_MODEL == BOARD_GENERIC_ESP32
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE) {
#elif BOARD_MODEL == BOARD_MESHPOE_S3
if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) {
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) {
#elif BOARD_MODEL == BOARD_MESHADVENTURER #elif BOARD_MODEL == BOARD_MESHADVENTURER
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) {
#elif BOARD_MODEL == BOARD_DIY_V1 #elif BOARD_MODEL == BOARD_DIY_V1
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) {
#elif BOARD_MODEL == BOARD_AETHERNODE #elif BOARD_MODEL == BOARD_AETHERNODE
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) {
#elif BOARD_MODEL == BOARD_PROMICRO #elif BOARD_MODEL == BOARD_PROMICRO
if (model == MODEL_FF || model == MODEL_FE) { if (model == MODEL_FF || model == MODEL_FE) {
#else #else

View File

@@ -4,7 +4,3 @@ board_manager:
- https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json - 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://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://adafruit.github.io/arduino-board-index/package_adafruit_index.json
## proMicro
# - https://raw.githubusercontent.com/pdcook/nRFMicro-Arduino-Core/main/package_nRFMicro_index.json #can't use it bc the name has spaces, i created the file below
- https://gist.githubusercontent.com/gargomoma/b5cffc40e5df88462f2b488492feb6ca/raw/198c5706289014dd64be31607495e02f056d52a3/nrf_cli_fix.json
- https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

View File

@@ -1,133 +0,0 @@
diff --git a/Display.h b/Display.h
index 7d903b9..882af8d 100644
--- a/Display.h
+++ b/Display.h
@@ -1071,6 +1071,7 @@ void update_display(bool blank = false) {
#if BOARD_MODEL == BOARD_HELTEC_T114
display.clear();
display.display();
+ digitalWrite(PIN_T114_TFT_BLGT, HIGH);
#elif BOARD_MODEL != BOARD_TDECK && BOARD_MODEL != BOARD_TECHO
display.clearDisplay();
display.display();
@@ -1128,6 +1129,9 @@ void update_display(bool blank = false) {
void display_unblank() {
last_unblank_event = millis();
+ #if BOARD_MODEL == BOARD_HELTEC_T114
+ digitalWrite(PIN_T114_TFT_BLGT, LOW);
+ #endif
}
void ext_fb_enable() {
diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino
index 5649206..ba157e6 100644
--- a/RNode_Firmware.ino
+++ b/RNode_Firmware.ino
@@ -535,7 +535,9 @@ bool startRadio() {
// Flash an info pattern to indicate
// that the radio is now on
kiss_indicate_radiostate();
- led_indicate_info(3);
+ if (!display_blanked) {
+ led_indicate_info(3);
+ }
return true;
}
@@ -575,7 +577,7 @@ volatile bool queue_flushing = false;
void flush_queue(void) {
if (!queue_flushing) {
queue_flushing = true;
- led_tx_on();
+ if (!display_blanked) { led_tx_on(); }
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
while (!fifo16_isempty(&packet_starts)) {
@@ -596,7 +598,7 @@ void flush_queue(void) {
}
}
- lora_receive(); led_tx_off();
+ lora_receive(); if (!display_blanked) { led_tx_off(); }
}
queue_height = 0;
@@ -615,7 +617,8 @@ void flush_queue(void) {
void pop_queue() {
if (!queue_flushing) {
- queue_flushing = true; led_tx_on();
+ queue_flushing = true;
+ if (!display_blanked) { led_tx_on(); }
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
if (!fifo16_isempty(&packet_starts)) {
@@ -637,7 +640,8 @@ void pop_queue() {
queued_bytes -= length;
}
- lora_receive(); led_tx_off();
+ lora_receive();
+ if (!display_blanked) { led_tx_off(); }
}
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
@@ -751,7 +755,7 @@ void transmit(uint16_t size) {
add_airtime(written);
} else {
- led_tx_on(); uint16_t written = 0;
+ if (!display_blanked) { led_tx_on(); } uint16_t written = 0;
if (size > SINGLE_MTU) { size = SINGLE_MTU; }
if (!implicit) { LoRa->beginPacket(); }
else { LoRa->beginPacket(size); }
@@ -984,7 +988,7 @@ void serial_callback(uint8_t sbyte) {
} else if (command == CMD_RADIO_LOCK) {
update_radio_lock();
kiss_indicate_radio_lock();
- } else if (command == CMD_BLINK) {
+ } else if (command == CMD_BLINK && !display_blanked) {
led_indicate_info(sbyte);
} else if (command == CMD_RANDOM) {
kiss_indicate_random(getRandom());
@@ -1431,13 +1435,15 @@ void update_modem_status() {
if (carrier_detected) { dcd = true; } else { dcd = false; }
dcd_led = dcd;
- if (dcd_led) { led_rx_on(); }
+ if (!display_blanked && dcd_led) { led_rx_on(); }
else {
if (interference_detected) {
- if (led_id_filter >= LED_ID_TRIG && noise_floor_sampled) { led_id_on(); }
+ if (led_id_filter >= LED_ID_TRIG && noise_floor_sampled && !display_blanked) { led_id_on(); }
} else {
- if (airtime_lock) { led_indicate_airtime_lock(); }
- else { led_rx_off(); led_id_off(); }
+ if (airtime_lock && !display_blanked) { led_indicate_airtime_lock(); }
+ else {
+ if (!display_blanked) { led_rx_off(); led_id_off(); }
+ }
}
}
}
@@ -1707,7 +1713,9 @@ void loop() {
console_loop();
#endif
} else {
- led_indicate_standby();
+ if (!display_blanked) {
+ led_indicate_standby();
+ }
}
} else {
diff --git a/arduino-cli.yaml b/arduino-cli.yaml
index 6dd5f8d..d358070 100644
--- a/arduino-cli.yaml
+++ b/arduino-cli.yaml
@@ -4,4 +4,3 @@ 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
- - http://unsigned.io/arduino/package_unsignedio_UnsignedBoards_index.json

View File

@@ -96,13 +96,21 @@
#define SPI spiModem #define SPI spiModem
#endif #endif
#if HAS_LORA_PA
uint8_t lora_pa_model = LORA_PA_MODEL;
#endif
#if HAS_LORA_LNA
int lora_lna_gain = LORA_LNA_GAIN;
#endif
extern SPIClass SPI; extern SPIClass SPI;
#define MAX_PKT_LENGTH 255 #define MAX_PKT_LENGTH 255
sx126x::sx126x() : sx126x::sx126x() :
_spiSettings(16E6, MSBFIRST, SPI_MODE0), _spiSettings(16E6, MSBFIRST, SPI_MODE0),
_ss(LORA_DEFAULT_SS_PIN), _reset(LORA_DEFAULT_RESET_PIN), _dio0(LORA_DEFAULT_DIO0_PIN), _busy(LORA_DEFAULT_BUSY_PIN), _rxen(LORA_DEFAULT_RXEN_PIN), _ss(LORA_DEFAULT_SS_PIN), _reset(LORA_DEFAULT_RESET_PIN), _dio0(LORA_DEFAULT_DIO0_PIN), _busy(LORA_DEFAULT_BUSY_PIN), _rxen(LORA_DEFAULT_RXEN_PIN), _txen(LORA_DEFAULT_TXEN_PIN),
_frequency(0), _frequency(0),
_txp(0), _txp(0),
_sf(0x07), _sf(0x07),
@@ -125,7 +133,7 @@ bool sx126x::preInit() {
pinMode(_ss, OUTPUT); pinMode(_ss, OUTPUT);
digitalWrite(_ss, HIGH); digitalWrite(_ss, HIGH);
#if BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_XIAO_S3 || BOARD_MODEL == BOARD_GENERIC_ESP32 || BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER || BOARD_MODEL == BOARD_DIY_V1 || BOARD_MODEL == BOARD_AETHERNODE #if BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_XIAO_S3 || BOARD_MODEL == BOARD_GENERIC_ESP32 || BOARD_MODEL == BOARD_MESHPOE_S3 || BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER || BOARD_MODEL == BOARD_DIY_V1 || BOARD_MODEL == BOARD_AETHERNODE
SPI.begin(pin_sclk, pin_miso, pin_mosi, pin_cs); SPI.begin(pin_sclk, pin_miso, pin_mosi, pin_cs);
#elif BOARD_MODEL == BOARD_TECHO #elif BOARD_MODEL == BOARD_TECHO
SPI.setPins(pin_miso, pin_sclk, pin_mosi); SPI.setPins(pin_miso, pin_sclk, pin_mosi);
@@ -183,6 +191,7 @@ uint8_t ISR_VECT sx126x::singleTransfer(uint8_t opcode, uint16_t address, uint8_
void sx126x::rxAntEnable() { void sx126x::rxAntEnable() {
if (_rxen != -1) { digitalWrite(_rxen, HIGH); } if (_rxen != -1) { digitalWrite(_rxen, HIGH); }
if (_txen != -1) { digitalWrite(_txen, LOW); }
} }
void sx126x::loraMode() { void sx126x::loraMode() {
@@ -273,6 +282,21 @@ void sx126x::setPacketParams(long preamble_symbols, uint8_t headermode, uint8_t
buf[7] = 0x00; buf[7] = 0x00;
buf[8] = 0x00; buf[8] = 0x00;
executeOpcode(OP_PACKET_PARAMS_6X, buf, 9); executeOpcode(OP_PACKET_PARAMS_6X, buf, 9);
// SX1262 errata section 15.4: IQ polarity is inverted compared to
// SX1276. The SetPacketParams command resets register 0x0736 to an
// incorrect default. For standard IQ (no inversion), bit 2 must be
// SET after every SetPacketParams call. For inverted IQ, bit 2 must
// be CLEARED. Without this fix, LoRa RX demodulation fails silently
// while TX continues to work.
uint8_t iqreg = readRegister(0x0736);
if (buf[5] == 0x00) {
// Standard IQ: set bit 2
writeRegister(0x0736, iqreg | 0x04);
} else {
// Inverted IQ: clear bit 2
writeRegister(0x0736, iqreg & ~0x04);
}
} }
void sx126x::reset(void) { void sx126x::reset(void) {
@@ -331,6 +355,7 @@ int sx126x::begin(long frequency) {
if (_busy != -1) { pinMode(_busy, INPUT); } if (_busy != -1) { pinMode(_busy, INPUT); }
if (!_preinit_done) { if (!preInit()) { return false; } } if (!_preinit_done) { if (!preInit()) { return false; } }
if (_rxen != -1) { pinMode(_rxen, OUTPUT); } if (_rxen != -1) { pinMode(_rxen, OUTPUT); }
if (_txen != -1) { pinMode(_txen, OUTPUT); }
//TODO: if it works, make it optional //TODO: if it works, make it optional
//#ifdef SX1262_USE_DCDC_REGULATOR //#ifdef SX1262_USE_DCDC_REGULATOR
@@ -361,7 +386,9 @@ int sx126x::begin(long frequency) {
setFrequency(frequency); setFrequency(frequency);
setTxPower(2); setTxPower(2);
enableCrc(); enableCrc();
writeRegister(REG_LNA_6X, 0x96); // Set LNA boost writeRegister(REG_LNA_6X, 0x96); // Set LNA boosted gain mode
// Undocumented SX1262 register patch recommended by Heltec/Semtech for improved RX sensitivity.
writeRegister(0x08B5, readRegister(0x08B5) | 0x01);
uint8_t basebuf[2] = {0}; // Set base addresses uint8_t basebuf[2] = {0}; // Set base addresses
executeOpcode(OP_BUFFER_BASE_ADDR_6X, basebuf, 2); executeOpcode(OP_BUFFER_BASE_ADDR_6X, basebuf, 2);
@@ -369,7 +396,22 @@ int sx126x::begin(long frequency) {
setPacketParams(_preambleLength, _implicitHeaderMode, _payloadLength, _crcMode); setPacketParams(_preambleLength, _implicitHeaderMode, _payloadLength, _crcMode);
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 if (lora_pa_model == LORA_PA_UNKNOWN) {
#if BOARD_MODEL == BOARD_HELTEC32_V4
pinMode(LORA_PA_PWR_EN, OUTPUT);
pinMode(LORA_PA_CSD, INPUT);
digitalWrite(LORA_PA_PWR_EN, HIGH); delay(5);
if (digitalRead(LORA_PA_CSD) == HIGH) {
lora_pa_model = LORA_PA_KCT8103L;
lora_lna_gain = LORA_LNA_KCT8103L_GAIN;
} else {
lora_pa_model = LORA_PA_GC1109;
}
#endif
}
if (lora_pa_model == LORA_PA_GC1109) {
// Enable Vfem_ctl for supply to // Enable Vfem_ctl for supply to
// PA power net. // PA power net.
pinMode(LORA_PA_PWR_EN, OUTPUT); pinMode(LORA_PA_PWR_EN, OUTPUT);
@@ -394,7 +436,26 @@ int sx126x::begin(long frequency) {
// is driven by the SX1262 DIO2 // is driven by the SX1262 DIO2
// pin directly, so we do not // pin directly, so we do not
// need to manually raise this. // need to manually raise this.
#endif
} else if (lora_pa_model == LORA_PA_KCT8103L) {
// Enable Vfem_ctl for supply to
// PA power net.
pinMode(LORA_PA_PWR_EN, OUTPUT);
digitalWrite(LORA_PA_PWR_EN, HIGH);
// Enable KCT8103L chip
pinMode(LORA_PA_CSD, OUTPUT);
digitalWrite(LORA_PA_CSD, HIGH);
// Enable receive LNA
pinMode(LORA_PA_CTX, OUTPUT);
digitalWrite(LORA_PA_CTX, LOW);
// On Heltec V4.3, the PA CPS pin
// is driven by the SX1262 DIO2
// pin directly, so we do not
// need to manually raise this.
}
#endif #endif
return 1; return 1;
@@ -404,15 +465,19 @@ void sx126x::end() { sleep(); SPI.end(); _preinit_done = false; }
int sx126x::beginPacket(int implicitHeader) { int sx126x::beginPacket(int implicitHeader) {
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 if (lora_pa_model == LORA_PA_GC1109) {
// Enable PA CPS for transmit // Enable PA CPS for transmit
// digitalWrite(LORA_PA_CPS, HIGH); // digitalWrite(LORA_PA_CPS, HIGH);
// Disabled since we're keeping it // Disabled since we're keeping it
// on permanently as long as the // on permanently as long as the
// radio is powered up. // radio is powered up.
#endif } else if (lora_pa_model == LORA_PA_KCT8103L) {
digitalWrite(LORA_PA_CTX, HIGH);
}
#endif #endif
if (_txen != -1) { digitalWrite(_txen, HIGH); } //Set TXen high when transmitting
standby(); standby();
if (implicitHeader) { implicitHeaderMode(); } if (implicitHeader) { implicitHeaderMode(); }
else { explicitHeaderMode(); } else { explicitHeaderMode(); }
@@ -501,7 +566,7 @@ int ISR_VECT sx126x::currentRssi() {
executeOpcodeRead(OP_CURRENT_RSSI_6X, &byte, 1); executeOpcodeRead(OP_CURRENT_RSSI_6X, &byte, 1);
int rssi = -(int(byte)) / 2; int rssi = -(int(byte)) / 2;
#if HAS_LORA_LNA #if HAS_LORA_LNA
rssi -= LORA_LNA_GAIN; rssi -= lora_lna_gain;
#endif #endif
return rssi; return rssi;
} }
@@ -517,7 +582,7 @@ int ISR_VECT sx126x::packetRssi() {
executeOpcodeRead(OP_PACKET_STATUS_6X, buf, 3); executeOpcodeRead(OP_PACKET_STATUS_6X, buf, 3);
int pkt_rssi = -buf[0] / 2; int pkt_rssi = -buf[0] / 2;
#if HAS_LORA_LNA #if HAS_LORA_LNA
pkt_rssi -= LORA_LNA_GAIN; pkt_rssi -= lora_lna_gain;
#endif #endif
return pkt_rssi; return pkt_rssi;
} }
@@ -624,7 +689,7 @@ void sx126x::onReceive(void(*callback)(int)){
void sx126x::receive(int size) { void sx126x::receive(int size) {
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 if (lora_pa_model == LORA_PA_GC1109) {
// Disable PA CPS for receive // Disable PA CPS for receive
// digitalWrite(LORA_PA_CPS, LOW); // digitalWrite(LORA_PA_CPS, LOW);
// That turned out to be a bad idea. // That turned out to be a bad idea.
@@ -632,7 +697,9 @@ void sx126x::receive(int size) {
// on and off too quickly. We'll keep // on and off too quickly. We'll keep
// it on permanently, as long as the // it on permanently, as long as the
// radio is powered up. // radio is powered up.
#endif } else if (lora_pa_model == LORA_PA_KCT8103L) {
digitalWrite(LORA_PA_CTX, LOW);
}
#endif #endif
if (size > 0) { if (size > 0) {
@@ -663,6 +730,8 @@ void sx126x::enableTCXO() {
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_TBEAM_S_V1 #elif BOARD_MODEL == BOARD_TBEAM_S_V1
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_TBEAM_S_V3
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_T3S3 #elif BOARD_MODEL == BOARD_T3S3
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_HELTEC_T114 #elif BOARD_MODEL == BOARD_HELTEC_T114
@@ -673,6 +742,8 @@ void sx126x::enableTCXO() {
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_GENERIC_ESP32 #elif BOARD_MODEL == BOARD_GENERIC_ESP32
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_MESHPOE_S3
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_MESHADVENTURER #elif BOARD_MODEL == BOARD_MESHADVENTURER
@@ -770,7 +841,17 @@ void sx126x::handleLowDataRate() {
} }
// TODO: Check if there's anything the sx1262 can do here // TODO: Check if there's anything the sx1262 can do here
void sx126x::optimizeModemSensitivity(){ } // SX1262 errata section 15.1: Modulation quality with 500 kHz LoRa BW.
// Register 0x0889 bit 2 must be cleared for 500 kHz, set for all other
// bandwidths. Improves receiver sensitivity at non-500 kHz bandwidths.
void sx126x::optimizeModemSensitivity(){
uint8_t reg = readRegister(0x0889);
if (getSignalBandwidth() == 500E3) {
writeRegister(0x0889, reg & 0xFB); // clear bit 2
} else {
writeRegister(0x0889, reg | 0x04); // set bit 2
}
}
void sx126x::setSignalBandwidth(long sbw) { void sx126x::setSignalBandwidth(long sbw) {
if (sbw <= 7.8E3) { _bw = 0x00; } if (sbw <= 7.8E3) { _bw = 0x00; }
@@ -810,12 +891,13 @@ void sx126x::setSyncWord(uint16_t sw) {
writeRegister(REG_SYNC_WORD_LSB_6X, 0x24); writeRegister(REG_SYNC_WORD_LSB_6X, 0x24);
} }
void sx126x::setPins(int ss, int reset, int dio0, int busy, int rxen) { void sx126x::setPins(int ss, int reset, int dio0, int busy, int rxen, int txen) {
_ss = ss; _ss = ss;
_reset = reset; _reset = reset;
_dio0 = dio0; _dio0 = dio0;
_busy = busy; _busy = busy;
_rxen = rxen; _rxen = rxen;
_txen = txen;
} }
void sx126x::dumpRegisters(Stream& out) { void sx126x::dumpRegisters(Stream& out) {

View File

@@ -93,11 +93,13 @@ public:
byte random(); byte random();
void setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN, int busy = LORA_DEFAULT_BUSY_PIN, int rxen = LORA_DEFAULT_RXEN_PIN); void setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN, int busy = LORA_DEFAULT_BUSY_PIN, int rxen = LORA_DEFAULT_RXEN_PIN, int txen = LORA_DEFAULT_TXEN_PIN);
void setSPIFrequency(uint32_t frequency); void setSPIFrequency(uint32_t frequency);
void dumpRegisters(Stream& out); void dumpRegisters(Stream& out);
bool isKCT8103L() { return _kct8103l; }
private: private:
void explicitHeaderMode(); void explicitHeaderMode();
void implicitHeaderMode(); void implicitHeaderMode();
@@ -122,6 +124,7 @@ private:
int _reset; int _reset;
int _dio0; int _dio0;
int _rxen; int _rxen;
int _txen;
int _busy; int _busy;
long _frequency; long _frequency;
int _txp; int _txp;
@@ -138,6 +141,7 @@ private:
int _fifo_rx_addr_ptr; int _fifo_rx_addr_ptr;
uint8_t _packet[255]; uint8_t _packet[255];
bool _preinit_done; bool _preinit_done;
bool _kct8103l;
void (*_onReceive)(int); void (*_onReceive)(int);
}; };