Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
; PlatformIO compiles every .cpp under src/ automatically, so the split needs
; no manual file list. include/ is on the global header search path.
;
; This firmware targets Arduino-ESP32 3.x (ESP-IDF 5.x). The mic capture path
; uses the new channel-based I2S "standard" driver (driver/i2s_std.h); it will
; NOT build against the old Arduino-ESP32 2.x legacy I2S driver.
;
; ── Dependency reproducibility ───────────────────────────────────────────────
; EVERY dependency is pinned to an exact, immutable reference — an `@x.y.z`
; release where one works, or a full commit SHA where a release is unusable:
; * the platform is a release zip (content-addressed by its tag);
; * libraries use an exact `@x.y.z` pin — no caret ranges, no unversioned
; names, and no MOVING git branches. The only git dependency is the OPTIONAL
; OneWire on the C6 env (commented out by default since v0.24.0); when
; uncommented it MUST stay pinned to a full immutable commit SHA, NOT
; `#master`, because the last OneWire *release* (2.3.8) does not compile on
; the ESP32-C6's typed GPIO registers; see the note in [env:xiao_esp32c6];
; * transitive Adafruit deps (BusIO, Unified Sensor) are pinned explicitly so
; a fresh cache always resolves the same tree.
; After changing any pin, delete .pio/libdeps (or run `pio pkg update`) — a
; stale libdeps install can satisfy an old range forever. Both environments
; must build from a clean cache: `pio run -e esp32dev -e xiao_esp32c6`.
;
; Pinned to a known-good stable pioarduino release (55.03.39 = Arduino-ESP32
; 3.3.9 / ESP-IDF 5.5.4). Without a pin, `espressif32` resolves to a
; development snapshot (60.x+develop) whose WiFi headers are broken.
; The version string "55.03.39" contains leading zeros that PlatformIO's
; semver parser rejects, so we reference the release zip directly instead.
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
board = esp32dev
framework = arduino
monitor_speed = 115200
board_build.partitions = min_spiffs.csv
; Name the compiled artifacts after FIRMWARE_VERSION (src/globals.cpp),
; e.g. hivehub_esp32_0.9.2.bin instead of firmware.bin.
extra_scripts = pre:rename_firmware.py
build_flags =
-std=gnu++17
-Os
-DCORE_DEBUG_LEVEL=1
lib_deps =
; HX711 load-cell amp (classic 30-pin board only; force-disabled on the C6).
bogde/HX711@0.7.5
; NOTE: the NAU7802 no longer needs a library — HiveHub talks to it through its
; own checked driver (include/nau7802_checked.h) so communication errors are
; never mistaken for data. The former SparkFun Qwiic Scale dependency is gone.
; ── DS18B20 1-Wire in-hive temperature (OPTIONAL, disabled by default) ────────
; As of firmware v0.24.0 ENABLE_DS18B20_HIVE_TEMP defaults to 0 (config.h), so the
; OneWire + DallasTemperature stack is NOT compiled and these two libraries are
; commented out to keep the dependency tree minimal. To use a wired DS18B20 probe,
; set ENABLE_DS18B20_HIVE_TEMP 1 in secrets.h AND uncomment both lines below.
; paulstoffregen/OneWire@2.3.8
; milesburton/DallasTemperature@3.11.0
; ── Ambient temp/humidity[/pressure] sensor (pick exactly ONE — see config.h) ──
; SHT4x is the DEFAULT ambient sensor (ENABLE_SHT4X_AMBIENT=1); its library stays
; enabled. To use an SHT3x or a BME280 instead, flip the matching ENABLE_*_AMBIENT
; flag in secrets.h/config.h and uncomment its library here (BusIO + Unified
; Sensor, pinned below, satisfy the transitive deps of all three families).
adafruit/Adafruit SHT4x Library@1.0.4
; adafruit/Adafruit SHT31 Library@2.2.2 ; ENABLE_SHT3X_AMBIENT
; adafruit/Adafruit BME280 Library@2.2.4 ; ENABLE_BME280_AMBIENT (adds ambient pressure)
adafruit/Adafruit BusIO@1.16.1
adafruit/Adafruit Unified Sensor@1.1.14
adafruit/RTClib@2.1.4
bblanchon/ArduinoJson@7.2.0
; Required by the INMP441 mic FFT (ENABLE_INMP441_MICS). Header-only, so it
; costs nothing when the mic feature is disabled.
kosme/arduinoFFT@2.0.4
; BLE bridge (ENABLE_BLE_SCAN etc). NimBLE is far smaller than bluedroid.
; MUST be the 2.x series: NimBLE-Arduino 1.4.x targets Arduino-ESP32 2.x /
; ESP-IDF 4.4 and its controller init path is incompatible with the pinned
; Arduino-ESP32 3.3.x / ESP-IDF 5.5 toolchain above.
; History of the ESP32-C6 fixes inside the 2.3.x line (each a distinct failure):
; * 2.3.3 — fixes "multiple definition of ble_sm_alg_*" link errors against the
; framework's bundled libbt.a on esp32c6/h2/c2 with Arduino core 3.3+;
; * 2.3.8 — fixes a crash on init with Arduino core 3.3.7+ and a crash/leak on
; deinit with esp32c6;
; * 2.3.9 — fixes a crash when scanning on esp32c6 (the firmware scans every cycle).
; Bumped 2.3.9 -> 2.5.0: the 2.3.x line still mishandled the connection-based GATT
; CLIENT on the C6, so HiveHeart/HiveScale reads (connect + subscribe + wait for a
; notification) came back with no data every cycle, while passive beacon scans kept
; working. 2.5.0 fixes the GATT path (confirmed on hardware). The API deprecations
; 2.4.0 introduced do not touch the calls this firmware makes (createClient /
; connect / getService / getCharacteristic / subscribe / readValue, and the
; NimBLEScanCallbacks::onResult scan path).
h2zero/NimBLE-Arduino@2.5.0
; Optional features — used only when the matching flag is set in secrets.h:
adafruit/Adafruit INA219@1.2.3 ; ENABLE_INA219_SOLAR
sparkfun/SparkFun MAX1704x Fuel Gauge Arduino Library@1.0.4 ; ENABLE_MAX17048_BATTERY
; ── XIAO ESP32-C6 variant ────────────────────────────────────────────────────
; Compact RISC-V module using only the 11 front-header pins (D0–D10). It has no
; HX711 (scales are I2C NAU7802 on D4/D5, so the HX711 driver is force-compiled
; out in config.h) and no INMP441 mic. A single DS18B20 1-Wire bus IS supported
; on D1 (the V0.4 breakout wires it there); pair BLE sensors for acoustics.
; The deep-sleep button-wake API differs from the classic ESP32 — see
; storage_power.cpp for the CONFIG_IDF_TARGET_ESP32C6 guard blocks.
[env:xiao_esp32c6]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
board = seeed_xiao_esp32c6
framework = arduino
monitor_speed = 115200
board_build.partitions = min_spiffs.csv
extra_scripts = pre:rename_firmware.py
build_flags =
-std=gnu++17
-Os
-DCORE_DEBUG_LEVEL=1
; Explicit board identity flag used by config.h to force-off wired sensors and
; select the C6 pin map. CONFIG_IDF_TARGET_ESP32C6 is only reachable via
; sdkconfig.h (pulled in by Arduino.h), but config.h is included before
; Arduino.h, so the toolchain macro is not yet defined at that point.
; HIVEHUB_BOARD_XIAO_C6 is a plain -D flag, available from the very first
; preprocessor line, guaranteeing the guards fire regardless of include order.
-DHIVEHUB_BOARD_XIAO_C6=1
; HX711 and the INMP441 mic are force-disabled for this target in config.h, so
; the HX711 library is intentionally omitted from lib_deps below.
lib_deps =
; The NAU7802 (the only scale backend on the C6) is driven by HiveHub's own
; checked driver (include/nau7802_checked.h) — no scale library needed.
; ── DS18B20 1-Wire in-hive temperature (OPTIONAL, disabled by default) ────────
; As of firmware v0.24.0 ENABLE_DS18B20_HIVE_TEMP defaults to 0 on the C6 too
; (it previously defaulted ON), so the OneWire + DallasTemperature stack is NOT
; compiled and both libraries are commented out here. To use a wired DS18B20 on
; D1, set ENABLE_DS18B20_HIVE_TEMP 1 in secrets.h AND uncomment both lines below.
; NOTE for the C6: OneWire must be the EXACT, IMMUTABLE COMMIT below, NOT the
; 2.3.8 release. The ESP32-C6's GPIO registers are strongly-typed structs in
; ESP-IDF 5.x, and only OneWire's post-2.3.8 master has the
; CONFIG_IDF_TARGET_ESP32C6 guards (GPIO.in.val / GPIO.out_w1tc.val …) needed to
; compile there — the 2.3.8 release writes a raw uint32_t to those registers and
; fails to build. A commit SHA is immutable (unlike a `#master` branch), so the
; build stays reproducible. Re-verify the SHA still carries the C6 fix if bumped.
; https://github.com/PaulStoffregen/OneWire.git#800f26f3ee6eb446a72e013785cac3700e54cc13
; milesburton/DallasTemperature@3.11.0
; ── Ambient temp/humidity[/pressure] sensor (pick exactly ONE — see config.h) ──
; SHT4x is the DEFAULT ambient sensor (ENABLE_SHT4X_AMBIENT=1); its library stays
; enabled. To use an SHT3x or a BME280 instead, flip the matching ENABLE_*_AMBIENT
; flag in secrets.h/config.h and uncomment its library here (BusIO + Unified
; Sensor, pinned below, satisfy the transitive deps of all three families).
adafruit/Adafruit SHT4x Library@1.0.4
; adafruit/Adafruit SHT31 Library@2.2.2 ; ENABLE_SHT3X_AMBIENT
; adafruit/Adafruit BME280 Library@2.2.4 ; ENABLE_BME280_AMBIENT (adds ambient pressure)
adafruit/Adafruit BusIO@1.16.1
adafruit/Adafruit Unified Sensor@1.1.14
adafruit/RTClib@2.1.4
bblanchon/ArduinoJson@7.2.0
; NimBLE-Arduino 2.5.0 (see the detailed note in [env:esp32dev]). This C6 target
; trips every earlier failure — the libbt.a "multiple definition of ble_sm_alg_*"
; LINK error (fixed 2.3.3), the init crash on Arduino core 3.3.7+ (fixed 2.3.8) and
; the scan crash on esp32c6 (fixed 2.3.9) — AND the 2.3.x connection-based GATT
; client bug that made HiveHeart/HiveScale reads come back empty; 2.5.0 is the first
; release that fixes the GATT path too.
h2zero/NimBLE-Arduino@2.5.0
; adafruit/Adafruit INA219@1.2.3
sparkfun/SparkFun MAX1704x Fuel Gauge Arduino Library@1.0.4
7452d848cThis file is pinned to the selected release. Download the original to open it in your design tool.