Skip to content

Build Configuration ​

The source build entry point is platformio.ini. Release environments share [esp32_base] and [unified_flags], then override partitions, PSRAM, OTA and runtime parameters by chip.

Environment Matrix ​

EnvironmentChipFlashPSRAMPartitionOTA
esp32-F4R0ESP324MBNonepartitions/4MB.csvNo
esp32-F8R0ESP328MBNonepartitions/8MB.csvYes
esp32-F8R8ESP328MB8MBpartitions/8MB.csvYes
esp32c3-F4R0ESP32-C34MBNonepartitions/4MB.csvNo
esp32c6-F4R0ESP32-C64MBNonepartitions/4MB.csvNo
esp32c6-F8R0ESP32-C68MBNonepartitions/8MB.csvYes
esp32s3-F8R0ESP32-S38MBNonepartitions/8MB.csvYes
esp32s3-F8R8ESP32-S38MB8MBpartitions/8MB.csvYes
esp32s3-F16R8ESP32-S316MB8MBpartitions/16MB.csvYes
nativeHost----

All nine ESP32 environments are in the release matrix. R0 means no PSRAM and R8 means 8MB PSRAM; standard names no longer use F8R4.

Configuration Layers ​

text
[esp32_base]       platform, Arduino, LittleFS, common libraries and base flags
      |
[unified_flags]    shared feature compile flags
      |
[chip runtime]     TCP limits, queues and task stacks
      |
[env:<name>]       board, partition, PSRAM, OTA and library overrides

The project uses partitions/4MB.csv, partitions/8MB.csv and partitions/16MB.csv. The spiffs label inside a CSV is the Arduino-ESP32 compatibility name for the LittleFS data partition.

Unified Feature Flags ​

Compiling a feature through unified_flags does not automatically activate it. RuntimeFeatureManager reads /config/features.json, applies dependencies and user switches, then FeatureBudget checks internal DRAM before initialization.

CategoryRepresentative FlagsRuntime Default
Core WebWEB_SERVER, WEB_STATIC, WEB_API, AUTH, SESSIONActive
Core deviceMQTT, GPIO, PERIPH_EXEC, HEALTH_MONITOR, LOGGERCompiled; used as configured
PeripheralsSENSOR_DRIVER, DS18B20, LCD, NEOPIXEL, I2C_SENSORS, RFIDDisabled until needed
AutomationRULE_SCRIPT, COMMAND_SCRIPTDisabled; command scripts depend on RuleScript
OperationsLOG_VIEWER, FILE_LOGGING, CONFIG_TRANSFER, USER_ADMINDisabled or determined by build flags
Network extensionsETHERNET, CELLULAR, BLEDisabled; external hardware required

Environment Overrides ​

OverrideEnvironmentReason
FASTBEE_ENABLE_OTA=0, OTA_FS=04MB environmentsSingle application partition, no ota_1
FASTBEE_ENABLE_ETHERNET=0, CELLULAR=0ESP32-F4R0 and C3/C6 release environmentsResource policy and expected hardware
FASTBEE_ENABLE_IR_REMOTE=0, RF_LEARN=0esp32s3-F8R8RMT/library conflict in that build
FASTBEE_ENABLE_IR_REMOTE=1, RF_LEARN=1esp32-F8R8, esp32s3-F16R8Dependencies and hardware resources are available

A flag change may also require a library, Web form, API handler, memory budget and partition update. Do not implement capability differences only by hiding a menu.

Runtime Resource Parameters ​

FlagESP32C3C6S3
CONFIG_ASYNC_TCP_MAX_CONNECTIONS6468
CONFIG_ASYNC_TCP_QUEUE_SIZE324824
ARDUINO_LOOP_STACK_SIZE16384122881228816384
SCRIPT_TASK_STACK8192614461448192
SIMPLE_TASK_STACK6144409640966144

Higher connection and queue limits improve concurrency but consume more internal DRAM. When requests return 503 or a feature is budget-rejected, first reduce browser concurrency and disable unused heavy features.

OTA Policy ​

  • 4MB: OTA is not compiled and the route is not registered. Upgrade with a complete merged image over serial or the online flasher.
  • 8MB/16MB: app0/app1 A/B slots are present. The image must fit the application slot and pass the runtime memory guard.
  • Release scripts archive application firmware, LittleFS and merged images from the same build.

Common Commands ​

powershell
# Build, generate Web assets, upload LittleFS and flash firmware
powershell -ExecutionPolicy Bypass -File scripts\deploy.ps1 -Env esp32s3-F8R8 -Port COM6

# Build one environment
pio run -e esp32s3-F8R8

# Host-side unit tests
pio test -e native

# Validate environments, partitions and OTA rules
node scripts/validate-build-matrix.js

Do not use stale files in data/www as a release source. Use deploy.ps1 or gzip-www.js so the staged filesystem matches the current Web source.

Custom Environment Checklist ​

  1. Record the exact chip, Flash, PSRAM and external modules.
  2. Select the matching partitions/*.csv; OTA requires an app1 slot.
  3. Set PSRAM, OTA and network-adapter flags to match the hardware.
  4. Run validate-build-matrix.js, then verify firmware, LittleFS, login and /api/health on the device.
  5. Record the environment name and image SHA-256 so a development image is not mistaken for a release artifact.

FastBee | fastbee.cn