Add MeshCore relay_radio firmware for Heltec T114
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Has been cancelled
Run Unit Tests / test (push) Has been cancelled
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (Heltec_v3_repeater) (push) Has been cancelled
PR Build Check / build (Heltec_v3_room_server) (push) Has been cancelled
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Has been cancelled
PR Build Check / build (PicoW_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (RAK_4631_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_room_server) (push) Has been cancelled
PR Build Check / build (Tbeam_SX1276_repeater) (push) Has been cancelled
PR Build Check / build (wio-e5-mini_repeater) (push) Has been cancelled
PR Build Check / build (wio_wm1110_repeater) (push) Has been cancelled

This commit is contained in:
2026-06-09 15:36:22 +03:00
commit cdd9d32fb5
787 changed files with 108699 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#include <Arduino.h>
#include <Wire.h>
#include "KeepteenLT1Board.h"
void KeepteenLT1Board::begin() {
NRF52Board::begin();
btn_prev_state = HIGH;
pinMode(PIN_VBAT_READ, INPUT);
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL);
#endif
Wire.begin();
}

View File

@@ -0,0 +1,44 @@
#pragma once
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
class KeepteenLT1Board : public NRF52Board {
protected:
uint8_t btn_prev_state;
public:
KeepteenLT1Board() : NRF52Board("KeepteenLT1_OTA") {}
void begin();
#define BATTERY_SAMPLES 8
uint16_t getBattMilliVolts() override {
analogReadResolution(12);
uint32_t raw = 0;
for (int i = 0; i < BATTERY_SAMPLES; i++) {
raw += analogRead(PIN_VBAT_READ);
}
raw = raw / BATTERY_SAMPLES;
return (ADC_MULTIPLIER * raw);
}
const char* getManufacturerName() const override {
return "Keepteen LT1";
}
#if defined(P_LORA_TX_LED)
void onBeforeTransmit() override {
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
}
void onAfterTransmit() override {
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
}
#endif
void powerOff() override {
sd_power_system_off();
}
};

View File

@@ -0,0 +1,107 @@
[KeepteenLT1]
extends = nrf52_base
board = keepteen_lt1
build_flags = ${nrf52_base.build_flags}
-I variants/keepteen_lt1
-D KEEPTEEN_LT1
-D USE_SX1262
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D PIN_BOARD_SDA=34
-D PIN_BOARD_SCL=36
-D ENV_INCLUDE_GPS=1
build_src_filter = ${nrf52_base.build_src_filter}
+<helpers/sensors>
+<../variants/keepteen_lt1>
lib_deps= ${nrf52_base.lib_deps}
adafruit/Adafruit SSD1306 @ ^2.5.13
stevemarple/MicroNMEA @ ^2.0.6
[env:KeepteenLT1_repeater]
extends = KeepteenLT1
build_src_filter = ${KeepteenLT1.build_src_filter}
+<../examples/simple_repeater>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
build_flags =
${KeepteenLT1.build_flags}
-D ADVERT_NAME='"KeepteenLT1 Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D DISPLAY_CLASS=SSD1306Display
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps = ${KeepteenLT1.lib_deps}
adafruit/RTClib @ ^2.1.3
[env:KeepteenLT1_room_server]
extends = KeepteenLT1
build_src_filter = ${KeepteenLT1.build_src_filter}
+<../examples/simple_room_server>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
build_flags = ${KeepteenLT1.build_flags}
-D ADVERT_NAME='"KeepteenLT1 Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
-D DISPLAY_CLASS=SSD1306Display
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps = ${KeepteenLT1.lib_deps}
adafruit/RTClib @ ^2.1.3
[env:KeepteenLT1_companion_radio_usb]
extends = KeepteenLT1
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags = ${KeepteenLT1.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=SSD1306Display
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
build_src_filter = ${KeepteenLT1.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${KeepteenLT1.lib_deps}
adafruit/RTClib @ ^2.1.3
densaugeo/base64 @ ~1.4.0
[env:KeepteenLT1_companion_radio_ble]
extends = KeepteenLT1
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags = ${KeepteenLT1.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D BLE_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
-D DISPLAY_CLASS=SSD1306Display
; -D MESH_PACKET_LOGGING=1
-D MESH_DEBUG=1
build_src_filter = ${KeepteenLT1.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${KeepteenLT1.lib_deps}
adafruit/RTClib @ ^2.1.3
densaugeo/base64 @ ~1.4.0
[env:KeepteenLT1_kiss_modem]
extends = KeepteenLT1
build_src_filter = ${KeepteenLT1.build_src_filter}
+<../examples/kiss_modem/>

View File

@@ -0,0 +1,37 @@
#include <Arduino.h>
#include "target.h"
#include <helpers/ArduinoHelpers.h>
KeepteenLT1Board board;
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
WRAPPER_CLASS radio_driver(radio, board);
VolatileRTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
#if ENV_INCLUDE_GPS
#include <helpers/sensors/MicroNMEALocationProvider.h>
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock);
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
#else
EnvironmentSensorManager sensors;
#endif
#ifdef DISPLAY_CLASS
DISPLAY_CLASS display;
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
#endif
bool radio_init() {
rtc_clock.begin(Wire);
return radio.std_init(&SPI);
}
mesh::LocalIdentity radio_new_identity() {
RadioNoiseListener rng(radio);
return mesh::LocalIdentity(&rng); // create new random identity
}

View File

@@ -0,0 +1,28 @@
#pragma once
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <KeepteenLT1Board.h>
#include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/SSD1306Display.h>
#include <helpers/ui/MomentaryButton.h>
#endif
#include <helpers/sensors/EnvironmentSensorManager.h>
extern KeepteenLT1Board board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern EnvironmentSensorManager sensors;
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
extern MomentaryButton user_btn;
#endif
bool radio_init();
mesh::LocalIdentity radio_new_identity();

View File

@@ -0,0 +1,22 @@
#include "variant.h"
#include "wiring_constants.h"
#include "wiring_digital.h"
const uint32_t g_ADigitalPinMap[] = {
0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47
};
void initVariant()
{
// set LED pin as output and set it low for off
pinMode(PIN_LED, OUTPUT);
digitalWrite(PIN_LED, LOW);
// set INPUT_PULLUP for user button
pinMode(PIN_USER_BTN, INPUT_PULLUP);
}

View File

@@ -0,0 +1,74 @@
#ifndef _KEEPTEEN_LT1_H_
#define _KEEPTEEN_LT1_H_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFRC
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#define PINS_COUNT (48)
#define NUM_DIGITAL_PINS (48)
#define NUM_ANALOG_INPUTS (1)
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
#define PIN_LED (15) // Blue LED
#define PIN_LED2 (13) // Maybe red power LED?
#define LED_BLUE (-1) // Disable annoying flashing caused by Bluefruit
#define LED_BUILTIN PIN_LED
#define P_LORA_TX_LED PIN_LED
#define LED_STATE_ON 1
// Buttons
#define PIN_BUTTON1 (32) // Menu / User Button
#define PIN_USER_BTN PIN_BUTTON1
// Analog pins
#define PIN_VBAT_READ (31)
#define AREF_VOLTAGE (3.6F)
#define ADC_MULTIPLIER (1.535F)
#define ADC_RESOLUTION (12)
// Serial interfaces
#define PIN_SERIAL1_RX (22)
#define PIN_SERIAL1_TX (20)
// SPI Interfaces
#define SPI_INTERFACES_COUNT (1)
#define PIN_SPI_MISO (2)
#define PIN_SPI_MOSI (38)
#define PIN_SPI_SCK (43)
// Lora Pins
#define P_LORA_BUSY (29)
#define P_LORA_MISO PIN_SPI_MISO
#define P_LORA_MOSI PIN_SPI_MOSI
#define P_LORA_NSS (45)
#define P_LORA_SCLK PIN_SPI_SCK
#define P_LORA_DIO_1 (10)
#define P_LORA_RESET (9)
#define SX126X_RXEN RADIOLIB_NC
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_DIO2_AS_RF_SWITCH true
#define SX126X_DIO3_TCXO_VOLTAGE (1.8f)
// Wire Interfaces
#define WIRE_INTERFACES_COUNT (1)
#define PIN_WIRE_SDA (34)
#define PIN_WIRE_SCL (36)
#define I2C_NO_RESCAN
// GPS L76KB
#define GPS_BAUDRATE 9600
#define PIN_GPS_TX PIN_SERIAL1_RX
#define PIN_GPS_RX PIN_SERIAL1_TX
#define PIN_GPS_EN (24)
#endif // _KEEPTEEN_LT1_H_