Initial commit: Simple Sensor firmware for Heltec T114 with BME280
Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (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 (wio-e5-mini_repeater) (push) Has been cancelled

- MeshCore-based Simple Sensor firmware
- Heltec T114 without display
- BME280 sensor support (temp/humidity/pressure)
- Radio: 868.856018 MHz, SF7, BW62.5 kHz, CR4/7
- 2-byte path hash
- PlatformIO project
This commit is contained in:
UA1ZBE
2026-06-01 16:19:09 +03:00
commit 42f55e12ae
725 changed files with 98374 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
[lora_e5]
extends = stm32_base
board = lora_e5_dev_board
board_upload.maximum_size = 229376 ; 32kb for FS
build_flags = ${stm32_base.build_flags}
-D RADIO_CLASS=CustomSTM32WLx
-D WRAPPER_CLASS=CustomSTM32WLxWrapper
-D SPI_INTERFACES_COUNT=0
-D RX_BOOSTED_GAIN=true
-D PIN_SERIAL_RX=PB7
-D PIN_SERIAL_TX=PB6
-I variants/wio-e5-dev
build_src_filter = ${stm32_base.build_src_filter}
+<../variants/wio-e5-dev>
[env:wio-e5_repeater]
extends = lora_e5
build_flags = ${lora_e5.build_flags}
-D LORA_TX_POWER=22
-D ADVERT_NAME='"WIO-E5 Repeater"'
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
build_src_filter = ${lora_e5.build_src_filter}
+<../examples/simple_repeater/*.cpp>
[env:wio-e5-repeater_bridge_rs232]
extends = lora_e5
build_flags = ${lora_e5.build_flags}
-D LORA_TX_POWER=22
-D ADVERT_NAME='"WIO-E5 Repeater"'
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D ENABLE_HWSERIAL2
-D WITH_RS232_BRIDGE=Serial2
-D WITH_RS232_BRIDGE_RX=PA3
-D WITH_RS232_BRIDGE_TX=PA2
build_src_filter = ${lora_e5.build_src_filter}
+<helpers/bridges/RS232Bridge.cpp>
+<../examples/simple_repeater/*.cpp>
[env:wio-e5_companion_radio_usb]
extends = lora_e5
build_flags = ${lora_e5.build_flags}
-D LORA_TX_POWER=22
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=8
build_src_filter = ${lora_e5.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps = ${lora_e5.lib_deps}
densaugeo/base64 @ ~1.4.0

View File

@@ -0,0 +1,73 @@
#include <Arduino.h>
#include "target.h"
#include <helpers/ArduinoHelpers.h>
WIOE5Board board;
RADIO_CLASS radio = new STM32WLx_Module();
WRAPPER_CLASS radio_driver(radio, board);
static const uint32_t rfswitch_pins[] = {PA4, PA5, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
static const Module::RfSwitchMode_t rfswitch_table[] = {
{STM32WLx::MODE_IDLE, {LOW, LOW}},
{STM32WLx::MODE_RX, {HIGH, LOW}},
{STM32WLx::MODE_TX_HP, {LOW, HIGH}}, // for LoRa-E5 mini
// {STM32WLx::MODE_TX_LP, {HIGH, HIGH}}, // for LoRa-E5-LE mini
END_OF_MODE_TABLE,
};
VolatileRTCClock rtc_clock;
SensorManager sensors;
#ifndef LORA_CR
#define LORA_CR 5
#endif
bool radio_init() {
// rtc_clock.begin(Wire);
// #ifdef SX126X_DIO3_TCXO_VOLTAGE
// float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
// #else
// float tcxo = 1.6f;
// #endif
radio.setRfSwitchTable(rfswitch_pins, rfswitch_table);
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, 1.7, 0);
if (status != RADIOLIB_ERR_NONE) {
Serial.print("ERROR: radio init failed: ");
Serial.println(status);
return false; // fail
}
#ifdef RX_BOOSTED_GAIN
radio.setRxBoostedGainMode(RX_BOOSTED_GAIN);
#endif
radio.setCRC(1);
return true; // success
}
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(int8_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,33 @@
#pragma once
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <helpers/stm32/STM32Board.h>
#include <helpers/radiolib/CustomSTM32WLxWrapper.h>
#include <helpers/ArduinoHelpers.h>
#include <helpers/SensorManager.h>
class WIOE5Board : public STM32Board {
public:
const char* getManufacturerName() const override {
return "Seeed Wio E5 Dev Board";
}
// Just returns ADC value for now to test adc
uint16_t getBattMilliVolts() override {
uint32_t raw = analogRead(PIN_A3);
return raw;
}
};
extern WIOE5Board board;
extern WRAPPER_CLASS radio_driver;
extern VolatileRTCClock rtc_clock;
extern SensorManager sensors;
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(int8_t dbm);
mesh::LocalIdentity radio_new_identity();

View File

@@ -0,0 +1,5 @@
#pragma once
#include <variant_generic.h>
#undef RNG