Commit Graph

2845 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
ripplebiz 23f48e025f Merge pull request #2517 from oltaco/techo-card
Add support for LilyGo T-Echo Card (and tiny-ui!)
2026-05-21 20:45:54 +10: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 26c641bc63 tiny ui rendering fixes 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 5058415fa3 u8g2 wrapper: allow larger font when size >= 2 2026-05-21 19:58:10 +10:00
pelgraine 2462cf6c97 add wrapper for u8g2 display driver 2026-05-21 19:58:10 +10:00
taco 1e740d30f2 initial t-echo card support 2026-05-21 19:58:10 +10:00
Huw Duddy bfdceae16e Merge pull request #2443 from kizniche/fix-rxdelay-txdelay
Fix: Enforce upper bounds for rxdelay, txdelay, and direct.txdelay
2026-05-21 16:57:41 +10:00
Liam Cottle 683299079f Merge pull request #2594 from meshcore-dev/extended-ack
support for sending 6-byte ACKs
2026-05-21 17:45:03 +12:00
Scott Powell a130a95a0d * added 6th byte to ACK, with RNG 2026-05-21 00:00:03 +10:00
Huw Duddy 0a13f6bcba Merge pull request #2576 from csrutil/fix/heltec-t096-sensor-env
Add Heltec T096 sensor environment
2026-05-20 22:21:58 +10:00
Liam Cottle f03662af11 Merge pull request #2592 from oltaco/nrf52-pio-target-fix
Fix upload and monitor targets for nrf52 envs
2026-05-20 22:26:58 +12:00
taco b92fcbed10 add openocd_target to lilygo t-impulse board.json 2026-05-20 20:02:18 +10:00
Scott Powell 717142abd6 * bug fix 2026-05-19 17:06:42 +10:00
Scott Powell 2eb747d504 * fix 2026-05-17 22:38:42 +10:00
Scott Powell f6e6fdaa05 * support for sending 5-byte ACKs 2026-05-17 22:10:13 +10:00
csrutil 0cf4d422a8 Add Heltec T096 sensor environment 2026-05-17 16:17:05 +08:00
Liam Cottle 39b333656b Merge pull request #2574 from ViezeVingertjes/docs/kiss-txbusy-error
Document HW_ERR_TX_BUSY in KISS modem protocol
2026-05-17 12:37:15 +12:00
ViezeVingertjes 79caba5bab Document HW_ERR_TX_BUSY in KISS modem protocol 2026-05-16 11:32:33 +02:00
Liam Cottle cf9bf1d7fe Merge pull request #2565 from willumpie82/ble-pin-code
Disable BLE_PIN_CODE for E290 companion USB environment
2026-05-15 23:17:43 +12: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
Liam Cottle 6325a85336 Merge pull request #2493 from Rococo88/complex-wifi-reconnect
Refactor WiFi auto-reconnect to use non-blocking polling
2026-05-15 21:21:16 +12: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
Liam Cottle 555745700e Merge pull request #2543 from meshcore-dev/cmd-send-raw
new CMD_SEND_RAW_PACKET
2026-05-13 22:10:52 +12:00
Scott Powell c588540b1b * new CMD_SEND_RAW_PACKET 2026-05-13 13:28:56 +10:00
Huw Duddy 12a37a224a Merge pull request #2536 from recrof/patch-3
revert: "feat: Enable GPS on RAK 1W kit" (#2401)
2026-05-13 00:41:41 +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
Liam Cottle 96bbed225a Merge pull request #2520 from Quency-D/heltec-mesh-node-t1
add heltec-mesh-node-t1
2026-05-12 00:38:14 +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
Liam Cottle 3cdcb3ef84 Merge pull request #2519 from oltaco/customlfs-0.2.2
pin CustomLFS to version 0.2.2
2026-05-11 21:33:05 +12:00
Quency-D 6d3b71eed9 add heltec-mesh-node-t1 2026-05-11 15:11:07 +08:00
taco 716ba8ee5e pin CustomLFS to version 0.2.2
CustomLFS 0.2.2 adds support for the flash chip in LilyGo T-Echo Card and T-Echo Lite
2026-05-11 11:37:56 +10: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
Liam Cottle e7ea2fc563 Merge pull request #2516 from oltaco/disable-ds3231-probe
Add option to disable DS3231 RTC probe
2026-05-10 22:48:47 +12:00
taco e7e97ec438 add option to disable DS3231 probe 2026-05-10 20:29:47 +10:00
Huw Duddy a3e1930176 Merge pull request #2511 from entr0p1/techo-lite-rf-fix
Corrected T-Echo Lite SX1262 RXEN and TXEN pins, TCXO voltage.
2026-05-10 19:55:20 +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
Liam Cottle 56d4671c2c Merge pull request #2490 from tuzzmaniandevil/dev
Enhance KissModem frame processing and timeout handling
2026-05-08 23:23:14 +12:00
Huw Duddy 6e2e9cc33c Merge pull request #2505 from liamcottle/feature/companion-repeat-build-flag
Add build flag to configure allowed repeat frequency range
2026-05-08 18:29:49 +10:00
liamcottle 841db56595 add build flag to configure allowed repeat freq range 2026-05-08 20:16:45 +12:00