MeshCoreTel-firmware icon indicating copy to clipboard operation
MeshCoreTel-firmware copied to clipboard

[Bug] ESP32 Firmwares won't build on PlatformIO Core 6.1.19

Open glutesha opened this issue 4 months ago • 2 comments

When trying to build a firmware for ESP32 targets platformio outputs something this:

/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh18prepareForOTAStartEv+0x4): undefined reference to `WebService::prepareForOTAStart()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZNK10WebService12isWebEnabledEv[WebService::isWebEnabled() const]+0x0): undefined reference to `WebPanelServer::isRunning() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMeshC2ERN4mesh9MainBoardERNS0_5RadioERNS0_16MillisecondClockERNS0_3RNGERNS0_8RTCClockERNS0_10MeshTablesE+0x50): undefined reference to `WebService::WebService()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh13handleCommandEjPcS0_+0xd0): undefined reference to `WebService::formatWebStatusReply(char*, unsigned int) const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh13handleCommandEjPcS0_+0xd4): undefined reference to `WebService::setWebEnabled(bool)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh13handleCommandEjPcS0_+0xd8): undefined reference to `WebService::setWebStatsEnabled(bool)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh5beginEPN2fs2FSEP14ArchiveStorage+0x8): undefined reference to `WebService::setCommandRunner(WebPanelCommandRunner*)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh5beginEPN2fs2FSEP14ArchiveStorage+0xc): undefined reference to `WebService::begin(fs::FS*)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh25formatWebStatsSummaryJsonEPcj+0x6c): undefined reference to `WebPanelServer::hasSessionToken() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o:(.literal._ZN6MyMesh4loopEv+0x0): undefined reference to `WebService::loop()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::prepareForOTAStart()':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:2073: undefined reference to `WebService::prepareForOTAStart()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `non-virtual thunk to MyMesh::prepareForOTAStart()':
MyMesh.cpp:(.text._ZThn200_N6MyMesh18prepareForOTAStartEv+0xe): undefined reference to `WebService::prepareForOTAStart()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `WebService::isWebEnabled() const':
/home/glutesha/Projects/MeshCoreTel-firmware/src/helpers/web/WebService.h:24: undefined reference to `WebPanelServer::isRunning() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::MyMesh(mesh::MainBoard&, mesh::Radio&, mesh::MillisecondClock&, mesh::RNG&, mesh::RTCClock&, mesh::MeshTables&)':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:1190: undefined reference to `WebService::WebService()'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::handleCommand(unsigned int, char*, char*)':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:2164: undefined reference to `WebService::formatWebStatusReply(char*, unsigned int) const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:2239: undefined reference to `WebService::setWebEnabled(bool)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:2263: undefined reference to `WebService::setWebStatsEnabled(bool)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::begin(fs::FS*, ArchiveStorage*)':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:1328: undefined reference to `WebService::setCommandRunner(WebPanelCommandRunner*)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `ESP32Board::setInhibitSleep(bool)':
/home/glutesha/Projects/MeshCoreTel-firmware/src/helpers/ESP32Board.h:176: undefined reference to `WebService::begin(fs::FS*)'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `WebService::isPanelRunning() const':
/home/glutesha/Projects/MeshCoreTel-firmware/src/helpers/web/WebService.h:29: undefined reference to `WebPanelServer::isRunning() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `WebService::isPanelUnlocked() const':
/home/glutesha/Projects/MeshCoreTel-firmware/src/helpers/web/WebService.h:30: undefined reference to `WebPanelServer::hasSessionToken() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::updateStatsHistory(unsigned long)':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:1805: undefined reference to `WebPanelServer::isRunning() const'
/home/glutesha/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/Xiao_S3_repeater/examples/simple_repeater/MyMesh.cpp.o: in function `MyMesh::loop()':
/home/glutesha/Projects/MeshCoreTel-firmware/examples/simple_repeater/MyMesh.cpp:2792: undefined reference to `WebService::loop()'
collect2: error: ld returned 1 exit status
*** [.pio/build/Xiao_S3_repeater/firmware.elf] Error 1
============================================================ [FAILED] Took 41.48 seconds ============================================================

Environment       Status    Duration
----------------  --------  ------------
Xiao_S3_repeater  FAILED    00:00:41.484
======================================================= 1 failed, 0 succeeded in 00:00:41.484 =======================================================

Adding this to ESP32 base in the main platformio.ini helps:

build_src_filter = ${arduino_base.build_src_filter}
  +<helpers/web> ; <- this
  +<../arch/esp32/task_pinning.c>
  +<../arch/esp32/tls_server_config.c>
  +<../arch/esp32/CPUUsageTracker.cpp>

So i'm probably doing a pull request soon. My system info:

❯ pio system info
--------------------------  ----------------------------------------------------------
PlatformIO Core             6.1.19
Python                      3.14.6-final.0
System Type                 linux_x86_64
Platform                    Linux-7.1.4-1-cachyos-x86_64-with-glibc2.43
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /home/glutesha/.platformio
PlatformIO Core Executable  /home/glutesha/.local/bin/platformio
Python Executable           /home/glutesha/.local/share/uv/tools/platformio/bin/python
Global Libraries            0
Development Platforms       2
Tools & Toolchains          17
--------------------------  ----------------------------------------------------------

glutesha avatar Aug 06 '26 14:08 glutesha

The issue has nothing to do with PlatformIO Core 6.1.19.

The MeshCoreTel-firmware fork only supports *_repeater_mqtt targets. See: https://vbart.github.io/MeshCoreTel-firmware/local-builds/#repeater_mqtt.

All other targets are left untouched only for easier merging from upstream.

Xiao S3 currently doesn't have a corresponding repeater_mqtt target.

VBart avatar Aug 16 '26 13:08 VBart

Got it.

glutesha avatar Aug 19 '26 07:08 glutesha