velxio/backend/app/services/esp-idf-template
David Montero 0daa45df76 fix(esp32): enable mbedTLS PSK so WiFiClientSecure/HTTPClient link
arduino-esp32's WiFiClientSecure/ssl_client.cpp wraps its ENTIRE body
(start_ssl_client, ssl_init, send_ssl_data, ...) in
  #if !defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) ... #else <body> #endif
ESP-IDF's mbedtls defaults the PSK key-exchange modes OFF, so the object
compiled empty and any sketch using WiFiClientSecure — including
HTTPClient.begin(url), which links the secure client even for http:// —
failed to link with "undefined reference to start_ssl_client". Commenting
out begin() let the optimizer drop the unused client, which is why it
"compiled when commented".

- sdkconfig.defaults.in: enable the PSK key-exchange ciphersuites
  (CONFIG_MBEDTLS_PSK_MODES + the four KEY_EXCHANGE_*PSK), matching
  arduino-esp32's own sdkconfig.
- espidf_compiler: ESP-IDF only seeds sdkconfig from sdkconfig.defaults when
  sdkconfig is ABSENT. Persistent build dirs live in the build volume and
  keep a stale sdkconfig across image rebuilds, so the new CONFIG_* would
  never reach kconfig. Drop the generated sdkconfig when the rendered
  defaults change so it re-seeds on configure.
- test: assert the rendered sdkconfig enables PSK.

Verified end-to-end: the reported WiFi+HTTPClient sketch now compiles to a
1.1 MB binary (was a hard link error before).
2026-06-10 20:50:48 +02:00
..
main fix(espidf): drop CONFIGURE_DEPENDS from main/ glob — script-mode incompat 2026-05-23 17:49:14 +02:00
CMakeLists.txt feat: enhance Arduino library handling by detecting external libraries and creating IDF components, add tests for library resolution logic 2026-04-07 14:59:51 -03:00
partitions.csv
sdkconfig.defaults fix(espidf): enable mbedTLS PSK so ssl_client.cpp links 2026-05-14 12:38:20 -03:00
sdkconfig.defaults.in fix(esp32): enable mbedTLS PSK so WiFiClientSecure/HTTPClient link 2026-06-10 20:50:48 +02:00