Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 9 additions & 45 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ------------------------------------------------------------------------------

# CI/release binaries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm removal of V3-specific envs and default artifacts impact

"default_envs" no longer includes any V3/legacy ESP32 envs (e.g., esp32dev_V4). Given that esp32dev now targets V4, ensure CI/release pipelines and artifact naming don’t rely on the old V4-suffixed env. Adjust downstream packaging/docs if needed.

Run this quick check to spot any references to deprecated V3/V4-suffixed env names in the repo:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Look for old env names that might still be mentioned in docs/scripts
rg -n -A1 -B1 $'\[env:esp32dev_V4\]|esp32dev_V3|esp32_idf_V3' || true

Length of output: 89


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Finding platformio.ini files..."
files=$(fd -HI --hidden --exclude node_modules platformio.ini 2>/dev/null || true)
if [ -z "$files" ]; then
  files=$(rg --files --hidden --glob '!node_modules' | rg "platformio\.ini$" || true)
fi

if [ -z "$files" ]; then
  echo "No platformio.ini files found in the repo."
  exit 0
fi

echo "platformio.ini files found:"
printf '%s\n' "$files"
echo

for f in $files; do
  echo "== $f =="
  nl -ba "$f" | sed -n '1,240p'
  echo
  echo "-- default_envs lines in $f --"
  rg -n '^\s*default_envs\s*=' "$f" || echo " (none)"
  echo
  echo "-- [env:...] entries in $f --"
  rg -n '^\[env:' "$f" || echo " (none)"
  echo
done

echo "Searching entire repo for env sections containing V3/V4 (case-insensitive)..."
rg -n --hidden --glob '!node_modules' -i '\[env:[^\]]*(?:v3|v4)[^\]]*\]' || true

echo "Searching for esp32dev / esp32_idf mentions with V3/V4 suffixes (case-insensitive)..."
rg -n --hidden --glob '!node_modules' -i '(?:esp32dev|esp32_idf)[-_]?v[34]\b' || true

echo "Searching for any esp32dev mentions (for broader context)..."
rg -n --hidden --glob '!node_modules' -i 'esp32dev' || true

Length of output: 550


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Locating platformio.ini..."
files=$(fd -HI --hidden --exclude node_modules platformio.ini 2>/dev/null || true)
if [ -z "$files" ]; then
  files=$(rg --files --hidden --glob '!node_modules' | rg "platformio\.ini$" || true)
fi

if [ -z "$files" ]; then
  echo "No platformio.ini found in the repo."
  exit 0
fi

echo "platformio.ini files found:"
printf '%s\n' "$files"
echo

for f in $files; do
  echo "== $f =="
  echo "---- file (first 240 lines) ----"
  awk 'NR<=240{printf("%5d  %s\n",NR,$0)}' "$f" || true
  echo
  echo "-- default_envs lines in $f --"
  rg -n '^\s*default_envs\s*=' "$f" || echo " (none)"
  echo
  echo "-- [env:...] entries in $f --"
  rg -n '^\[env:' "$f" || echo " (none)"
  echo
done

echo "Searching repo for V3/V4-suffixed env names and esp32dev mentions (case-insensitive)..."
rg -n --hidden --glob '!node_modules' -i '\[env:esp32dev_V4\]|\[env:esp32dev_V3\]|\besp32dev[_-]v[34]\b|\besp32dev_v[34]\b|\besp32_idf_v[34]\b' || true

echo
echo "Searching for any default_envs occurrences across repo..."
rg -n --hidden --glob '!node_modules' -i '^\s*default_envs\s*=' || true

echo
echo "Searching CI/docs/scripts for explicit env references (platformio/pio calls, release artifacts)..."
rg -n --hidden --glob '!node_modules' -i 'platformio .* -e|pio run -e|esp32dev[_-]v[34]|esp32_idf[_-]v[34]|esp32dev_v[34]' || true

Length of output: 22717


🏁 Script executed:

#!/bin/bash
set -euo pipefail

show() {
  file="$1"
  start="$2"
  end="$3"
  if [ -f "$file" ]; then
    echo "== $file ($start-$end) =="
    sed -n "${start},${end}p" "$file" || true
    echo
  else
    echo "== $file not found =="
    echo
  fi
}

# platformio.ini relevant ranges
show platformio.ini 230 340
show platformio.ini 420 640

# sample override and usermods files that were matched earlier
show platformio_override.sample.ini 1 30
show platformio_override.sample.ini 240 272

show usermods/platformio_override.usermods.ini 1 80
show usermods/usermod_v2_rotary_encoder_ui_ALT/platformio_override.sample.ini 1 80
show usermods/usermod_v2_four_line_display_ALT/platformio_override.sample.ini 1 80

# CI workflows
show .github/workflows/build.yml 1 240
show .github/workflows/usermods.yml 1 240

Length of output: 25629


Action: Update sample overrides / usermods that still reference esp32dev_V4

Verified: platformio.ini default_envs no longer contains V4-suffixed ESP32 envs (default_envs uses "esp32dev"). CI builds read default_envs via pio project config and name artifacts as firmware-${{ matrix.environment }} — so artifact names will follow the new env names. However several sample/override and usermod files still reference esp32dev_V4 (or esp32dev_V4_dio80) and should be updated or have compatibility envs added.

Files/locations to fix:

  • platformio.ini — line 13: default_envs = … esp32dev (confirmed removal of _V4 from defaults)
  • platformio_override.sample.ini — default_envs includes esp32dev_V4_dio80 and contains [env:esp32dev_V4_dio80] (sample override that will confuse users if copied)
  • usermods/platformio_override.usermods.ini — extends = env:esp32dev_V4 (used by Usermods CI when copying this file)
  • usermods/usermod_v2_rotary_encoder_ui_ALT/platformio_override.sample.ini — extends = env:esp32dev_V4
  • usermods/usermod_v2_four_line_display_ALT/platformio_override.sample.ini — extends = env:esp32dev_V4
  • .github/workflows/build.yml & .github/workflows/usermods.yml — CI builds derive the matrix from pio config and upload artifacts named firmware-${{ matrix.environment }}; update downstream packaging/docs if they expect old V4-suffixed artifact names.

Recommendation (choose one):

  • Replace esp32dev_V4* references in samples/usermods with the new env names (e.g., esp32dev / the appropriate env), OR
  • Reintroduce compatibility env aliases (esp32dev_V4 -> esp32dev) if you must preserve old artifact names/overrides.

default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32dev_V4, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover, usermods
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover, usermods

src_dir = ./wled00
data_dir = ./wled00/data
Expand Down Expand Up @@ -243,37 +243,27 @@ build_flags =
-D WLED_ENABLE_GIF

[esp32]
#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip
platform = [email protected]
platform_packages = framework-arduinoespressif32 @ https://github.com/Aircoookie/arduino-esp32.git#1.0.6.4
platform = ${esp32_idf_V4.platform}
platform_packages =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw a PR about adding these as they are missing for s3 etc. So are the packages required? Should they be added to the base definitions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My (limited) understanding is that you only need to define if you are overriding the default tools for the platform

build_unflags = ${common.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
#-DCONFIG_LITTLEFS_FOR_IDF_3_2
#use LITTLEFS library by lorol in ESP32 core 1.x.x instead of built-in in 2.x.x
-D LOROL_LITTLEFS
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
${esp32_all_variants.build_flags}
build_flags = ${esp32_idf_V4.build_flags}
lib_deps = ${esp32_idf_V4.lib_deps}

tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv
default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
extended_partitions = tools/WLED_ESP32_4MB_700k_FS.csv
big_partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem, coredump support
large_partitions = tools/WLED_ESP32_8MB.csv
extreme_partitions = tools/WLED_ESP32_16MB_9MB_FS.csv
lib_deps =
https://github.com/lorol/LITTLEFS.git
${esp32_all_variants.lib_deps}
${env.lib_deps}

board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
# additional build flags for audioreactive - must be applied globally
AR_build_flags = ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster)
AR_lib_deps = ;; for pre-usermod-library platformio_override compatibility


[esp32_idf_V4]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all are V4, do we need to state so? I.e. remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't sure if it made more sense to update the regular esp32 block or move things over.

When considering users with their own forks or at least platformio_override I thought it might possibly be best to use explicit V4 params in our example so it was clearer what was being used, but then for backwards compatibility set the default esp32 to reference V4

I'm happy to hear other suggestions

One other thing to bare in mind is what happens if we start adding some V5 builds into the mix too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats a good point. in that case keep the V4. Does it need to be added to S2/S3/C3 envs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, c3, s2 and s3 all use platform = ${esp32_idf_V4.platform}

;; experimental build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5
;; very similar to the normal ESP32 flags, but omitting Lorol LittleFS, as littlefs is included in the new framework already.
;; build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5
;;
;; please note that you can NOT update existing ESP32 installs with a "V4" build. Also updating by OTA will not work properly.
;; You need to completely erase your device (esptool erase_flash) first, then install the "V4" build from VSCode+platformio.
Expand All @@ -290,7 +280,6 @@ lib_deps =
${esp32_all_variants.lib_deps}
https://github.com/someweisguy/esp_dmx.git#47db25d
${env.lib_deps}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs

[esp32s2]
;; generic definitions for all ESP32-S2 boards
Expand Down Expand Up @@ -438,17 +427,6 @@ custom_usermods = audioreactive

[env:esp32dev]
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}

[env:esp32dev_V4]
board = esp32dev
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
custom_usermods = audioreactive
Expand Down Expand Up @@ -487,34 +465,20 @@ board_upload.maximum_size = 16777216
board_build.f_flash = 80000000L
board_build.flash_mode = dio

;[env:esp32dev_audioreactive]
;board = esp32dev
;platform = ${esp32.platform}
;platform_packages = ${esp32.platform_packages}
;custom_usermods = audioreactive
;build_unflags = ${common.build_unflags}
;build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_audioreactive\" #-D WLED_DISABLE_BROWNOUT_DET
;lib_deps = ${esp32.lib_deps}
;monitor_filters = esp32_exception_decoder
;board_build.partitions = ${esp32.default_partitions}
;; board_build.f_flash = 80000000L
;; board_build.flash_mode = dio

[env:esp32_eth]
board = esp32-poe
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
platform = ${esp32_idf_V4.platform}
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only
lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = dio

[env:esp32_wrover]
extends = esp32_idf_V4
platform = ${esp32_idf_V4.platform}
board = ttgo-t7-v14-mini32
board_build.f_flash = 80000000L
board_build.flash_mode = qio
Expand Down