Add ESP-IDF 6.0 compatibility fixes

This commit is contained in:
Dhaval Gujar 2026-04-16 15:47:56 +05:30
parent d49e4462d1
commit a9c014d915
4 changed files with 13 additions and 5 deletions

View File

@ -20,3 +20,9 @@ set(esp_openclaw_node_component_args
)
idf_component_register(${esp_openclaw_node_component_args})
# Work around the IDF 6.0/newlib-picolibc Annex K header breakage in the
# managed libsodium component without affecting the rest of the build.
if(TARGET __idf_espressif__libsodium)
target_compile_definitions(__idf_espressif__libsodium PRIVATE __STDC_WANT_LIB_EXT1__=0)
endif()

View File

@ -12,4 +12,4 @@ dependencies:
espressif/esp_websocket_client:
version: "1.6.1"
espressif/libsodium:
version: "1.0.20~4"
version: "1.0.21"

View File

@ -16,7 +16,7 @@
#include "esp_log.h"
#include "esp_random.h"
#include "mbedtls/base64.h"
#include "mbedtls/sha256.h"
#include "sha/sha_parallel_engine.h"
#include "nvs.h"
#include "sodium.h"
@ -241,7 +241,7 @@ esp_err_t esp_openclaw_node_identity_load_or_create(esp_openclaw_node_identity_t
}
uint8_t digest[32] = {0};
mbedtls_sha256(identity->public_key, ESP_OPENCLAW_NODE_ED25519_PUBLIC_KEY_LEN, digest, 0);
esp_sha(SHA2_256, identity->public_key, ESP_OPENCLAW_NODE_ED25519_PUBLIC_KEY_LEN, digest);
bytes_to_lower_hex(digest, sizeof(digest), identity->device_id, sizeof(identity->device_id));
err = base64url_encode(
identity->public_key,

View File

@ -16,7 +16,6 @@
#include "esp_check.h"
#include "esp_openclaw_node_example_json.h"
#include "soc/adc_channel.h"
#include "soc/adc_periph.h"
#include "soc/soc_caps.h"
#if SOC_ADC_SUPPORTED
@ -134,7 +133,10 @@ static esp_err_t handle_adc_read(
cJSON_AddNumberToObject(payload, "unit", 1);
cJSON_AddNumberToObject(payload, "channel", channel_num);
cJSON_AddNumberToObject(payload, "raw", raw);
cJSON_AddNumberToObject(payload, "gpio", adc_channel_io_map[0][channel_num]);
int gpio_num = -1;
if (adc_oneshot_channel_to_io(ADC_UNIT_1, adc_channel, &gpio_num) == ESP_OK) {
cJSON_AddNumberToObject(payload, "gpio", gpio_num);
}
if (adc->adc_cali_ready[channel_num]) {
int mv = 0;
if (adc_cali_raw_to_voltage(adc->adc_cali[channel_num], raw, &mv) == ESP_OK) {