Commit Graph

1045 Commits

Author SHA1 Message Date
Nick Dunklee 59cee5c8a0 feat: Integrate BME680 Bosch BSEC support for RAK4631
This is a consolidation of my changes for BME680 on RAK4631 nodes.
I will close my other PRs related to this and link back to this one.

*Background on change:*

This change replaces the Adafruit BME680 driver on RAK4631 with the
Bosch BSEC library. Other boards continue to use the existing
Adafruit path via ENV_INCLUDE_BME680.

This makes the IAQ portion of the sensor functional, and more accurate.
It also contains the math and/or CayenneLPP fixes from my other PRs.
The Bosch code also appears to handle calibrating sensor aging as well,
whereas the Adafruit code is just looking at blind values that can drift
with time. Pretty cool to see this shooting out useful data!

RAK4631 platform.io is set to override to ENV_INCLUDE_BME680_BSEC while
leaving the Adafruit code for other node types. (If this becomes applicable
for other node types in future, awesome! I just don't have hardware
to test against.)

Using the BSEC library introduces IAQ sensor calibration, and saves
the calibration state periodically so it does not have to calibrate
again later.

At startup the IAQ sensor takes 30 minutes to heat and to hit a baseline,
then starts calibrating. Once calibrated, it will save those settings
and will only write settings again if calibration falls back and restores
back to state 3.

This fix also has the gas resistance math fix that was in
[pull 2146](https://github.com/meshcore-dev/MeshCore/pull/2146) so
the adafruit path also can at least show accurate values instead
of looping negative.

Also includes the fix from [pull 2149](https://github.com/meshcore-dev/MeshCore/pull/2149) so the pressure output isn't truncated to 1hPa steps.

*Fixes/Changes:*
- Add bsec_config_iaq[] with the 3.3V/3s-LP/28d calibration profile
- BSEC init applies setConfig() for voltage-correct heater targeting
- IAQ, heat-compensated temperature/humidity, pressure, and altitude
  reported over CayenneLPP
- IAQ accuracy reported as analog input over CayenneLPP (0,1,2,3)
- Calibration state persisted to /bsec_state.bin on nRF52 internal
  flash; written only when iaqAccuracy improves to >= 2, should
  keep write frequency well within flash endurance over device lifetime
- Fix non-BSEC query_bme680: float pressure division, addGenericSensor
  for gas resistance (was addAnalogInput, overflows at > 327 Ohm)
- loop() correctly gated for both GPS and BSEC-only builds
- Add fix_bsec_lib.py extra_script to resolve nRF52840 hard-float ABI
  mismatch in Bosch's PlatformIO packaging, silly Bosch

One general note outside of this code change: I noticed while BME680
_functions_ in companion nodes, since companion nodes run Bluetooth,
BLE preempts the CPU, and can do so mid-I2C-transaction.

This can cause the BME680 to see an anomaly and drop calibration and
start a recalibrate. This is behavior that will exist (and has existed)
regardless of using the Adafruit or Bosch paths.

This particular companion behavior does not seem to occur in sensor
or repeater nodes since their BLE is off. Probably affects other
I2C devices as well.

*Tests:*

- RAK19003
- RAK19007
- RAK19001
- repeater, sensor, companion
2026-05-27 15:33:48 -06:00
taco efaf95d685 fix debug params for t-echo card 2026-05-21 19:58:10 +10:00
taco 7c8d84ffb5 remove deprecated functions, fix typo and style 2026-05-21 19:58:10 +10:00
taco 9f683975c1 add torch 2026-05-21 19:58:10 +10:00
taco 8540c98947 add tinyui for lilygo t-echo card 2026-05-21 19:58:10 +10:00
taco 1e740d30f2 initial t-echo card support 2026-05-21 19:58:10 +10:00
csrutil 0cf4d422a8 Add Heltec T096 sensor environment 2026-05-17 16:17:05 +08:00
Willem Oldemans e1616ff29d Remove static BLE_PIN_CODE definition from Heltec E290_usb configuration 2026-05-15 13:09:59 +02:00
Willem Oldemans 973321d9b1 Disable BLE_PIN_CODE for E290 companion USB environment
Remove the hardcoded BLE_PIN_CODE build flag from the Heltec_E290_companion_ble
environment. The presence of BLE_PIN_CODE prevents the unit from operating as a
USB companion. Commenting it out allows dynamic PIN generation and enables USB
companion functionality.
2026-05-15 12:57:36 +02:00
ripplebiz 0db7715430 Merge pull request #2497 from oltaco/reduce-esp32-dram
Reduce dram0_0 usage on older ESP32 boards
2026-05-15 14:04:42 +10:00
ripplebiz f4be34a997 Merge pull request #2515 from Cisien/station-g3-esp32
Add support for Station G3 and its software configurable LNA/PA1
2026-05-15 13:58:42 +10:00
Rastislav Vysoky 68363d9e4d revert: "feat: Enable GPS on RAK 1W kit" (#2401)
reverted changes to RAK_BOARD and PIN_GPS_EN. setting `RAK_BOARD` would cause radio to stop working and end with RadioLib error -707
2026-05-12 15:56:28 +02:00
liamcottle b0b87fd709 fix gps pins for lilygo t impulse plus 2026-05-12 10:36:19 +12:00
Liam Cottle c4523f71a9 Merge pull request #2522 from liamcottle/board/lilygo-t-impulse-plus
Add support for LilyGo T-Impulse-Plus
2026-05-12 01:39:44 +12:00
liamcottle 2fdbfbdbf6 turn off 3.3v rail when powering off 2026-05-12 01:06:22 +12:00
liamcottle a49ee6ebe9 fix battery voltage reading 2026-05-11 22:17:53 +12:00
liamcottle 242c45f4a3 initial support for lilygo t impulse plus 2026-05-11 22:05:06 +12:00
Quency-D 6d3b71eed9 add heltec-mesh-node-t1 2026-05-11 15:11:07 +08:00
Huw Duddy 3eacc49489 Merge pull request #2503 from jirogit/fix/techo-lite-non-shell-usb
feat(techo-lite): add USB companion radio target for non-shell variant
2026-05-10 22:40:12 +10:00
Chris 75fb07fc2c Add support for Station G3 and its software configurable LNA and PA1 2026-05-09 13:53:20 -07:00
entr0p1 77bd994a61 T-Echo Lite LoRa radio fixes
- Set TCXO voltage to 1.8 (not defined previously, falls back to default)
- Set correct variable name for SX1262 RX/TX pins
- Fix SX1262 RX pin number
2026-05-09 14:26:55 +10:00
jirogit 5a6fd4c16a feat(techo-lite): add USB companion radio target for non-shell variant 2026-05-08 00:38:04 -07:00
taco b612ba49f2 reduce dram0_0 usage by lowering OFFLINE_QUEUE_SIZE
some older ESP32 boards were pushing the limits of the dram segment causing the linker to fail, especially for ble and wifi firmwares.

lowering OFFLINE_QUEUE_SIZE reduces dram usage
2026-05-08 00:40:33 +10:00
Scott Powell 0a8a0a4904 * Refactor: removed duplicated radio_rng_seed(), radio_set_params(), radio_set_tx_power() 2026-05-01 14:47:07 +10:00
Rastislav Vysoky d7e3a9ddba Merge branch 'dev' into minewsemi-refactor 2026-04-30 14:48:49 +02:00
Liam Cottle ffbf73dc5c Merge pull request #2432 from recrof/kiss-radio-everywhere
kiss radio: added stm32 support + envs in platformio.ini
2026-05-01 00:36:46 +12:00
Liam Cottle 5c651b35a0 Merge pull request #1954 from OverkillFPV/lora-longer-preamble
Lora longer preamble
2026-04-30 22:12:04 +12:00
Liam Cottle daa50e9469 Merge pull request #2426 from recrof/nano-g2-rework
make g2 more in line with other variants
2026-04-30 16:57:58 +12:00
Liam Cottle 2522492cd7 Merge pull request #2436 from chrisdavis2110/rak3401-comp-ana-button
feat: Add support for PIN_USER_BTN_ANA on rak3401 companion usb and companion ble envs
2026-04-30 16:57:00 +12:00
Quency-D 696aae6ed1 Heltec boards have LNA disabled by default. 2026-04-29 16:20:21 +08:00
chrisdavis2110 5fbd473298 added PIN_GPS_EN=-1 to rak3401 companion usb 2026-04-28 21:59:10 -07:00
chrisdavis2110 0265851621 added PIN_USER_BTN_ANA for rak3401 companion usb and companion ble 2026-04-28 21:26:56 -07:00
Rastislav Vysoky 5beef490a0 add kiss radio env to most of the variants 2026-04-28 15:09:25 +02:00
Rastislav Vysoky 66009069cd standardize the minewsemi variant 2026-04-28 13:53:35 +02:00
Liam Cottle d8f3d59d82 Merge pull request #2427 from recrof/tabs-to-spaces
replace all intendation tabs to spaces in pio ini files
2026-04-28 22:39:31 +12:00
Rastislav Vysoky b963681830 replace all intendation tabs to spaces in pio ini files 2026-04-28 12:37:30 +02:00
Rastislav Vysoky 12d9cc3752 make g2 more in line with other variants 2026-04-28 12:24:45 +02:00
ripplebiz 0396cf6771 Merge pull request #2383 from IoTThinks/MCdev-Added-XiaoS3-202604
Added Xiao S3 variant
2026-04-28 14:23:42 +10:00
Liam Cottle 70212fb5cc Merge pull request #2401 from zevaryx/rak-3401-gps
feat: Enable GPS on RAK 1W kit
2026-04-28 13:57:55 +12:00
me b91f127e4e fix: correct device model name for Heltec Wireless Paper 2026-04-26 00:23:09 -07:00
Huw Duddy 40d7fcfc26 Merge pull request #2157 from aXistem-dev/fix/sensecap-solar-tx-led-12
fix(sensecap_solar): correct TX LED after remap & power-button pin changes
2026-04-25 18:03:53 +10:00
Confi 835b0e9114 fix(sensecap_solar): init LED_WHITE LOW to prevent always-on at boot 2026-04-25 09:47:44 +02:00
zevaryx 7f38e3f145 feat: Enable GPS on RAK 1W kit 2026-04-24 20:24:50 -06:00
Liam Cottle 9a1be5386d Merge pull request #2326 from IoTThinks/MCdev-Added-HeltecV4-Expansion-Kit-2026-04-16
Added support for Expansion Kit to Heltec V4 OLED repeaters
2026-04-25 00:14:12 +12:00
Kevin Le 277331381e Added Xiao S3 variant.
This is for Xiao S3 and a normal Wio SX1262 for Xiao shield.
2026-04-24 11:56:06 +07:00
Liam Cottle 5372388e6e Merge pull request #2353 from jirogit/fix/techo-lite-non-shell-ble-clean
feat(techo-lite): add Non-Shell companion BLE variant
2026-04-22 20:25:32 +12:00
Liam Cottle dc548578ff Merge pull request #2287 from pelgraine/fix/techo-lite-battery
Fixes #1183 — T-Echo Lite incorrect battery voltage
2026-04-22 20:23:21 +12:00
Liam Cottle d3b457681a Merge pull request #2008 from weebl2000/p_lora_reset_rak4631
Fix RAK4631 SX1262 hardware pin config
2026-04-22 19:45:06 +12:00
Wessel Nieboer 66fe9ac2db Fix FEM/LNA enbaled by default for Heltec T096, Heltec Wireless Tracker v2
Should only really be disabled when it causes issues.
2026-04-22 09:30:00 +02:00
pelgraine d516cd8a9e Fixes #1183 — T-Echo Lite incorrect battery voltage
Battery (TechoBoard.h/cpp): Added PIN_VBAT_MEAS_EN (P0.31) — the T-Echo
Lite has a gated voltage divider that must be enabled before reading. Also
added pinMode(PIN_VBAT_READ, INPUT) before each ADC read to reclaim P0.02
from other peripherals. Pin definitions hardcoded from LilyGo's
t_echo_lite_config.h.

I2C (variant.h): Corrected SDA/SCL from P0.04/P0.02 to P1.04/P1.02 per
LilyGo's IIC_1_SDA/IIC_1_SCL. The old P0.02 mapping conflicted with the
battery ADC pin.

GPS (variant.h): Corrected all five GPS pin assignments to match LilyGo's
config — UART TX/RX, wake, PPS, and power enable were all scrambled.

SPI (variant.h): Fixed SPI_INTERFACES_COUNT from _PINNUM(0, 2) to (2).

Tested on T-Echo Lite Non-Shell (USB-C, no display). Battery readings match
Heltec V4 reference within 10mV.
2026-04-22 12:56:15 +10:00