You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESP32-P4 with custom_sdkconfig build fails: ip_addr vs ip_addr_t type mismatch (AsyncTCP.cpp) #66
When building AsyncTCP for the ESP32-P4 with custom_sdkconfig set (even without any options), compilation fails due to mismatched types between [ip_addr] and [ip_addr_t].
To Reproduce use AsyncTCP as a dependency in a PlatformIO project targeting ESP32-P4 and set custom_sdkconfig.
Build the project.
Stack Trace
.pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:313:27: error: cannot convert 'ip_addr_t*' {aka 'ip4_addr*'} to 'ip_addr*'
e->client->_dns_found(&e->dns.addr);
^~~~~~~~~~~~
ip_addr_t* {aka ip4_addr*}
.pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:527:34: error: invalid application of 'sizeof' to incomplete type 'ip_addr'
memcpy(&e->dns.addr, ipaddr, sizeof(struct ip_addr));
^~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:1164:12: error: no matching function for call to 'AsyncClient::connect(ip_addr&, uint16_t&)'
connect(*ipaddr, _connect_port);
^~~~~~~~~~~~~~~~~~~~~
I am not able to reproduce. If I create a pio file with your content and create src/main.cpp with your c++ content and run pio run on CLI, I get :
-- Project sdkconfig file /Users/mat/Downloads/test/sdkconfig.esp32-p4
-- Configuring incomplete, errors occurred!
fatal: not a git repository (or any of the parent directories): .git
CMake Error at .pio/build/esp32-p4/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
/Users/mat/Downloads/test/.pio/build/esp32-p4/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
/Users/mat/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:83 (include)
/Users/mat/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:93 (get_git_head_revision)
/Users/mat/.platformio/packages/framework-espidf/tools/cmake/project.cmake:700 (git_describe)
CMakeLists.txt:3 (project)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/kconfgen/__main__.py", line 5, in <module>
from .core import main
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/kconfgen/core.py", line 29, in <module>
import esp_idf_kconfig.gen_kconfig_doc as gen_kconfig_doc
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/esp_idf_kconfig/gen_kconfig_doc.py", line 14, in <module>
import kconfiglib.core as kconfiglib
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/kconfiglib/__init__.py", line 3, in <module>
from .core import Kconfig # noqa F401
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/kconfiglib/core.py", line 27, in <module>
from kconfiglib.report import PRAGMA_PREFIX
File "/Users/mat/.platformio/penv/.espidf-5.4.1/lib/python3.11/site-packages/kconfiglib/report.py", line 29, in <module>
from rich import print as rprint
ModuleNotFoundError: No module named 'rich'
CMake Error at /Users/mat/.platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:209 (message):
Failed to run kconfgen
(/Users/mat/.platformio/penv/.espidf-5.4.1/bin/python;-m;kconfgen;--list-separator=semicolon;--kconfig;/Users/mat/.platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/Users/mat/.platformio/packages/framework-espidf/sdkconfig.rename;--config;/Users/mat/Downloads/test/sdkconfig.esp32-p4;--defaults;/Users/mat/Downloads/test/sdkconfig.defaults;--env-file;/Users/mat/Downloads/test/.pio/build/esp32-p4/config.env).
Error 1
Call Stack (most recent call first):
/Users/mat/.platformio/packages/framework-espidf/tools/cmake/build.cmake:681 (__kconfig_generate_config)
/Users/mat/.platformio/packages/framework-espidf/tools/cmake/project.cmake:717 (idf_build_process)
CMakeLists.txt:3 (project)
After testing many settings, different boards and Async versions, I discovered that PlatformIO/Arduino doesn't seem to clear the build cache properly (or at least that's what it looks like). Sometimes a build works correctly, and other times it doesn’t—seemingly at random.
When manually deleting all cache/temp files in the project folder:
Folders:
But disabling IPV6 support by uncommenting CONFIG_LWIP_IPV6=n
Will produce the ip_addr_t error. .pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:313:27: error: cannot convert 'ip_addr_t*' {aka 'ip4_addr*'} to 'ip_addr*' e->client->_dns_found(&e->dns.addr); ^~~~~~~~~~~~ ip_addr_t* {aka ip4_addr*} .pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:527:34: error: invalid application of 'sizeof' to incomplete type 'ip_addr' memcpy(&e->dns.addr, ipaddr, sizeof(struct ip_addr)); ^~~~~~~~~~~~~~~~~~~~ .pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:1164:12: error: no matching function for call to 'AsyncClient::connect(ip_addr&, uint16_t&)' connect(*ipaddr, _connect_port); ^~~~~~~~~~~~~~~~~~~~~
After an error, no other options, lib_deps or boards will compile. You need to manually clear all the caches & temp files.
To summarize for AsyncTCP:
It will not compile with these platformio settings:
I suspect CONFIG_LWIP_IPV6 is required... Even Arduino 2 has it set and AsyncTCP is for Arduino 2 and 3. It was recently opened to esp-idf only but not sure it can be used with CONFIG_LWIP_IPV6=n, especially with framework = arduino.
Maybe @ willmmiles or @me-no-dev would know better...
I will move this to support ticket for now, until it is proven there is a real issue which is not related to a usage problem.
Activity
mathieucarbou commentedon Jun 3, 2025
Hi,
Did you try with v3.4.1 ?
Did you also try with esp32dev board (with v3.4.1 and with v3.4.3) ?
mathieucarbou commentedon Jun 3, 2025
I am not able to reproduce. If I create a pio file with your content and create src/main.cpp with your c++ content and run
pio runon CLI, I get :qniens commentedon Jun 3, 2025
After testing many settings, different boards and Async versions, I discovered that PlatformIO/Arduino doesn't seem to clear the build cache properly (or at least that's what it looks like). Sometimes a build works correctly, and other times it doesn’t—seemingly at random.
When manually deleting all cache/temp files in the project folder:
Folders:
Files:
And these settings, it will compile.
But disabling IPV6 support by uncommenting
CONFIG_LWIP_IPV6=nWill produce the ip_addr_t error.
.pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:313:27: error: cannot convert 'ip_addr_t*' {aka 'ip4_addr*'} to 'ip_addr*' e->client->_dns_found(&e->dns.addr); ^~~~~~~~~~~~ ip_addr_t* {aka ip4_addr*} .pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:527:34: error: invalid application of 'sizeof' to incomplete type 'ip_addr' memcpy(&e->dns.addr, ipaddr, sizeof(struct ip_addr)); ^~~~~~~~~~~~~~~~~~~~ .pio/libdeps/esp32-p4/AsyncTCP/src/AsyncTCP.cpp:1164:12: error: no matching function for call to 'AsyncClient::connect(ip_addr&, uint16_t&)' connect(*ipaddr, _connect_port); ^~~~~~~~~~~~~~~~~~~~~After an error, no other options, lib_deps or boards will compile. You need to manually clear all the caches & temp files.
To summarize for AsyncTCP:
It will not compile with these platformio settings:
mathieucarbou commentedon Jun 3, 2025
I suspect CONFIG_LWIP_IPV6 is required... Even Arduino 2 has it set and AsyncTCP is for Arduino 2 and 3. It was recently opened to esp-idf only but not sure it can be used with CONFIG_LWIP_IPV6=n, especially with framework = arduino.
Maybe @ willmmiles or @me-no-dev would know better...
I will move this to support ticket for now, until it is proven there is a real issue which is not related to a usage problem.