Merge remote-tracking branch 'upstream/dev' into jbrazio/2025_3f11ad35

This commit is contained in:
João Brázio 2025-09-01 10:47:19 +01:00
commit cf4720bd34
No known key found for this signature in database
GPG key ID: 56A1490716A324DD
60 changed files with 1233 additions and 239 deletions

View file

@ -26,7 +26,7 @@ build_src_filter = ${esp32_base.build_src_filter}
extends = Generic_ESPNOW
build_flags =
${Generic_ESPNOW.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=1
build_src_filter = ${Generic_ESPNOW.build_src_filter}
+<../examples/simple_secure_chat/main.cpp>
@ -54,7 +54,7 @@ lib_deps =
extends = Generic_ESPNOW
build_flags =
${Generic_ESPNOW.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1

View file

@ -55,7 +55,7 @@ build_flags =
${Heltec_ct62.build_flags}
; -D ARDUINO_USB_MODE=1
; -D ARDUINO_USB_CDC_ON_BOOT=1
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
@ -73,7 +73,7 @@ build_flags =
${Heltec_ct62.build_flags}
; -D ARDUINO_USB_MODE=1
; -D ARDUINO_USB_CDC_ON_BOOT=1
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D OFFLINE_QUEUE_SIZE=256
-D BLE_PIN_CODE=123456

View file

@ -43,7 +43,7 @@ build_flags =
-D ARDUINO_USB_CDC_ON_BOOT=1 ; need for Serial
-D DISPLAY_ROTATION=1
-D DISPLAY_CLASS=ST7735Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456 ; HWT will use display for pin
-D OFFLINE_QUEUE_SIZE=256

View file

@ -64,7 +64,7 @@ lib_deps =
extends = Heltec_lora32_v2
build_flags =
${Heltec_lora32_v2.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=170
-D MAX_GROUP_CHANNELS=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -80,7 +80,7 @@ build_flags =
${Heltec_lora32_v2.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=170
-D MAX_GROUP_CHANNELS=8
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
@ -100,7 +100,7 @@ build_flags =
${Heltec_lora32_v2.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=170
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -94,7 +94,7 @@ lib_deps =
extends = Heltec_lora32_v3
build_flags =
${Heltec_lora32_v3.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -109,7 +109,7 @@ extends = Heltec_lora32_v3
build_flags =
${Heltec_lora32_v3.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=SSD1306Display
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
@ -151,7 +151,8 @@ lib_deps =
extends = Heltec_lora32_v3
build_flags =
${Heltec_lora32_v3.build_flags}
-D MAX_CONTACTS=100
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=SSD1306Display
-D WIFI_DEBUG_LOGGING=1
@ -163,7 +164,8 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/esp32/*.cpp>
+<../examples/companion_radio>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Heltec_lora32_v3.lib_deps}
densaugeo/base64 @ ~1.4.0
@ -227,7 +229,7 @@ lib_deps =
extends = Heltec_lora32_v3
build_flags =
${Heltec_lora32_v3.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -28,7 +28,7 @@ build_flags =
-D DISP_MOSI=6
-D Vision_Master_E213
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/heltec_vision_master_e213>
+<../variants/heltec_vision_master_e213>
lib_deps =
${esp32_base.lib_deps}
https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip
@ -37,7 +37,8 @@ lib_deps =
extends = Heltec_Vision_Master_E213_base
build_flags =
${Heltec_Vision_Master_E213_base.build_flags}
-D MAX_CONTACTS=100
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=E213Display
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
@ -46,7 +47,8 @@ build_flags =
build_src_filter = ${Heltec_Vision_Master_E213_base.build_src_filter}
+<helpers/ui/E213Display.cpp>
+<helpers/esp32/*.cpp>
+<../examples/companion_radio>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Heltec_Vision_Master_E213_base.lib_deps}
densaugeo/base64 @ ~1.4.0

View file

@ -19,6 +19,7 @@ SensorManager sensors;
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
#endif
bool radio_init() {

View file

@ -9,6 +9,7 @@
#include <helpers/SensorManager.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/E213Display.h>
#include <helpers/ui/MomentaryButton.h>
#endif
extern HeltecE213Board board;
@ -18,6 +19,7 @@ extern SensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
extern MomentaryButton user_btn;
#endif
bool radio_init();

View file

@ -22,7 +22,7 @@ build_flags =
-D PIN_BOARD_SCL=38
-D Vision_Master_E290
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/heltec_vision_master_e290>
+<../variants/heltec_vision_master_e290>
lib_deps =
${esp32_base.lib_deps}
https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip
@ -31,7 +31,8 @@ lib_deps =
extends = Heltec_Vision_Master_E290_base
build_flags =
${Heltec_Vision_Master_E290_base.build_flags}
-D MAX_CONTACTS=100
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=E290Display
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
@ -40,7 +41,8 @@ build_flags =
build_src_filter = ${Heltec_Vision_Master_E290_base.build_src_filter}
+<helpers/ui/E290Display.cpp>
+<helpers/esp32/*.cpp>
+<../examples/companion_radio>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Heltec_Vision_Master_E290_base.lib_deps}
densaugeo/base64 @ ~1.4.0

View file

@ -19,6 +19,7 @@ SensorManager sensors;
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
#endif
bool radio_init() {

View file

@ -9,6 +9,7 @@
#include <helpers/SensorManager.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/E290Display.h>
#include <helpers/ui/MomentaryButton.h>
#endif
extern HeltecE290Board board;
@ -18,6 +19,7 @@ extern SensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
extern MomentaryButton user_btn;
#endif
bool radio_init();

View file

@ -0,0 +1,69 @@
#include "HeltecT190Board.h"
void HeltecT190Board::begin() {
ESP32Board::begin();
pinMode(PIN_ADC_CTRL, OUTPUT);
digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive
periph_power.begin();
esp_reset_reason_t reason = esp_reset_reason();
if (reason == ESP_RST_DEEPSLEEP) {
long wakeup_source = esp_sleep_get_ext1_wakeup_status();
if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep)
startup_reason = BD_STARTUP_RX_PACKET;
}
rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS);
rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1);
}
}
void HeltecT190Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) {
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1);
rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS);
if (pin_wake_btn < 0) {
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet
} else {
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn
}
if (secs > 0) {
esp_sleep_enable_timer_wakeup(secs * 1000000);
}
// Finally set ESP32 into sleep
esp_deep_sleep_start(); // CPU halts here and never returns!
}
void HeltecT190Board::powerOff() {
// TODO: re-enable this when there is a definite wake-up source pin:
// enterDeepSleep(0);
}
uint16_t HeltecT190Board::getBattMilliVolts() {
analogReadResolution(10);
digitalWrite(PIN_ADC_CTRL, HIGH);
delay(10);
uint32_t raw = 0;
for (int i = 0; i < 8; i++) {
raw += analogRead(PIN_VBAT_READ);
}
raw = raw / 8;
digitalWrite(PIN_ADC_CTRL, LOW);
return (5.42 * (3.3 / 1024.0) * raw) * 1000;
}
const char* HeltecT190Board::getManufacturerName() const {
return "Heltec T190";
}

View file

@ -0,0 +1,30 @@
#pragma once
#include <Arduino.h>
#include <helpers/RefCountedDigitalPin.h>
#include <helpers/ESP32Board.h>
#include <driver/rtc_io.h>
// LoRa radio module pins for heltec_vision_master_e290
#define P_LORA_DIO_1 14
#define P_LORA_NSS 8
#define P_LORA_RESET 12
#define P_LORA_BUSY 13
#define P_LORA_SCLK 9
#define P_LORA_MISO 11
#define P_LORA_MOSI 10
class HeltecT190Board : public ESP32Board {
public:
RefCountedDigitalPin periph_power;
HeltecT190Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { }
void begin();
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1);
void powerOff() override;
uint16_t getBattMilliVolts() override;
const char* getManufacturerName() const override ;
};

View file

@ -0,0 +1,61 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant
#define BUILTIN_LED LED_BUILTIN // Backward compatibility
#define LED_BUILTIN LED_BUILTIN
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 2;
static const uint8_t SCL = 1;
static const uint8_t SS = 8;
static const uint8_t MOSI = 10;
static const uint8_t MISO = 11;
static const uint8_t SCK = 9;
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t A9 = 10;
static const uint8_t A10 = 11;
static const uint8_t A11 = 12;
static const uint8_t A12 = 13;
static const uint8_t A13 = 14;
static const uint8_t A14 = 15;
static const uint8_t A15 = 16;
static const uint8_t A16 = 17;
static const uint8_t A17 = 18;
static const uint8_t A18 = 19;
static const uint8_t A19 = 20;
static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T13 = 13;
static const uint8_t T14 = 14;
static const uint8_t RST_LoRa = 12;
static const uint8_t BUSY_LoRa = 13;
static const uint8_t DIO1 = 14;
#endif /* Pins_Arduino_h */

View file

@ -0,0 +1,87 @@
[Heltec_Vision_Master_T190_base]
extends = esp32_base
board = heltec_vision_master_t190
build_flags =
${esp32_base.build_flags}
-I variants/heltec_vision_master_t190
-I src/helpers/ui
-D HELTEC_VISION_MASTER_T190
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
-D PIN_USER_BTN=0
-D PIN_VEXT_EN=5
-D PIN_VEXT_EN_ACTIVE=HIGH
-D PIN_VBAT_READ=6
-D PIN_ADC_CTRL=46
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D PIN_BOARD_SDA=2
-D PIN_BOARD_SCL=1
-D PIN_TFT_SCL=38
-D PIN_TFT_SDA=48
-D PIN_TFT_RST=40
-D PIN_TFT_VDD_CTL=7
-D PIN_TFT_LEDA_CTL=17
-D PIN_TFT_LEDA_CTL_ACTIVE=HIGH
-D PIN_TFT_CS=39
-D PIN_TFT_DC=47
-D ST7789
-D DISPLAY_CLASS=ST7789Display
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/heltec_vision_master_t190>
+<helpers/*.cpp>
+<helpers/ui/ST7789Display.cpp>
+<helpers/ui/OLEDDisplay.cpp>
+<helpers/ui/OLEDDisplayFonts.cpp>
lib_deps =
${esp32_base.lib_deps}
adafruit/Adafruit GFX Library @ ^1.12.1
[env:Heltec_Vision_Master_T190_radio_ble]
extends = Heltec_Vision_Master_T190_base
build_flags =
${Heltec_Vision_Master_T190_base.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
-D BLE_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${Heltec_Vision_Master_T190_base.build_src_filter}
+<helpers/esp32/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Heltec_Vision_Master_T190_base.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:Heltec_Vision_Master_T190_repeater]
extends = Heltec_Vision_Master_T190_base
build_flags =
${Heltec_Vision_Master_T190_base.build_flags}
-D ADVERT_NAME='"Heltec T190 Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
build_src_filter = ${Heltec_Vision_Master_T190_base.build_src_filter}
+<../examples/simple_repeater>
lib_deps =
${Heltec_Vision_Master_T190_base.lib_deps}
${esp32_ota.lib_deps}
[env:Heltec_Vision_Master_T190_room_server]
extends = Heltec_Vision_Master_T190_base
build_flags =
${Heltec_Vision_Master_T190_base.build_flags}
-D ADVERT_NAME='"Heltec T190 Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
build_src_filter = ${Heltec_Vision_Master_T190_base.build_src_filter}
+<../examples/simple_room_server>
lib_deps =
${Heltec_Vision_Master_T190_base.lib_deps}
${esp32_ota.lib_deps}

View file

@ -0,0 +1,54 @@
#include "target.h"
#include <Arduino.h>
HeltecT190Board board;
#if defined(P_LORA_SCLK)
static SPIClass spi(FSPI);
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
#else
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
#endif
WRAPPER_CLASS radio_driver(radio, board);
ESP32RTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
SensorManager sensors;
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
#endif
bool radio_init() {
fallback_clock.begin();
rtc_clock.begin(Wire);
#if defined(P_LORA_SCLK)
return radio.std_init(&spi);
#else
return radio.std_init();
#endif
}
uint32_t radio_get_rng_seed() {
return radio.random(0x7FFFFFFF);
}
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
radio.setFrequency(freq);
radio.setSpreadingFactor(sf);
radio.setBandwidth(bw);
radio.setCodingRate(cr);
}
void radio_set_tx_power(uint8_t dbm) {
radio.setOutputPower(dbm);
}
mesh::LocalIdentity radio_new_identity() {
RadioNoiseListener rng(radio);
return mesh::LocalIdentity(&rng); // create new random identity
}

View file

@ -0,0 +1,29 @@
#pragma once
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <HeltecT190Board.h>
#include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/ST7789Display.h>
#include <helpers/ui/MomentaryButton.h>
#endif
extern HeltecT190Board board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern SensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
extern MomentaryButton user_btn;
#endif
bool radio_init();
uint32_t radio_get_rng_seed();
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
void radio_set_tx_power(uint8_t dbm);
mesh::LocalIdentity radio_new_identity();

View file

@ -28,7 +28,7 @@ build_flags =
-D ARDUINO_heltec_wifi_lora_32_V3
-D WIRELESS_PAPER
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/heltec_wireless_paper>
+<../variants/heltec_wireless_paper>
lib_deps =
${esp32_base.lib_deps}
https://github.com/todd-herbert/heltec-eink-modules/archive/9207eb6ab2b96f66298e0488740218c17b006af7.zip
@ -37,7 +37,8 @@ lib_deps =
extends = Heltec_Wireless_Paper_base
build_flags =
${Heltec_Wireless_Paper_base.build_flags}
-D MAX_CONTACTS=100
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=E213Display
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
@ -46,7 +47,8 @@ build_flags =
build_src_filter = ${Heltec_Wireless_Paper_base.build_src_filter}
+<helpers/ui/E213Display.cpp>
+<helpers/esp32/*.cpp>
+<../examples/companion_radio>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Heltec_Wireless_Paper_base.lib_deps}
densaugeo/base64 @ ~1.4.0

View file

@ -19,6 +19,7 @@ SensorManager sensors;
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
#endif
bool radio_init() {

View file

@ -9,6 +9,7 @@
#include <helpers/SensorManager.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/E213Display.h>
#include <helpers/ui/MomentaryButton.h>
#endif
extern HeltecV3Board board;
@ -18,6 +19,7 @@ extern SensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
extern MomentaryButton user_btn;
#endif
bool radio_init();

View file

@ -5,20 +5,6 @@
#ifdef XIAO_NRF52
// redefine lora pins if using the S3 variant of SX1262 board
#ifdef SX1262_XIAO_S3_VARIANT
#undef P_LORA_DIO_1
#undef P_LORA_BUSY
#undef P_LORA_RESET
#undef P_LORA_NSS
#undef SX126X_RXEN
#define P_LORA_DIO_1 D0
#define P_LORA_BUSY D1
#define P_LORA_RESET D2
#define P_LORA_NSS D3
#define SX126X_RXEN D4
#endif
class ikoka_stick_nrf_board : public mesh::MainBoard {
protected:
uint8_t startup_reason;
@ -29,10 +15,10 @@ public:
#if defined(P_LORA_TX_LED)
void onBeforeTransmit() override {
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on
}
void onAfterTransmit() override {
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off
}
#endif

View file

@ -19,11 +19,10 @@ lib_deps =
adafruit/Adafruit INA3221 Library @ ^1.0.1
adafruit/Adafruit INA219 @ ^1.2.3
adafruit/Adafruit AHTX0 @ ^2.0.5
adafruit/Adafruit BME280 Library @ ^2.3.0
adafruit/Adafruit BME280 Library @ ^2.3.0
adafruit/Adafruit SSD1306 @ ^2.5.13
[ikoka_stick_nrf]
[ikoka_stick_nrf_baseboard]
extends = nrf52840_xiao
;board_build.ldscript = boards/nrf52840_s140_v7.ld
build_flags = ${nrf52840_xiao.build_flags}
@ -34,7 +33,6 @@ build_flags = ${nrf52840_xiao.build_flags}
-D DISPLAY_ROTATION=2
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=9
-D P_LORA_DIO_1=D1
-D P_LORA_RESET=D2
-D P_LORA_BUSY=D3
@ -52,19 +50,59 @@ build_flags = ${nrf52840_xiao.build_flags}
-D ENV_INCLUDE_BME280=1
-D ENV_INCLUDE_INA3221=1
-D ENV_INCLUDE_INA219=1
debug_tool = jlink
upload_protocol = nrfutil
;;; abstracted hardware variants
[ikoka_stick_nrf_e22_22dbm]
extends = ikoka_stick_nrf_baseboard
; No PA in this model, full 22dBm
build_flags =
${ikoka_stick_nrf_baseboard.build_flags}
-D LORA_TX_POWER=22
build_src_filter = ${nrf52840_xiao.build_src_filter}
+<helpers/*.cpp>
+<helpers/sensors>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../variants/ikoka_stick_nrf>
debug_tool = jlink
upload_protocol = nrfutil
[env:ikoka_stick_nrf_companion_radio_ble]
extends = ikoka_stick_nrf
[ikoka_stick_nrf_e22_30dbm]
extends = ikoka_stick_nrf_baseboard
; limit txpower to 20dBm on E22-900M30S. Anything higher will
; cause distortion in the PA output. 20dBm in -> 30dBm out
build_flags =
${ikoka_stick_nrf.build_flags}
${ikoka_stick_nrf_baseboard.build_flags}
-D LORA_TX_POWER=20
build_src_filter = ${nrf52840_xiao.build_src_filter}
+<helpers/*.cpp>
+<helpers/sensors>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../variants/ikoka_stick_nrf>
[ikoka_stick_nrf_e22_33dbm]
extends = ikoka_stick_nrf_baseboard
; limit txpower to 9dBm on E22-900M33S to avoid hardware damage
; to the rf amplifier frontend. 9dBm in -> 33dBm out
build_flags =
${ikoka_stick_nrf_baseboard.build_flags}
-D LORA_TX_POWER=9
build_src_filter = ${nrf52840_xiao.build_src_filter}
+<helpers/*.cpp>
+<helpers/sensors>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../variants/ikoka_stick_nrf>
;;; abstracted firmware roles
[ikoka_stick_nrf_companion_radio_ble]
extends = ikoka_stick_nrf_baseboard
build_flags =
${ikoka_stick_nrf_baseboard.build_flags}
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
@ -73,35 +111,35 @@ build_flags =
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ikoka_stick_nrf.lib_deps}
${ikoka_stick_nrf_baseboard.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:ikoka_stick_nrf_companion_radio_usb]
extends = ikoka_stick_nrf
[ikoka_stick_nrf_companion_radio_usb]
extends = ikoka_stick_nrf_baseboard
build_flags =
${ikoka_stick_nrf.build_flags}
${ikoka_stick_nrf_baseboard.build_flags}
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=8
-I examples/companion_radio/ui-new
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ikoka_stick_nrf.lib_deps}
${ikoka_stick_nrf_baseboard.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:ikoka_stick_nrf_repeater]
extends = ikoka_stick_nrf
[ikoka_stick_nrf_repeater]
extends = ikoka_stick_nrf_baseboard
build_flags =
${ikoka_stick_nrf.build_flags}
${ikoka_stick_nrf_baseboard.build_flags}
-D ADVERT_NAME='"Ikoka Stick Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
@ -109,19 +147,161 @@ build_flags =
-D MAX_NEIGHBOURS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_repeater/*.cpp>
[env:ikoka_stick_nrf_room_server]
extends = ikoka_stick_nrf
[ikoka_stick_nrf_room_server]
extends = ikoka_stick_nrf_baseboard
build_flags =
${ikoka_stick_nrf.build_flags}
${ikoka_stick_nrf_baseboard.build_flags}
-D ADVERT_NAME='"Ikoka Stick Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
+<../examples/simple_room_server/*.cpp>
;;; hardware + firmware variants
;;; 22dBm EBYTE E22-900M22 variants
[env:ikoka_stick_nrf_22dbm_companion_radio_usb]
extends =
ikoka_stick_nrf_e22_22dbm
ikoka_stick_nrf_companion_radio_usb
build_flags =
${ikoka_stick_nrf_companion_radio_usb.build_flags}
${ikoka_stick_nrf_e22_22dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_usb.build_src_filter}
${ikoka_stick_nrf_e22_22dbm.build_src_filter}
[env:ikoka_stick_nrf_22dbm_companion_radio_ble]
extends =
ikoka_stick_nrf_e22_22dbm
ikoka_stick_nrf_companion_radio_ble
build_flags =
${ikoka_stick_nrf_companion_radio_ble.build_flags}
${ikoka_stick_nrf_e22_22dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_ble.build_src_filter}
${ikoka_stick_nrf_e22_22dbm.build_src_filter}
[env:ikoka_stick_nrf_22dbm_repeater]
extends =
ikoka_stick_nrf_e22_22dbm
ikoka_stick_nrf_repeater
build_flags =
${ikoka_stick_nrf_repeater.build_flags}
${ikoka_stick_nrf_e22_22dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_repeater.build_src_filter}
${ikoka_stick_nrf_e22_22dbm.build_src_filter}
[env:ikoka_stick_nrf_22dbm_room_server]
extends =
ikoka_stick_nrf_e22_22dbm
ikoka_stick_nrf_room_server
build_flags =
${ikoka_stick_nrf_room_server.build_flags}
${ikoka_stick_nrf_e22_22dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_room_server.build_src_filter}
${ikoka_stick_nrf_e22_22dbm.build_src_filter}
;;; 30dBm EBYTE E22-900M30 variants
[env:ikoka_stick_nrf_30dbm_companion_radio_usb]
extends =
ikoka_stick_nrf_e22_30dbm
ikoka_stick_nrf_companion_radio_usb
build_flags =
${ikoka_stick_nrf_companion_radio_usb.build_flags}
${ikoka_stick_nrf_e22_30dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_usb.build_src_filter}
${ikoka_stick_nrf_e22_30dbm.build_src_filter}
[env:ikoka_stick_nrf_30dbm_companion_radio_ble]
extends =
ikoka_stick_nrf_e22_30dbm
ikoka_stick_nrf_companion_radio_ble
build_flags =
${ikoka_stick_nrf_companion_radio_ble.build_flags}
${ikoka_stick_nrf_e22_30dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_ble.build_src_filter}
${ikoka_stick_nrf_e22_30dbm.build_src_filter}
[env:ikoka_stick_nrf_30dbm_repeater]
extends =
ikoka_stick_nrf_e22_30dbm
ikoka_stick_nrf_repeater
build_flags =
${ikoka_stick_nrf_repeater.build_flags}
${ikoka_stick_nrf_e22_30dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_repeater.build_src_filter}
${ikoka_stick_nrf_e22_30dbm.build_src_filter}
[env:ikoka_stick_nrf_30dbm_room_server]
extends =
ikoka_stick_nrf_e22_30dbm
ikoka_stick_nrf_room_server
build_flags =
${ikoka_stick_nrf_room_server.build_flags}
${ikoka_stick_nrf_e22_30dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_room_server.build_src_filter}
${ikoka_stick_nrf_e22_30dbm.build_src_filter}
;;; 33dBm EBYTE E22-900M33 variants
[env:ikoka_stick_nrf_33dbm_companion_radio_usb]
extends =
ikoka_stick_nrf_e22_33dbm
ikoka_stick_nrf_companion_radio_usb
build_flags =
${ikoka_stick_nrf_companion_radio_usb.build_flags}
${ikoka_stick_nrf_e22_33dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_usb.build_src_filter}
${ikoka_stick_nrf_e22_33dbm.build_src_filter}
[env:ikoka_stick_nrf_33dbm_companion_radio_ble]
extends =
ikoka_stick_nrf_e22_33dbm
ikoka_stick_nrf_companion_radio_ble
build_flags =
${ikoka_stick_nrf_companion_radio_ble.build_flags}
${ikoka_stick_nrf_e22_33dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_companion_radio_ble.build_src_filter}
${ikoka_stick_nrf_e22_33dbm.build_src_filter}
[env:ikoka_stick_nrf_33dbm_repeater]
extends =
ikoka_stick_nrf_e22_33dbm
ikoka_stick_nrf_repeater
build_flags =
${ikoka_stick_nrf_repeater.build_flags}
${ikoka_stick_nrf_e22_33dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_repeater.build_src_filter}
${ikoka_stick_nrf_e22_33dbm.build_src_filter}
[env:ikoka_stick_nrf_33dbm_room_server]
extends =
ikoka_stick_nrf_e22_33dbm
ikoka_stick_nrf_room_server
build_flags =
${ikoka_stick_nrf_room_server.build_flags}
${ikoka_stick_nrf_e22_33dbm.build_flags}
build_src_filter =
${ikoka_stick_nrf_room_server.build_src_filter}
${ikoka_stick_nrf_e22_33dbm.build_src_filter}

View file

@ -56,7 +56,7 @@ lib_deps =
extends = LilyGo_T3S3_sx1262
build_flags =
${LilyGo_T3S3_sx1262.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -91,7 +91,7 @@ build_flags =
${LilyGo_T3S3_sx1262.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
@ -110,7 +110,7 @@ build_flags =
${LilyGo_T3S3_sx1262.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -54,7 +54,7 @@ lib_deps =
extends = LilyGo_T3S3_sx1276
build_flags =
${LilyGo_T3S3_sx1276.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -90,7 +90,7 @@ build_flags =
${LilyGo_T3S3_sx1276.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D MESH_PACKET_LOGGING=1
-D MESH_DEBUG=1
@ -109,7 +109,7 @@ build_flags =
${LilyGo_T3S3_sx1276.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SSD1306Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -24,7 +24,7 @@ build_src_filter = ${esp32_base.build_src_filter}
+<../variants/lilygo_tbeam_SX1262>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/esp32/TBeamBoard.cpp>
+<helpers/sensors>
+<helpers/sensors>
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
lib_deps =
${esp32_base.lib_deps}
@ -38,7 +38,7 @@ board_build.upload.maximum_ram_size=2000000
build_flags =
${LilyGo_TBeam_SX1262.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=256

View file

@ -22,7 +22,7 @@ build_src_filter = ${esp32_base.build_src_filter}
+<../variants/lilygo_tbeam_SX1276>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/esp32/TBeamBoard.cpp>
+<helpers/sensors>
+<helpers/sensors>
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
lib_deps =
${esp32_base.lib_deps}
@ -37,7 +37,7 @@ board_build.upload.maximum_ram_size=2000000
build_flags =
${LilyGo_TBeam_SX1276.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
; -D BLE_DEBUG_LOGGING=1

View file

@ -25,7 +25,7 @@ build_src_filter = ${esp32_base.build_src_filter}
+<../variants/lilygo_tbeam_supreme_SX1262>
+<helpers/ui/SH1106Display.cpp>
+<helpers/esp32/TBeamBoard.cpp>
+<helpers/sensors>
+<helpers/sensors>
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
lib_deps =
${esp32_base.lib_deps}
@ -74,7 +74,7 @@ extends = T_Beam_S3_Supreme_SX1262
build_flags =
${T_Beam_S3_Supreme_SX1262.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=256

View file

@ -67,7 +67,7 @@ lib_deps =
[env:LilyGo_Tlora_C6_companion_radio_ble]
extends = tlora_c6
build_flags = ${tlora_c6.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -90,7 +90,7 @@ lib_deps =
extends = LilyGo_TLora_V2_1_1_6
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -106,7 +106,7 @@ extends = LilyGo_TLora_V2_1_1_6
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
@ -124,7 +124,7 @@ extends = LilyGo_TLora_V2_1_1_6
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=256
@ -158,3 +158,23 @@ build_flags =
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
${esp32_ota.lib_deps}
[env:LilyGo_TLora_V2_1_1_6_companion_radio_wifi]
extends = LilyGo_TLora_V2_1_1_6
build_flags =
${LilyGo_TLora_V2_1_1_6.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D WIFI_SSID='"ssid"'
-D WIFI_PWD='"password"'
-D WIFI_DEBUG_LOGGING=1
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0

View file

@ -80,8 +80,11 @@ extends = Meshadventurer
build_src_filter = ${Meshadventurer.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
build_flags =
${Meshadventurer.build_flags}
-I examples/companion_radio/ui-new
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
@ -99,8 +102,11 @@ build_src_filter = ${Meshadventurer.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<helpers/esp32/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
build_flags =
${Meshadventurer.build_flags}
-I examples/companion_radio/ui-new
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
@ -159,8 +165,11 @@ extends = Meshadventurer
build_src_filter = ${Meshadventurer.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
build_flags =
${Meshadventurer.build_flags}
-I examples/companion_radio/ui-new
-D RADIO_CLASS=CustomSX1268
-D WRAPPER_CLASS=CustomSX1268Wrapper
-D LORA_TX_POWER=22
@ -178,8 +187,11 @@ build_src_filter = ${Meshadventurer.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<helpers/esp32/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
build_flags =
${Meshadventurer.build_flags}
-I examples/companion_radio/ui-new
-D RADIO_CLASS=CustomSX1268
-D WRAPPER_CLASS=CustomSX1268Wrapper
-D LORA_TX_POWER=22

View file

@ -18,10 +18,6 @@ MASensorManager sensors = MASensorManager(nmea);
DISPLAY_CLASS display;
#endif
#ifndef LORA_CR
#define LORA_CR 5
#endif
bool radio_init() {
fallback_clock.begin();
rtc_clock.begin(Wire);

View file

@ -1,39 +1,40 @@
#pragma once
#include <MeshCore.h>
#include "variant.h"
#include <Arduino.h>
#include <MeshCore.h>
// LoRa radio module pins
#define P_LORA_DIO_1 (32 + 10)
#define P_LORA_NSS (32 + 13)
#define P_LORA_RESET (32 + 15)
#define P_LORA_BUSY (32 + 11)
#define P_LORA_SCLK (0 + 12)
#define P_LORA_MISO (32 + 9)
#define P_LORA_MOSI (0 + 11)
#define P_LORA_DIO_1 (32 + 10)
#define P_LORA_NSS (32 + 13)
#define P_LORA_RESET (32 + 15)
#define P_LORA_BUSY (32 + 11)
#define P_LORA_SCLK (0 + 12)
#define P_LORA_MISO (32 + 9)
#define P_LORA_MOSI (0 + 11)
#define SX126X_DIO2_AS_RF_SWITCH true
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define SX126X_POWER_EN 37
#define SX126X_POWER_EN 37
// buttons
#define PIN_BUTTON1 (32 + 6)
#define BUTTON_PIN PIN_BUTTON1
#define PIN_USER_BTN BUTTON_PIN
#define PIN_BUTTON1 (32 + 6)
#define BUTTON_PIN PIN_BUTTON1
#define PIN_USER_BTN BUTTON_PIN
// GPS
#define GPS_EN PIN_GPS_STANDBY
#define GPS_EN PIN_GPS_STANDBY
// built-ins
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT, actually 100K + 100K
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT, actually 100K + 100K
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
#define PIN_VBAT_READ (0 + 2)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
#define PIN_VBAT_READ (0 + 2)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
class NanoG2Ultra : public mesh::MainBoard
{
class NanoG2Ultra : public mesh::MainBoard {
protected:
uint8_t startup_reason;
@ -42,18 +43,21 @@ public:
uint16_t getBattMilliVolts() override;
bool startOTAUpdate(const char *id, char reply[]) override;
uint8_t getStartupReason() const override
{
return startup_reason;
}
uint8_t getStartupReason() const override { return startup_reason; }
const char *getManufacturerName() const override
{
return "Nano G2 Ultra";
}
const char *getManufacturerName() const override { return "Nano G2 Ultra"; }
void reboot() override
{
NVIC_SystemReset();
void reboot() override { NVIC_SystemReset(); }
void powerOff() override {
// put GPS chip to sleep
digitalWrite(PIN_GPS_STANDBY, LOW);
// unset buzzer to prevent notification circuit activating on hibernate
#undef PIN_BUZZER
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(PIN_USER_BTN), NRF_GPIO_PIN_NOPULL,
NRF_GPIO_PIN_SENSE_LOW);
sd_power_system_off();
}
};

View file

@ -10,7 +10,11 @@ RAK4631Board board;
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
#if defined(PIN_USER_BTN_ANA)
MomentaryButton analog_btn(PIN_USER_BTN_ANA, 1000, 20);
#endif
#endif
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);

View file

@ -13,6 +13,9 @@
extern DISPLAY_CLASS display;
#include <helpers/ui/MomentaryButton.h>
extern MomentaryButton user_btn;
#if defined(PIN_USER_BTN_ANA)
extern MomentaryButton analog_btn;
#endif
#endif
extern RAK4631Board board;

View file

@ -45,6 +45,25 @@ lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
[env:Station_G2_logging_repeater]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-D ADVERT_NAME='"Station G2 Logging Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=8
-D MESH_PACKET_LOGGING=1
-D SX126X_RX_BOOSTED_GAIN=1
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
; -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<../examples/simple_repeater>
lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
[env:Station_G2_room_server]
extends = Station_G2
build_src_filter = ${Station_G2.build_src_filter}
@ -68,7 +87,7 @@ build_flags =
${Station_G2.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SH1106Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
@ -86,7 +105,7 @@ build_flags =
${Station_G2.build_flags}
-I examples/companion_radio/ui-new
-D DISPLAY_CLASS=SH1106Display
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1

View file

@ -34,6 +34,65 @@ build_src_filter = ${nrf52840_t1000e.build_src_filter}
debug_tool = jlink
upload_protocol = nrfutil
[env:t1000e_repeater]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-D ADVERT_NAME='"t1000-e Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D RX_BOOSTED_GAIN=true
-D RF_SWITCH_TABLE
build_src_filter = ${t1000-e.build_src_filter}
+<../examples/simple_repeater>
lib_deps = ${t1000-e.lib_deps}
stevemarple/MicroNMEA @ ^2.0.6
[env:t1000e_room_server]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-D ADVERT_NAME='"t1000-e Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D RX_BOOSTED_GAIN=true
-D RF_SWITCH_TABLE
build_src_filter = ${t1000-e.build_src_filter}
+<../examples/simple_room_server>
lib_deps = ${t1000-e.lib_deps}
stevemarple/MicroNMEA @ ^2.0.6
[env:t1000e_companion_radio_usb]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
-I examples/companion_radio/ui-orig
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D OFFLINE_QUEUE_SIZE=256
-D RX_BOOSTED_GAIN=true
-D RF_SWITCH_TABLE
-D DISPLAY_CLASS=NullDisplayDriver
-D PIN_BUZZER=25
-D PIN_BUZZER_EN=37 ; P1/5 - required for T1000-E
build_src_filter = ${t1000-e.build_src_filter}
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-orig/*.cpp>
lib_deps = ${t1000-e.lib_deps}
densaugeo/base64 @ ~1.4.0
stevemarple/MicroNMEA @ ^2.0.6
end2endzone/NonBlockingRTTTL@^1.3.0
[env:t1000e_companion_radio_ble]
extends = t1000-e
build_flags = ${t1000-e.build_flags}
@ -58,4 +117,4 @@ build_src_filter = ${t1000-e.build_src_filter}
lib_deps = ${t1000-e.lib_deps}
densaugeo/base64 @ ~1.4.0
stevemarple/MicroNMEA @ ^2.0.6
end2endzone/NonBlockingRTTTL@^1.3.0
end2endzone/NonBlockingRTTTL@^1.3.0

View file

@ -77,6 +77,7 @@ build_flags =
-D DISPLAY_CLASS=GxEPDDisplay
-D OFFLINE_QUEUE_SIZE=256
-D PIN_BUZZER=6
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M1.build_src_filter}

View file

@ -19,28 +19,6 @@ build_flags =
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/xiao_c3>
[Xiao_esp32_C3_custom]
extends = esp32_base
board = seeed_xiao_esp32c3
build_flags =
${esp32_base.build_flags}
-I variants/xiao_c3
-D ESP32_CPU_FREQ=80
-D LORA_TX_BOOST_PIN=D3
-D P_LORA_TX_LED=D5
-D PIN_VBAT_READ=D0
-D P_LORA_DIO_1=D2
-D P_LORA_NSS=D4
-D P_LORA_RESET=RADIOLIB_NC
-D P_LORA_BUSY=D1
-D PIN_BOARD_SDA=D6
-D PIN_BOARD_SCL=D7
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/xiao_c3>
[env:Xiao_C3_Repeater_sx1262]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
@ -74,7 +52,7 @@ build_flags =
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D SX126X_RX_BOOSTED_GAIN=1
-D LORA_TX_POWER=22
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=256
@ -97,7 +75,7 @@ build_flags =
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D SX126X_RX_BOOSTED_GAIN=1
-D LORA_TX_POWER=22
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D OFFLINE_QUEUE_SIZE=256
; -D BLE_DEBUG_LOGGING=1
@ -107,46 +85,3 @@ lib_deps =
${Xiao_esp32_C3.lib_deps}
${esp32_ota.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:Xiao_C3_Repeater_sx1262_custom]
extends = Xiao_esp32_C3_custom
build_src_filter = ${Xiao_esp32_C3_custom.build_src_filter}
+<../examples/simple_repeater/main.cpp>
build_flags =
${Xiao_esp32_C3_custom.build_flags}
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D SX126X_RX_BOOSTED_GAIN=1
-D LORA_TX_POWER=22
-D ADVERT_NAME='"Xiao Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_esp32_C3_custom.lib_deps}
${esp32_ota.lib_deps}
bakercp/CRC32 @ ^2.0.0
[env:Xiao_C3_Repeater_sx1268_custom]
extends = Xiao_esp32_C3_custom
build_src_filter = ${Xiao_esp32_C3_custom.build_src_filter}
+<../examples/simple_repeater/main.cpp>
build_flags =
${Xiao_esp32_C3_custom.build_flags}
-D RADIO_CLASS=CustomSX1268
-D WRAPPER_CLASS=CustomSX1268Wrapper
-D LORA_TX_POWER=22
-D ADVERT_NAME='"Xiao Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_esp32_C3_custom.lib_deps}
${esp32_ota.lib_deps}
bakercp/CRC32 @ ^2.0.0

View file

@ -50,7 +50,7 @@ lib_deps =
[env:Xiao_C6_companion_radio_ble]
extends = Xiao_C6
build_flags = ${Xiao_C6.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
@ -107,7 +107,7 @@ lib_deps =
[env:Meshimi_companion_radio_ble]
extends = Meshimi
build_flags = ${Meshimi.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
@ -121,3 +121,65 @@ build_src_filter = ${Meshimi.build_src_filter}
lib_deps =
${Meshimi.lib_deps}
densaugeo/base64 @ ~1.4.0
; WHY2025 badge variant
; requires soldering 2 pins between the esp32-C6 and the lora chip as shown here: https://wiki.why2025.org/Project:Meshtastic_on_the_WHY2025_badge
; also requires wiping the esp32-P4
[WHY2025_badge]
extends = Xiao_C6
board_build.partitions = default_8MB.csv
board_upload.flash_size = 8MB
board_upload.maximum_size = 8388608
build_flags =
${Xiao_C6.build_flags}
-D P_LORA_SCLK=6
-D P_LORA_MISO=2
-D P_LORA_MOSI=7
-D P_LORA_NSS=4
-D P_LORA_DIO_1=5
-D P_LORA_BUSY=11
-D P_LORA_RESET=1
-D SX126X_TXEN=3
-UPIN_BOARD_SDA
-UPIN_BOARD_SCL
-UP_LORA_TX_LED
-USX126X_RXEN
-USX126X_DIO2_AS_RF_SWITCH
-USX126X_DIO3_TCXO_VOLTAGE
[env:WHY2025_badge_Repeater]
extends = WHY2025_badge
build_src_filter = ${WHY2025_badge.build_src_filter}
+<../examples/simple_repeater/main.cpp>
build_flags =
${WHY2025_badge.build_flags}
-D ADVERT_NAME='"WHY2025 Badge Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${WHY2025_badge.lib_deps}
; ${esp32_ota.lib_deps}
[env:WHY2025_badge_companion_radio_ble]
extends = WHY2025_badge
build_flags = ${WHY2025_badge.build_flags}
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
-D ENABLE_PRIVATE_KEY_IMPORT=1
-D ENABLE_PRIVATE_KEY_EXPORT=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${WHY2025_badge.build_src_filter}
+<helpers/esp32/*.cpp>
-<helpers/esp32/ESPNOWRadio.cpp>
+<../examples/companion_radio/*.cpp>
lib_deps =
${WHY2025_badge.lib_deps}
densaugeo/base64 @ ~1.4.0

View file

@ -65,7 +65,7 @@ lib_deps =
extends = Xiao_S3_WIO
build_flags =
${Xiao_S3_WIO.build_flags}
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@ -80,7 +80,7 @@ extends = Xiao_S3_WIO
build_flags =
${Xiao_S3_WIO.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=100
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D BLE_PIN_CODE=123456
-D DISPLAY_CLASS=SSD1306Display
@ -103,15 +103,21 @@ lib_deps =
extends = Xiao_S3_WIO
build_flags =
${Xiao_S3_WIO.build_flags}
-D MAX_CONTACTS=100
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D DISPLAY_CLASS=SSD1306Display
-D SERIAL_TX=D6
-D SERIAL_RX=D7
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Xiao_S3_WIO.lib_deps}
densaugeo/base64 @ ~1.4.0
adafruit/Adafruit SSD1306 @ ^2.5.13