Protocols
JSON
Removed Built-in JSON Component
The built-in json component has been removed from ESP-IDF. Users should migrate to using the espressif/cjson component from the IDF Component Manager.
Migration Steps
Remove json from CMakeLists.txt
In your component's
CMakeLists.txt, removejsonfrom theREQUIRESorPRIV_REQUIRESlist:# Before idf_component_register(SRCS "main.c" PRIV_REQUIRES json esp_http_server) # After idf_component_register(SRCS "main.c" PRIV_REQUIRES esp_http_server)
Add espressif/cjson to idf_component.yml
Add the
espressif/cjsondependency to your component'sidf_component.ymlfile. If this file doesn't exist, create it in your component directory (e.g.,main/idf_component.yml):dependencies: espressif/cjson: "^1.7.19"
No Code Changes Required
The API remains the same. Your existing code using cJSON functions will continue to work without modifications:
#include "cJSON.h" // Existing code works unchanged cJSON *root = cJSON_Parse(json_string); cJSON *item = cJSON_GetObjectItem(root, "key"); cJSON_Delete(root);
For more information:
ESP-TLS
Removed wolfSSL Support
The built-in wolfSSL TLS stack support has been removed from ESP-TLS. Users who were using wolfSSL should migrate to either:
mbedTLS (Recommended): The default TLS stack, fully integrated and maintained within ESP-IDF.
Custom TLS Stack: Register your own TLS implementation using the new custom stack API (see Option B below).
Removed Kconfig Options
The following Kconfig options have been removed:
CONFIG_ESP_TLS_USING_WOLFSSL- UseCONFIG_ESP_TLS_USING_MBEDTLSorCONFIG_ESP_TLS_CUSTOM_STACKinsteadCONFIG_ESP_DEBUG_WOLFSSL- For mbedTLS debugging, useCONFIG_MBEDTLS_DEBUGCONFIG_ESP_TLS_OCSP_CHECKALL- OCSP functionality should be handled by the chosen TLS stack
Migration Steps for wolfSSL Users
If your project was using wolfSSL via ESP-TLS:
Option A - Switch to mbedTLS
Remove
CONFIG_ESP_TLS_USING_WOLFSSL=yfrom your sdkconfigThe default
CONFIG_ESP_TLS_USING_MBEDTLSwill be used automaticallyNo code changes required for standard TLS operations
Option B - Use Custom Stack API
If you need to continue using wolfSSL or another TLS library, you can register it as a custom stack:
Enable
CONFIG_ESP_TLS_CUSTOM_STACKin menuconfigImplement the
esp_tls_stack_ops_tinterface for your TLS libraryCall
esp_tls_register_stack()before creating any TLS connections
For detailed documentation on implementing a custom TLS stack, see Custom TLS Stack Support.
Removed Deprecated API
The deprecated esp_tls_conn_http_new() function has been removed. Use either:
esp_tls_conn_http_new_sync()for blocking connectionsesp_tls_conn_http_new_async()for non-blocking connections
The new API requires you to create the esp_tls_t structure using esp_tls_init() and provides better control over the connection process.
ESP-Modbus
The Espressif ESP-Modbus Library (esp-modbus) supports Modbus communication in the networks based on RS485, Wi-Fi, and Ethernet interfaces.
The component esp-modbus v2 (v2.x.x) is the current supported component version:
Documentation
Application Examples
Since ESP-IDF version v6.0, the examples for component esp-modbus v1 which is obsolete have been removed from ESP-IDF.
The examples below demonstrate the ESP-Modbus library of serial and TCP ports for both slave and master implementations respectively.
mb_serial_slave - demonstrates how to use ESP32 as a Modbus serial slave device with the esp-modbus stack, enabling an external Modbus host to read and write device parameters using the Modbus protocol.
mb_serial_master - demonstrates how to use the esp-modbus stack port on ESP32 as a Modbus serial master device, capable of reading and writing values from slave devices in a Modbus segment.
mb_tcp_slave - demonstrates the esp-modbus TCP slave stack port, allowing an external Modbus host to read and write device parameters via the Modbus protocol.
mb_tcp_master - demonstrates how to use the esp-modbus stack port on ESP32 as a Modbus TCP master device, capable of reading and writing values from slave devices in a Modbus network.
Please refer to the README.md documents of each specific example for details.
Discussions
ESP-MQTT
Breaking change: ESP-MQTT moved to a managed component and example set updated.
The ESP-MQTT component has been removed from ESP-IDF and is now a managed component:
espressif/mqtt.To add the component to an application, run
idf.py add-dependency espressif/mqtt.Include headers and APIs remain the same (
mqtt_client.h), but the component is fetched via the Component Manager.
Example changes in ESP-IDF:
Legacy MQTT TLS examples under
examples/protocols/mqtt/ssl*were removed.New reference examples are available:
examples/protocols/mqtt: MQTT over TLS.examples/protocols/mqtt5: MQTT v5.0 over TLS.