Files
OpenMQTT-Gateway/platformio.ini
T
FlorianandClaude Opus 5 d8ffa3f1dd [SYS] Migrate M5 boards to M5Unified + M5GFX (modern platform) (#2355)
The per-board libs (M5Stack/M5StickC/M5StickC-Plus/M5Tough) don't build on
Arduino core 3.x, which kept the five M5 BLE envs pinned to espressif32@6.1.0.
Port board support to M5Unified + M5GFX so they run ${com.esp32_platform} like
the rest of the tree.

- environments.ini: 5 M5 envs -> modern platform + m5unified. m5stick-c uses the
  pico32 variant (m5stick_c variant absent upstream) and no_coredump partitions
  (M5Unified overflows min_spiffs).
- boardM5.cpp / config_M5.h: single <M5Unified.h>; M5.Lcd aliases M5.Display;
  unified brightness/sleep/wake.
- main.cpp / mqttDiscovery.cpp: battery telemetry via M5.Power; AXP192-only
  Vin/VBus/temp fields dropped (no portable equivalent).

All five M5 envs build; M5Stack Core hardware-verified.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 16:45:35 -05:00

231 lines
9.4 KiB
INI

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
src_dir = main
include_dir = main
extra_configs =
environments.ini
tests/*_env.ini
*_env.ini
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENVIRONMENT CHOICE ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Uncomment the env line corresponding to your board and modules required, ;
;you can also adapt the modules by removing the corresponding lines in the env detail ;
; if you go to the build flag section of your env you will see that some User_config.h ;
; parameters can be overwritten here, for example the gateway name. ;
; If you want to avoid the lost of your environments at each update you can put them ;
; into a separate file called prod_env.ini, it will be automatically read by pio ;
; an example (prod_env.ini.example) is available into the same folder as this file. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;default_envs = rfbridge
;default_envs = rfbridge-direct
;default_envs = esp32dev-all-test
;default_envs = esp32dev-rf
;default_envs = esp32dev-pilight
;default_envs = esp32dev-pilight-cc1101
;default_envs = esp32dev-somfy-cc1101
;default_envs = esp32dev-pilight-somfy-cc1101
;default_envs = esp32dev-weatherstation
;default_envs = esp32dev-gf-sun-inverter
;default_envs = esp32dev-ir
;default_envs = esp32dev-ble
;default_envs = esp32dev-ble-mqtt-undecoded
;default_envs = esp32dev-ble-aws
;default_envs = esp32feather-ble
;default_envs = esp32-lolin32lite-ble
;default_envs = esp32-olimex-gtw-ble-eth
;default_envs = esp32-olimex-gtw-ble-poe
;default_envs = esp32-olimex-gtw-ble-poe-iso
;default_envs = esp32-wt32-eth01-ble-eth
;default_envs = esp32-olimex-gtw-ble-wifi
;default_envs = esp32-m5stick-ble
;default_envs = esp32-m5stack-ble
;default_envs = esp32-m5tough-ble
;default_envs = esp32-m5stick-c-ble
;default_envs = esp32-m5stick-cp-ble
;default_envs = esp32-m5atom-matrix
;default_envs = esp32-m5atom-lite
;default_envs = esp32s3-atomS3U
;default_envs = esp32doitv1-aithinker-r01-sx1278
;default_envs = esp32dev-rtl_433
;default_envs = esp32dev-rtl_433-fsk
;default_envs = heltec-rtl_433
;default_envs = heltec-rtl_433-fsk
;default_envs = heltec-ble
;default_envs = lilygo-rtl_433
;default_envs = lilygo-rtl_433-fsk
;default_envs = lilygo-ble
;default_envs = esp32dev-multi_receiver
;default_envs = esp32dev-multi_receiver-pilight
;default_envs = tinypico-ble
;default_envs = ttgo-lora32-v1
;default_envs = ttgo-lora32-v21
;default_envs = ttgo-t-beam
;default_envs = heltec-wifi-lora-32
;default_envs = shelly-plus1
;default_envs = nodemcuv2-all-test
;default_envs = nodemcuv2-fastled-test
;default_envs = nodemcuv2-2g
;default_envs = nodemcuv2-ir
;default_envs = nodemcuv2-serial
;default_envs = avatto-bakeey-ir
;default_envs = nodemcuv2-rf
;default_envs = nodemcuv2-rf-cc1101
;default_envs = nodemcuv2-somfy-cc1101
;default_envs = manual-wifi-test
;default_envs = rf-wifi-gateway
;default_envs = nodemcuv2-rf2
;default_envs = nodemcuv2-rf2-cc1101
;default_envs = nodemcuv2-pilight
;default_envs = nodemcuv2-weatherstation
;default_envs = sonoff-basic
;default_envs = sonoff-basic-rfr3
;default_envs = atmega-all-test
;default_envs = uno-rf
;default_envs = uno-fastled
;default_envs = esp32dev-ble-datatest
;default_envs = esp32s3-dev-c1-ble
;default_envs = esp32c3-dev-m1-ble
;default_envs = airm2m_core_esp32c3
;default_envs = esp32c3-dev-c2-ble
;default_envs = lolin_c3_mini
;default_envs = thingpulse-espgateway
;default_envs = theengs-bridge
;default_envs = esp32dev-ble-idf
;default_envs = esp32s3-m5stack-stamps3
;default_envs = esp32c3-m5stamp
;default_envs = esp32c3u-m5stamp
;default_envs = lilygo-t3-s3-rtl_433
;default_envs = lilygo-t3-s3-rtl_433-fsk
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENVIRONMENTS PARAMETERS ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Libraries and parameters shared accross environements ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[libraries]
arduinojson = ArduinoJson@6.18.5
arduinolog = https://github.com/1technophile/Arduino-Log/archive/6d1f14a.zip
picomqtt = PicoMQTT@1.1.1
rc-switch = https://github.com/1technophile/rc-switch/archive/98537e9.zip
newremoteswitch = https://github.com/1technophile/NewRemoteSwitch/archive/8eb980e.zip
ble = https://github.com/h2zero/NimBLE-Arduino/archive/2.5.0.zip
irremoteesp = https://github.com/theengs/IRremoteESP8266/archive/arduinov3.zip
lora = https://github.com/sandeepmistry/arduino-LoRa/archive/f4a1d27.zip
esppilight = https://github.com/theengs/ESPiLight/archive/b9dd7a1.zip
rfWeatherStation = WeatherStationDataRx@0.3.1
rfm69 = https://github.com/LowPowerLab/RFM69/archive/2e915ea.zip
rfm69spi = https://github.com/lowpowerlab/spiflash/archive/9c0c2b9.zip
rfm69_low-power = Low-Power@1.6
dht = DHT sensor library@1.3.2
unifiedsensor = Adafruit Unified Sensor@1.1.4
tsl2561 = Adafruit TSL2561@1.0.3
bme280 = SparkFun BME280@2.0.4
bmp180 = https://github.com/xelarep/SFE_BMP180/archive/efac46b.zip
htu21 = SparkFun HTU21D Humidity and Temperature Sensor Breakout@1.1.3
ahtx0 = Adafruit AHTX0
ina226 = https://github.com/jarzebski/Arduino-INA226/archive/968a684.zip
a6lib = https://github.com/h2zero/A6lib/archive/fe873c9.zip
wifimanager32 = https://github.com/h2zero/WiFiManager/archive/1ac24f4.zip
wifimanager8266 = https://github.com/tzapu/WiFiManager/archive/2.0.5-beta.zip
ethernet = Ethernet
esp8266_mdns = esp8266_mdns
wire = Wire
fastled = fastled/FastLED@3.9.15
adafruit_neopixel = adafruit/Adafruit NeoPixel@^1.11.0
onewire = https://github.com/h2zero/OneWire/archive/GPIO-fix.zip
dallastemperature = DallasTemperature
; M5Unified + M5GFX drive all M5 boards (Core / Stick C / Stick C Plus / Tough);
; they build on the modern Arduino core and auto-detect the board at runtime,
; replacing the per-board M5Stack/M5StickC/M5StickC-Plus/M5Tough libraries.
m5unified = m5stack/M5Unified@^0.2.5
smartrc-cc1101-driver-lib = https://github.com/LSatan/SmartRC-CC1101-Driver-Lib/archive/v3.0.2.zip
stl = https://github.com/mike-matera/ArduinoSTL/archive/7411816.zip
shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library/archive/671ef7e.zip
somfy_remote=Somfy_Remote_Lib@0.3.0
rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP/archive/v0.5.1.zip
emodbus = miq19/eModbus@1.0.0
gfSunInverter = https://github.com/BlackSmith/GFSunInverter/archive/v1.0.1.zip
decoder = https://github.com/theengs/decoder/archive/development.zip
ssd1306 = https://github.com/ThingPulse/esp8266-oled-ssd1306/archive/f96fd6a.zip
lm75 = jeremycole/I2C Temperature Sensors derived from the LM75@^1.0.3
rn8209 = https://github.com/theengs/RN8209C-SDK/archive/arduino.zip
[env]
framework = arduino
lib_deps =
${libraries.picomqtt}
${libraries.arduinojson}
${libraries.arduinolog}
build_flags =
'-DWM_DEBUG_LEVEL=1' ;WiFi Manager log level, valid values are: DEBUG_ERROR = 0, DEBUG_NOTIFY = 1, DEBUG_VERBOSE = 2, DEBUG_DEV = 3, DEBUG_MAX = 4
-w ; supress all warnings
; -E ; generate precompiled source file (.pio/build/*/src/main.ino.cpp.o), use for precompilator debuging only (prevent compilation to succeed)
; '-DLOG_LEVEL=LOG_LEVEL_TRACE' ; Enable trace level logging
monitor_speed = 115200
extra_scripts = pre:scripts/add_mlongcalls.py
[com]
esp8266_platform = espressif8266@4.2.1
esp32_platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
esp32_platform_packages = framework-arduinoespressif32-libs @ https://github.com/theengs/esp32-arduino-lib-builder/releases/download/0.1.8/esp32-arduino-libs.tar.gz
esp32_solo_platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.02.00/platform-espressif32.zip
atmelavr_platform = atmelavr@3.3.0
[com-esp] ; Used by all ESP8266/ESP8285 based builds
lib_deps =
${env.lib_deps}
build_flags =
${env.build_flags}
'-DENV_NAME="$PIOENV"'
'-DZmqttDiscovery="HADiscovery"'
'-DMQTTsetMQTT'
'-DMQTT_HTTPS_FW_UPDATE'
;'-DCORE_DEBUG_LEVEL=4'
[com-esp32] ; Used by all ESP32 based builds
lib_deps =
${env.lib_deps}
${libraries.wifimanager32}
build_flags =
${env.build_flags}
'-DENV_NAME="$PIOENV"'
'-DZmqttDiscovery="HADiscovery"'
'-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED'
'-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED'
'-DCONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE'
'-DMQTTsetMQTT'
'-DMQTT_HTTPS_FW_UPDATE'
;'-DCORE_DEBUG_LEVEL=4'
'-DZwebUI="WebUI"' ; enable WebUI as a default for all ESP32 builds ( the module only enables for ESP32 based builds )
'-DARDUINO_LOOP_STACK_SIZE=9600' ; The firmware upgrade options needs a large amount of free stack, ~9600
[com-arduino]
lib_deps =
${env.lib_deps}
${libraries.ethernet}
build_flags =
${env.build_flags}
'-DZmqttDiscovery="HADiscovery"'
[com-arduino-low-memory]
lib_deps =
${env.lib_deps}
${libraries.ethernet}
build_flags =
${env.build_flags}
'-DsimpleReceiving=false'