Skip to content

Commit

Permalink
Update RainMaker and components
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Apr 10, 2023
1 parent 2d7218b commit 2ff2b43
Show file tree
Hide file tree
Showing 434 changed files with 7,258 additions and 1,989 deletions.
18 changes: 9 additions & 9 deletions platform.txt

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions tools/platformio-build-esp32.py

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions tools/platformio-build-esp32c3.py

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions tools/platformio-build-esp32s2.py

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions tools/platformio-build-esp32s3.py

Large diffs are not rendered by default.

47 changes: 25 additions & 22 deletions tools/sdk/esp32/dio_qspi/include/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_USE_NVS 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
Expand All @@ -70,6 +71,7 @@
#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1
#define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024
#define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90
#define CONFIG_ESP_RMAKER_OTA_TIME_SUPPORT 1
#define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10
#define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10
#define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1
Expand Down Expand Up @@ -608,23 +610,6 @@
#define CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES 16
#define CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT 30
#define CONFIG_WPA_MBEDTLS_CRYPTO 1
#define CONFIG_IO_GLITCH_FILTER_TIME_MS 50
#define CONFIG_ESP_RMAKER_LIB_ESP_MQTT 1
#define CONFIG_ESP_RMAKER_MQTT_GLUE_LIB 1
#define CONFIG_ESP_RMAKER_MQTT_PORT_443 1
#define CONFIG_ESP_RMAKER_MQTT_PORT 1
#define CONFIG_ESP_RMAKER_MQTT_SEND_USERNAME 1
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_NAME "RMDev"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_VERSION "1x0"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_SKU "EX00"
#define CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE 1
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK 4096
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_PRIORITY 5
#define CONFIG_ESP_RMAKER_FACTORY_PARTITION_NAME "fctry"
#define CONFIG_ESP_RMAKER_FACTORY_NAMESPACE "rmaker_creds"
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
Expand All @@ -641,14 +626,27 @@
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_ESP_RMAKER_LIB_ESP_MQTT 1
#define CONFIG_ESP_RMAKER_MQTT_GLUE_LIB 1
#define CONFIG_ESP_RMAKER_MQTT_PORT_443 1
#define CONFIG_ESP_RMAKER_MQTT_PORT 1
#define CONFIG_ESP_RMAKER_MQTT_SEND_USERNAME 1
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_NAME "RMDev"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_VERSION "1x0"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_SKU "EX00"
#define CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE 1
#define CONFIG_ESP_RMAKER_MAX_MQTT_SUBSCRIPTIONS 10
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK 4096
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_PRIORITY 5
#define CONFIG_ESP_RMAKER_FACTORY_PARTITION_NAME "fctry"
#define CONFIG_ESP_RMAKER_FACTORY_NAMESPACE "rmaker_creds"
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
#define CONFIG_DSP_MAX_FFT_SIZE 4096
#define CONFIG_IO_GLITCH_FILTER_TIME_MS 50
#define CONFIG_OV7670_SUPPORT 1
#define CONFIG_OV7725_SUPPORT 1
#define CONFIG_NT99141_SUPPORT 1
Expand Down Expand Up @@ -677,6 +675,11 @@
#define CONFIG_LITTLEFS_BLOCK_CYCLES 512
#define CONFIG_LITTLEFS_USE_MTIME 1
#define CONFIG_LITTLEFS_MTIME_USE_SECONDS 1
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
#define CONFIG_DSP_MAX_FFT_SIZE 4096

/* List of deprecated options */
#define CONFIG_A2DP_ENABLE CONFIG_BT_A2DP_ENABLE
Expand Down
47 changes: 25 additions & 22 deletions tools/sdk/esp32/dout_qspi/include/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_USE_NVS 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
Expand All @@ -70,6 +71,7 @@
#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1
#define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024
#define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90
#define CONFIG_ESP_RMAKER_OTA_TIME_SUPPORT 1
#define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10
#define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10
#define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1
Expand Down Expand Up @@ -608,23 +610,6 @@
#define CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES 16
#define CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT 30
#define CONFIG_WPA_MBEDTLS_CRYPTO 1
#define CONFIG_IO_GLITCH_FILTER_TIME_MS 50
#define CONFIG_ESP_RMAKER_LIB_ESP_MQTT 1
#define CONFIG_ESP_RMAKER_MQTT_GLUE_LIB 1
#define CONFIG_ESP_RMAKER_MQTT_PORT_443 1
#define CONFIG_ESP_RMAKER_MQTT_PORT 1
#define CONFIG_ESP_RMAKER_MQTT_SEND_USERNAME 1
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_NAME "RMDev"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_VERSION "1x0"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_SKU "EX00"
#define CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE 1
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK 4096
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_PRIORITY 5
#define CONFIG_ESP_RMAKER_FACTORY_PARTITION_NAME "fctry"
#define CONFIG_ESP_RMAKER_FACTORY_NAMESPACE "rmaker_creds"
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
Expand All @@ -641,14 +626,27 @@
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_ESP_RMAKER_LIB_ESP_MQTT 1
#define CONFIG_ESP_RMAKER_MQTT_GLUE_LIB 1
#define CONFIG_ESP_RMAKER_MQTT_PORT_443 1
#define CONFIG_ESP_RMAKER_MQTT_PORT 1
#define CONFIG_ESP_RMAKER_MQTT_SEND_USERNAME 1
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_NAME "RMDev"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_VERSION "1x0"
#define CONFIG_ESP_RMAKER_MQTT_PRODUCT_SKU "EX00"
#define CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE 1
#define CONFIG_ESP_RMAKER_MAX_MQTT_SUBSCRIPTIONS 10
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK 4096
#define CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_PRIORITY 5
#define CONFIG_ESP_RMAKER_FACTORY_PARTITION_NAME "fctry"
#define CONFIG_ESP_RMAKER_FACTORY_NAMESPACE "rmaker_creds"
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
#define CONFIG_DSP_MAX_FFT_SIZE 4096
#define CONFIG_IO_GLITCH_FILTER_TIME_MS 50
#define CONFIG_OV7670_SUPPORT 1
#define CONFIG_OV7725_SUPPORT 1
#define CONFIG_NT99141_SUPPORT 1
Expand Down Expand Up @@ -677,6 +675,11 @@
#define CONFIG_LITTLEFS_BLOCK_CYCLES 512
#define CONFIG_LITTLEFS_USE_MTIME 1
#define CONFIG_LITTLEFS_MTIME_USE_SECONDS 1
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
#define CONFIG_DSP_MAX_FFT_SIZE 4096

/* List of deprecated options */
#define CONFIG_A2DP_ENABLE CONFIG_BT_A2DP_ENABLE
Expand Down
4 changes: 2 additions & 2 deletions tools/sdk/esp32/include/esp_littlefs/include/esp_littlefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
extern "C" {
#endif

#define ESP_LITTLEFS_VERSION_NUMBER "1.5.1"
#define ESP_LITTLEFS_VERSION_NUMBER "1.5.3"
#define ESP_LITTLEFS_VERSION_MAJOR 1
#define ESP_LITTLEFS_VERSION_MINOR 5
#define ESP_LITTLEFS_VERSION_PATCH 1
#define ESP_LITTLEFS_VERSION_PATCH 3

/**
*Configuration structure for esp_vfs_littlefs_register.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_err.h"
#include "soc/soc_caps.h"

#ifdef SOC_HMAC_SUPPORTED
#include "esp_hmac.h"
/*
* @info
* PBKDF2_hmac- password based key derivation function based on HMAC.
* The API acts as a password based key derivation function by using the hardware HMAC peripheral present on the SoC. The hmac key shall be used from the efuse key block provided as the hmac_key_id. The API makes use of the hardware HMAC peripheral and hardware SHA peripheral present on the SoC. The SHA operation is limited to SHA256.
* @input
* hmac_key_id The efuse_key_id in which the HMAC key has already been burned.
* This key should be read and write protected for its protection. That way it can only be accessed by the hardware HMAC peripheral.
* salt The buffer containing the salt value
* salt_len The length of the salt in bytes
* key_length The expected length of the derived key.
* iteration_count The count for which the internal cryptographic operation shall be repeated.
* output The pointer to the buffer in which the derived key shall be stored. It must of a writable buffer of size key_length bytes
*
*/
int esp_pbkdf2_hmac_sha256(hmac_key_id_t hmac_key_id, const unsigned char *salt, size_t salt_len,
size_t iteration_count, size_t key_length, unsigned char *output);
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_err.h"

#include "soc/soc_caps.h"
#ifdef CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL
#include "rsa_sign_alt.h"
#endif

#ifdef __cplusplus
extern "C"
{
#endif

/* @info
* Init the esp_secure_cert nvs partition
*
* @return
* - ESP_OK On success
* - ESP_FAIL/other relevant esp error code
* On failure
*/
esp_err_t esp_secure_cert_init_nvs_partition(void);

/* @info
* Get the device cert from the esp_secure_cert partition
*
* @note
* If your esp_secure_cert partition is of type NVS, the API will dynamically allocate
* the required memory to store the device cert and return the pointer.
* The pointer can be freed in this case (NVS) using respective free API
*
* In case of cust_flash partition, a read only flash pointer shall be returned here. This pointer should not be freed
*
* @params
* - buffer(out) This value shall be filled with the device cert address
* on successful completion
* - len(out) This value shall be filled with the length of the device cert
* If your esp_secure_cert partition is of type NVS, the API will dynamically allocate
* the required memory to store the device cert
*
* In case of cust_flash partition, a read only flash pointer shall be returned here.
* @return
* - ESP_OK On success
* - ESP_FAIL/other relevant esp error code
* On failure
*/
esp_err_t esp_secure_cert_get_device_cert(char **buffer, uint32_t *len);

/*
* Free any internally allocated resources for the device cert.
* @note
* This API would free the memory if it is dynamically allocated
*
* @params
* - buffer(in) The data pointer
* This pointer should be the same one which has been obtained
* through "esp_secure_cert_get_device_cert" API.
*/
esp_err_t esp_secure_cert_free_device_cert(char *buffer);

/* @info
* Get the ca cert from the esp_secure_cert partition
*
* @note
* The API shall dynamically allocate the memory if required.
* The dynamic allocation of memory shall be required in following cases:
* 1) partition type is NVS
* 2) HMAC encryption is enabled for the API needs to be called
*
* The esp_secure_cert_free_ca_cert API needs to be called in order to free the memory.
* The API shall only free the memory if it has been dynamically allocated.
*
* @params
* - buffer(out) This value shall be filled with the ca cert address
* on successful completion
* - len(out) This value shall be filled with the length of the ca cert
* If your esp_secure_cert partition is of type NVS, the API will dynamically allocate
* the required memory to store the ca cert
*
* In case of cust_flash partition, a read only flash pointer shall be returned here.
* @return
* - ESP_OK On success
* - ESP_FAIL/other relevant esp error code
* On failure
*/
esp_err_t esp_secure_cert_get_ca_cert(char **buffer, uint32_t *len);

/*
* Free any internally allocated resources for the ca cert.
* @note
* This API would free the memory if it is dynamically allocated
*
* @params
* - buffer(in) The data pointer
* This pointer should be the same one which
* has been obtained through "esp_secure_cert_get_ca_cert" API.
*/
esp_err_t esp_secure_cert_free_ca_cert(char *buffer);

#ifndef CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL
/* @info
* Get the private key from the esp_secure_cert partition
*
* @note
* The API shall dynamically allocate the memory if required.
* The dynamic allocation of memory shall be required in following cases:
* 1) partition type is NVS
* 2) HMAC encryption is enabled for the API needs to be called
*
* The esp_secure_cert_free_priv_key API needs to be called in order to free the memory.
* The API shall only free the memory if it has been dynamically allocated.
*
* @params
* - buffer(out) This value shall be filled with the private key address
* on successful completion
* - len(out) This value shall be filled with the length of the private key
*
*
* @return
* - ESP_OK On success
* - ESP_FAIL/other relevant esp error code
* On failure
*/
esp_err_t esp_secure_cert_get_priv_key(char **buffer, uint32_t *len);

/*
* Free any internally allocated resources for the priv key.
* @note
* This API would free the memory if it is dynamically allocated
*
* @params
* - buffer(in) The data pointer
* This pointer should be the same one which
* has been obtained through "esp_secure_cert_get_priv_key" API.
*/
esp_err_t esp_secure_cert_free_priv_key(char *buffer);

#else /* !CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL */
/* @info
* This function returns the flash esp_ds_context which can then be
* directly provided to an esp-tls connection through its config structure.
* The memory for the context is dynamically allocated.
*
* @params
* - ds_ctx The pointer to the DS context
* @return
* - NULL On failure
*/
esp_ds_data_ctx_t *esp_secure_cert_get_ds_ctx(void);

/*
*@info
* Free the ds context
*/
void esp_secure_cert_free_ds_ctx(esp_ds_data_ctx_t *ds_ctx);
#endif /* CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL */

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 2ff2b43

Please sign in to comment.