From 18709faa9085e2df4e24c41fed6da216b7f8c485 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 19 Mar 2025 21:02:20 -0300 Subject: [PATCH 01/56] fix(uart): uart rx timeout validation with proper log message (#11141) * feat(uart): adds a function to calculate maximum valid rx timeout * fix(uart): check uart rx timeout value and log an error msg * fix(uart): changes log message to a more clear one * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/esp32-hal-uart.c | 26 +++++++++++++++++++++++++- cores/esp32/esp32-hal-uart.h | 4 ++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index d76578480f5..75e2da013ea 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -757,7 +757,11 @@ bool uartSetRxTimeout(uart_t *uart, uint8_t numSymbTimeout) { if (uart == NULL) { return false; } - + uint16_t maxRXTimeout = uart_get_max_rx_timeout(uart->num); + if (numSymbTimeout > maxRXTimeout) { + log_e("Invalid RX Timeout value, its limit is %d", maxRXTimeout); + return false; + } UART_MUTEX_LOCK(); bool retCode = (ESP_OK == uart_set_rx_timeout(uart->num, numSymbTimeout)); UART_MUTEX_UNLOCK(); @@ -1382,4 +1386,24 @@ int uart_send_msg_with_break(uint8_t uartNum, uint8_t *msg, size_t msgSize) { return uart_write_bytes_with_break(uartNum, (const void *)msg, msgSize, 12); } +// returns the maximum valid uart RX Timeout based on the UART Source Clock and Baudrate +uint16_t uart_get_max_rx_timeout(uint8_t uartNum) { + if (uartNum >= SOC_UART_NUM) { + log_e("UART%d is invalid. This device has %d UARTs, from 0 to %d.", uartNum, SOC_UART_NUM, SOC_UART_NUM - 1); + return (uint16_t)-1; + } + uint16_t tout_max_thresh = uart_ll_max_tout_thrd(UART_LL_GET_HW(uartNum)); + uint8_t symbol_len = 1; // number of bits per symbol including start + uart_parity_t parity_mode; + uart_stop_bits_t stop_bit; + uart_word_length_t data_bit; + uart_ll_get_data_bit_num(UART_LL_GET_HW(uartNum), &data_bit); + uart_ll_get_stop_bits(UART_LL_GET_HW(uartNum), &stop_bit); + uart_ll_get_parity(UART_LL_GET_HW(uartNum), &parity_mode); + symbol_len += (data_bit < UART_DATA_BITS_MAX) ? (uint8_t)data_bit + 5 : 8; + symbol_len += (stop_bit > UART_STOP_BITS_1) ? 2 : 1; + symbol_len += (parity_mode > UART_PARITY_DISABLE) ? 1 : 0; + return (uint16_t)(tout_max_thresh / symbol_len); +} + #endif /* SOC_UART_SUPPORTED */ diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h index 9edbc4bfd22..4d686fdd23d 100644 --- a/cores/esp32/esp32-hal-uart.h +++ b/cores/esp32/esp32-hal-uart.h @@ -116,6 +116,10 @@ void uart_send_break(uint8_t uartNum); // Sends a buffer and at the end of the stream, it generates BREAK in the line int uart_send_msg_with_break(uint8_t uartNum, uint8_t *msg, size_t msgSize); +// UART RX Timeout (in UART Symbols) depends on the UART Clock Source and the SoC that is used +// This is a helper function that calculates what is the maximum RX Timeout that a running UART IDF driver allows. +uint16_t uart_get_max_rx_timeout(uint8_t uartNum); + #ifdef __cplusplus } #endif From 66abd86ce906dedad848f17685ca5c445d48ae26 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Wed, 19 Mar 2025 21:06:20 -0300 Subject: [PATCH 02/56] fix(camera_webserver): Fix typo in OV2640 definition (#11145) --- .../Camera/CameraWebServer/camera_index.h | 515 +++++++++--------- 1 file changed, 260 insertions(+), 255 deletions(-) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h index 07e2d661821..b38e2773af3 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h +++ b/libraries/ESP32/examples/Camera/CameraWebServer/camera_index.h @@ -1,260 +1,265 @@ -//File: index_ov2640.html.gz, Size: 6578 -#define index_ov2640_html_gz_len 6578 +//File: index_ov2640.html.gz, Size: 6687 +#define index_ov2640_html_gz_len 6687 const unsigned char index_ov2640_html_gz[] = { - 0x1F, 0x8B, 0x08, 0x08, 0x99, 0xA8, 0x7B, 0x67, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x5F, 0x6F, 0x76, 0x32, 0x36, 0x34, 0x30, 0x2E, 0x68, 0x74, 0x6D, - 0x6C, 0x00, 0xED, 0x3D, 0x6B, 0x73, 0xDB, 0x46, 0x92, 0xDF, 0xFD, 0x2B, 0x60, 0x24, 0x6B, 0x92, 0x65, 0x92, 0x22, 0x29, 0x4A, 0x96, 0x15, 0x89, 0x3E, 0x5B, - 0x56, 0x6C, 0xD7, 0xDA, 0x89, 0xD7, 0x4A, 0x1C, 0x6F, 0xA5, 0xB6, 0x6C, 0x10, 0x18, 0x92, 0x88, 0x41, 0x80, 0x0B, 0x80, 0xA2, 0x98, 0x94, 0x7E, 0xC7, 0xFD, - 0xA0, 0xFB, 0x63, 0xD7, 0x3D, 0x0F, 0x60, 0x00, 0x0C, 0x5E, 0xA4, 0x4C, 0x7A, 0x7D, 0x47, 0xA7, 0x22, 0x3C, 0x7A, 0x7A, 0xFA, 0xDD, 0x3D, 0x33, 0x18, 0xE0, - 0xEC, 0xBE, 0xE5, 0x99, 0xE1, 0x7A, 0x41, 0xB4, 0x59, 0x38, 0x77, 0x46, 0xF7, 0xCE, 0xD8, 0x1F, 0x0D, 0x7E, 0x67, 0x33, 0x62, 0x58, 0xEC, 0x90, 0x9E, 0xCE, - 0x49, 0x68, 0x68, 0xE6, 0xCC, 0xF0, 0x03, 0x12, 0x9E, 0xEB, 0xCB, 0x70, 0xD2, 0x39, 0xD1, 0xD3, 0xB7, 0x5D, 0x63, 0x4E, 0xCE, 0xF5, 0x6B, 0x9B, 0xAC, 0x16, - 0x9E, 0x1F, 0xEA,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, 0xBA, 0x9A, 0x01, 0x87, 0x56, 0x7A, 0x53, 0x17, 0x90, 0x52, 0x79, 0x84, + 0xA8, 0x0A, 0x6B, 0x11, 0xAF, 0x29, 0x96, 0x2B, 0x88, 0xC5, 0x3F, 0xF1, 0xC0, 0x71, 0x1C, 0x4C, 0x11, 0xCE, 0x9D, 0xE1, 0x17, 0xFF, 0x06, 0x6E, 0xDA, 0x6F, + 0xC1, 0x5F, 0xA4, 0x00, 0x00 }; //File: index_ov3660.html.gz, Size: 8636 From 7fda434d8916a7d6ad6561332b09a3a1293a75cd Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Fri, 21 Mar 2025 04:52:36 +0900 Subject: [PATCH 03/56] fix(rmt): Fixed protocol name in RMTReadXJT examples (#11136) * fix(rmt): Fixed protocol name in RMTReadXJT examples I couldn't find a protocol called D12. I found LR12 so I'll fix that. * feat(RMT): changing example commentary to reflect D16 protocol --------- Co-authored-by: Sugar Glider --- libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino b/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino index d9e86ce8399..762225bcdf5 100644 --- a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino +++ b/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino @@ -13,7 +13,7 @@ // limitations under the License. /** - * @brief This example demonstrates usage of RMT for receiving XJT D12 data + * @brief This example demonstrates usage of RMT for receiving XJT D16 data * * The output is the RMT data read and processed * @@ -21,7 +21,7 @@ // // Note: This example uses a FrSKY device communication -// using XJT D12 protocol +// using XJT D16 protocol // // ; 0 bit = 6us low/10us high // ; 1 bit = 14us low/10us high From 6c04a9315309b530120de98321f8d900c151a9b9 Mon Sep 17 00:00:00 2001 From: Math0XK <145477623+Math0XK@users.noreply.github.com> Date: Thu, 20 Mar 2025 21:11:11 +0100 Subject: [PATCH 04/56] Add a Default 32MB partition (#11143) * Add a Default 32MB partition This is a complementary addition to use 32MB boards in PlatformIO like the ESP32-S3-DevKitC-1-N32R8V. * Edited Board file Added partition "default_32MB" to the menu * Delete tools/boards.txt * Edited boards.txt Added the "default_32MB" partition to the menu * feat(boards): adds app13M_data7M_32MB to s3 octal * fix(board): format linux new line * fix(boards): trying to make it \n and not \r\n * add change to esp32s3-octal board too This reverts commit 3afddfc2ce5281d8cd0344bc91665665d4179040, reversing changes made to a9f64003bad5a2dcc1bd7f66e8494c9f8c8dd2e2. * fix(boards): setting eol as /n * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Sugar Glider Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- boards.txt | 6 ++++++ tools/partitions/default_32MB.csv | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 tools/partitions/default_32MB.csv diff --git a/boards.txt b/boards.txt index 2afe45f50a6..88d5eacfffc 100644 --- a/boards.txt +++ b/boards.txt @@ -940,6 +940,9 @@ esp32s3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 esp32s3.menu.PartitionScheme.app5M_little24M_32MB=32M Flash (4.8MB APP/22MB LittleFS) esp32s3.menu.PartitionScheme.app5M_little24M_32MB.build.partitions=large_littlefs_32MB esp32s3.menu.PartitionScheme.app5M_little24M_32MB.upload.maximum_size=4718592 +esp32s3.menu.PartitionScheme.app13M_data7M_32MB=32M Flash (13MB APP/6.75MB SPIFFS) +esp32s3.menu.PartitionScheme.app13M_data7M_32MB.build.partitions=default_32MB +esp32s3.menu.PartitionScheme.app13M_data7M_32MB.upload.maximum_size=13107200 esp32s3.menu.PartitionScheme.esp_sr_16=ESP SR 16M (3MB APP/7MB SPIFFS/2.9MB MODEL) esp32s3.menu.PartitionScheme.esp_sr_16.upload.maximum_size=3145728 esp32s3.menu.PartitionScheme.esp_sr_16.upload.extra_flags=0xD10000 {build.path}/srmodels.bin @@ -2148,6 +2151,9 @@ esp32s3-octal.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 esp32s3-octal.menu.PartitionScheme.app5M_little24M_32MB=32M Flash (4.8MB APP/22MB LittleFS) esp32s3-octal.menu.PartitionScheme.app5M_little24M_32MB.build.partitions=large_littlefs_32MB esp32s3-octal.menu.PartitionScheme.app5M_little24M_32MB.upload.maximum_size=4718592 +esp32s3-octal.menu.PartitionScheme.app13M_data7M_32MB=32M Flash (13MB APP/6.75MB SPIFFS) +esp32s3-octal.menu.PartitionScheme.app13M_data7M_32MB.build.partitions=default_32MB +esp32s3-octal.menu.PartitionScheme.app13M_data7M_32MB.upload.maximum_size=13107200 esp32s3-octal.menu.CPUFreq.240=240MHz (WiFi) esp32s3-octal.menu.CPUFreq.240.build.f_cpu=240000000L diff --git a/tools/partitions/default_32MB.csv b/tools/partitions/default_32MB.csv new file mode 100644 index 00000000000..dd07ac32185 --- /dev/null +++ b/tools/partitions/default_32MB.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0xC80000, +app1, app, ota_1, 0xC90000,0xC80000, +spiffs, data, spiffs, 0x1910000,0x6C0000, +coredump, data, coredump,0x1FF0000,0x10000, From cc2632b3bb0f45b34fbefd196581b727a45e36c8 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 24 Mar 2025 09:51:25 -0300 Subject: [PATCH 05/56] fix(ext_lib): Fix ESPAsyncWebServer URL and examples (#11160) --- .github/workflows/lib.json | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lib.json b/.github/workflows/lib.json index 9b528e4cc43..5b93d6689ef 100644 --- a/.github/workflows/lib.json +++ b/.github/workflows/lib.json @@ -23,16 +23,44 @@ ] }, { - "source-url": "https://github.com/me-no-dev/ESPAsyncWebServer.git", + "source-url": "https://github.com/ESP32Async/ESPAsyncWebServer.git", "required-libs": [ - {"source-url": "https://github.com/me-no-dev/AsyncTCP.git"} + {"source-url": "https://github.com/ESP32Async/AsyncTCP.git"} ], "exclude_targets": [], "sketch_path": [ + "~/Arduino/libraries/ESPAsyncWebServer/examples/Auth/Auth.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/CORS/CORS.ino", "~/Arduino/libraries/ESPAsyncWebServer/examples/CaptivePortal/CaptivePortal.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/ESP_AsyncFSBrowser.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/regex_patterns/regex_patterns.ino", - "~/Arduino/libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino" + "~/Arduino/libraries/ESPAsyncWebServer/examples/CatchAllHandler/CatchAllHandler.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ChunkResponse/ChunkResponse.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ChunkRetryResponse/ChunkRetryResponse.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/EndBegin/EndBegin.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Filters/Filters.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/FlashResponse/FlashResponse.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/HeaderManipulation/HeaderManipulation.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Headers/Headers.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Json/Json.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Logging/Logging.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/MessagePack/MessagePack.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Middleware/Middleware.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Params/Params.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/PartitionDownloader/PartitionDownloader.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/PerfTests/PerfTests.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/RateLimit/RateLimit.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Redirect/Redirect.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/RequestContinuation/RequestContinuation.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/RequestContinuationComplete/RequestContinuationComplete.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ResumableDownload/ResumableDownload.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Rewrite/Rewrite.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ServerSentEvents/ServerSentEvents.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/ServerState/ServerState.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/SkipServerMiddleware/SkipServerMiddleware.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/SlowChunkResponse/SlowChunkResponse.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/StaticFile/StaticFile.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Templates/Templates.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/Upload/Upload.ino", + "~/Arduino/libraries/ESPAsyncWebServer/examples/WebSocket/WebSocket.ino" ] }, { From 6273c4ffd821117a7804a146e2e19fc99f10590f Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Mon, 24 Mar 2025 09:59:42 -0300 Subject: [PATCH 06/56] fix(freertos_stats): remove volatile c++ 20 deprecated warning (#11158) --- cores/esp32/freertos_stats.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/esp32/freertos_stats.cpp b/cores/esp32/freertos_stats.cpp index 50a98bf502b..b37a5205e11 100644 --- a/cores/esp32/freertos_stats.cpp +++ b/cores/esp32/freertos_stats.cpp @@ -31,7 +31,8 @@ void printRunningTasks(Print &printer) { #endif configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0; TaskStatus_t *pxTaskStatusArray = NULL; - volatile UBaseType_t uxArraySize = 0, x = 0; + volatile UBaseType_t uxArraySize = 0; + uint32_t x = 0; const char *taskStates[] = {"Running", "Ready", "Blocked", "Suspended", "Deleted", "Invalid"}; // Take a snapshot of the number of tasks in case it changes while this function is executing. From cd7f4218e7fa0d2aa0c736284bf85436e178f361 Mon Sep 17 00:00:00 2001 From: Marcel <51757730+Marnek@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:26:49 +0200 Subject: [PATCH 07/56] Fix(esp32s3usbotg) stdbool dependency in pins_arduino.h (#11155) * Fix(esp32s3usbotg) stdbool dependency in pins_arduino.h * fix(board): Remove comment in pins_arduino.h --------- Co-authored-by: Me No Dev --- variants/esp32s3usbotg/pins_arduino.h | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/esp32s3usbotg/pins_arduino.h b/variants/esp32s3usbotg/pins_arduino.h index 004055cde49..5b873e2d2f1 100644 --- a/variants/esp32s3usbotg/pins_arduino.h +++ b/variants/esp32s3usbotg/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include #define USB_VID 0x303a #define USB_PID 0x1001 From 9dddc142fc32bc028f4c18eec409e24d57607529 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 27 Mar 2025 12:29:11 +0200 Subject: [PATCH 08/56] fix(net): Use network_event_handle_t for internal callbacks (#11179) * fix(net): Use network_event_handle_t for internal callbacks * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- libraries/Ethernet/src/ETH.cpp | 9 +++++---- libraries/Ethernet/src/ETH.h | 1 + libraries/PPP/src/PPP.cpp | 8 +++++--- libraries/PPP/src/PPP.h | 1 + libraries/WiFi/src/AP.cpp | 7 ++++--- libraries/WiFi/src/STA.cpp | 8 +++++--- libraries/WiFi/src/WiFiAP.h | 2 ++ libraries/WiFi/src/WiFiSTA.h | 1 + 8 files changed, 24 insertions(+), 13 deletions(-) diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 542a7e2a218..4c0b8cbbcfb 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -136,7 +136,7 @@ ETHClass::ETHClass(uint8_t eth_index) _pin_mcd(-1), _pin_mdio(-1), _pin_power(-1), _pin_rmii_clock(-1) #endif /* CONFIG_ETH_USE_ESP32_EMAC */ , - _task_stack_size(4096) { + _task_stack_size(4096), _eth_connected_event_handle(0) { } ETHClass::~ETHClass() {} @@ -359,7 +359,7 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i /* attach to receive events */ initNetif((Network_Interface_ID)(ESP_NETIF_ID_ETH + _eth_index)); - Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED); + _eth_connected_event_handle = Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED); ret = esp_eth_start(_eth_handle); if (ret != ESP_OK) { @@ -849,7 +849,7 @@ bool ETHClass::beginSPI( perimanSetPinBusExtraType(_pin_rst, "ETH_RST"); } - Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED); + _eth_connected_event_handle = Network.onSysEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED); return true; @@ -885,7 +885,8 @@ static bool empty_ethDetachBus(void *bus_pointer) { void ETHClass::end(void) { - Network.removeEvent(onEthConnected, ARDUINO_EVENT_ETH_CONNECTED); + Network.removeEvent(_eth_connected_event_handle); + _eth_connected_event_handle = 0; if (_eth_handle != NULL) { if (esp_eth_stop(_eth_handle) != ESP_OK) { diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index 891863e34bf..1995fc77a77 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -247,6 +247,7 @@ class ETHClass : public NetworkInterface { int8_t _pin_rmii_clock; #endif /* CONFIG_ETH_USE_ESP32_EMAC */ size_t _task_stack_size; + network_event_handle_t _eth_connected_event_handle; static bool ethDetachBus(void *bus_pointer); bool beginSPI( diff --git a/libraries/PPP/src/PPP.cpp b/libraries/PPP/src/PPP.cpp index 77b70d3969c..87fee6920c3 100644 --- a/libraries/PPP/src/PPP.cpp +++ b/libraries/PPP/src/PPP.cpp @@ -152,7 +152,8 @@ esp_modem_dce_t *PPPClass::handle() const { PPPClass::PPPClass() : _dce(NULL), _pin_tx(-1), _pin_rx(-1), _pin_rts(-1), _pin_cts(-1), _flow_ctrl(ESP_MODEM_FLOW_CONTROL_NONE), _pin_rst(-1), _pin_rst_act_low(true), - _pin_rst_delay(200), _pin(NULL), _apn(NULL), _rx_buffer_size(4096), _tx_buffer_size(512), _mode(ESP_MODEM_MODE_COMMAND), _uart_num(UART_NUM_1) {} + _pin_rst_delay(200), _pin(NULL), _apn(NULL), _rx_buffer_size(4096), _tx_buffer_size(512), _mode(ESP_MODEM_MODE_COMMAND), _uart_num(UART_NUM_1), + _ppp_event_handle(0) {} PPPClass::~PPPClass() {} @@ -360,7 +361,7 @@ bool PPPClass::begin(ppp_modem_model_t model, uint8_t uart_num, int baud_rate) { } } - Network.onSysEvent(onPppArduinoEvent); + _ppp_event_handle = Network.onSysEvent(onPppArduinoEvent); setStatusBits(ESP_NETIF_STARTED_BIT); arduino_event_t arduino_event; @@ -402,7 +403,8 @@ void PPPClass::end(void) { } _esp_modem = NULL; - Network.removeEvent(onPppArduinoEvent); + Network.removeEvent(_ppp_event_handle); + _ppp_event_handle = 0; if (_dce != NULL) { esp_modem_destroy(_dce); diff --git a/libraries/PPP/src/PPP.h b/libraries/PPP/src/PPP.h index b8e1f7ad56f..b317f52aefc 100644 --- a/libraries/PPP/src/PPP.h +++ b/libraries/PPP/src/PPP.h @@ -108,6 +108,7 @@ class PPPClass : public NetworkInterface { int _tx_buffer_size; esp_modem_dce_mode_t _mode; uint8_t _uart_num; + network_event_handle_t _ppp_event_handle; static bool pppDetachBus(void *bus_pointer); }; diff --git a/libraries/WiFi/src/AP.cpp b/libraries/WiFi/src/AP.cpp index b713a6d3901..0e7839764ea 100644 --- a/libraries/WiFi/src/AP.cpp +++ b/libraries/WiFi/src/AP.cpp @@ -148,7 +148,7 @@ void APClass::_onApEvent(int32_t event_id, void *event_data) { } } -APClass::APClass() { +APClass::APClass() : _wifi_ap_event_handle(0) { _ap_network_if = this; } @@ -163,7 +163,7 @@ bool APClass::onEnable() { return false; } if (_esp_netif == NULL) { - Network.onSysEvent(_onApArduinoEvent); + _wifi_ap_event_handle = Network.onSysEvent(_onApArduinoEvent); _esp_netif = get_esp_interface_netif(ESP_IF_WIFI_AP); /* attach to receive events */ initNetif(ESP_NETIF_ID_AP); @@ -172,7 +172,8 @@ bool APClass::onEnable() { } bool APClass::onDisable() { - Network.removeEvent(_onApArduinoEvent); + Network.removeEvent(_wifi_ap_event_handle); + _wifi_ap_event_handle = 0; // we just set _esp_netif to NULL here, so destroyNetif() does not try to destroy it. // That would be done by WiFi.enableAP(false) if STA is not enabled, or when it gets disabled _esp_netif = NULL; diff --git a/libraries/WiFi/src/STA.cpp b/libraries/WiFi/src/STA.cpp index 547a27d1c47..84258589b28 100644 --- a/libraries/WiFi/src/STA.cpp +++ b/libraries/WiFi/src/STA.cpp @@ -228,7 +228,8 @@ void STAClass::_onStaEvent(int32_t event_id, void *event_data) { } STAClass::STAClass() - : _minSecurity(WIFI_AUTH_WPA2_PSK), _scanMethod(WIFI_FAST_SCAN), _sortMethod(WIFI_CONNECT_AP_BY_SIGNAL), _autoReconnect(true), _status(WL_STOPPED) { + : _minSecurity(WIFI_AUTH_WPA2_PSK), _scanMethod(WIFI_FAST_SCAN), _sortMethod(WIFI_CONNECT_AP_BY_SIGNAL), _autoReconnect(true), _status(WL_STOPPED), + _wifi_sta_event_handle(0) { _sta_network_if = this; } @@ -276,14 +277,15 @@ bool STAClass::onEnable() { return false; } /* attach to receive events */ - Network.onSysEvent(_onStaArduinoEvent); + _wifi_sta_event_handle = Network.onSysEvent(_onStaArduinoEvent); initNetif(ESP_NETIF_ID_STA); } return true; } bool STAClass::onDisable() { - Network.removeEvent(_onStaArduinoEvent); + Network.removeEvent(_wifi_sta_event_handle); + _wifi_sta_event_handle = 0; // we just set _esp_netif to NULL here, so destroyNetif() does not try to destroy it. // That would be done by WiFi.enableSTA(false) if AP is not enabled, or when it gets disabled _esp_netif = NULL; diff --git a/libraries/WiFi/src/WiFiAP.h b/libraries/WiFi/src/WiFiAP.h index e80f91fa26c..540ec87f44f 100644 --- a/libraries/WiFi/src/WiFiAP.h +++ b/libraries/WiFi/src/WiFiAP.h @@ -60,6 +60,8 @@ class APClass : public NetworkInterface { void _onApEvent(int32_t event_id, void *event_data); protected: + network_event_handle_t _wifi_ap_event_handle; + size_t printDriverInfo(Print &out) const; friend class WiFiGenericClass; diff --git a/libraries/WiFi/src/WiFiSTA.h b/libraries/WiFi/src/WiFiSTA.h index 3c8adbd8502..6063eae7968 100644 --- a/libraries/WiFi/src/WiFiSTA.h +++ b/libraries/WiFi/src/WiFiSTA.h @@ -95,6 +95,7 @@ class STAClass : public NetworkInterface { wifi_sort_method_t _sortMethod; bool _autoReconnect; wl_status_t _status; + network_event_handle_t _wifi_sta_event_handle; size_t printDriverInfo(Print &out) const; From df51bc3aa5e6939821629c9838f0116b8652ef5d Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 27 Mar 2025 12:29:31 +0200 Subject: [PATCH 09/56] fix(eth): Set the ETH properties at the correct time (#11182) * fix(eth): Set the ETH properties at the correct time * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- libraries/Ethernet/src/ETH.cpp | 79 ++++++++++++++++++++++++++++++++-- libraries/Ethernet/src/ETH.h | 7 +++ 2 files changed, 82 insertions(+), 4 deletions(-) diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 4c0b8cbbcfb..3dfba37c684 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -124,7 +124,8 @@ void ETHClass::_onEthEvent(int32_t event_id, void *event_data) { } ETHClass::ETHClass(uint8_t eth_index) - : _eth_handle(NULL), _eth_index(eth_index), _phy_type(ETH_PHY_MAX), _glue_handle(NULL), _mac(NULL), _phy(NULL) + : _eth_handle(NULL), _eth_index(eth_index), _phy_type(ETH_PHY_MAX), _glue_handle(NULL), _mac(NULL), _phy(NULL), _eth_started(false), _link_speed(100), + _full_duplex(true), _auto_negotiation(true) #if ETH_SPI_SUPPORTS_CUSTOM , _spi(NULL) @@ -351,6 +352,19 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i return false; } + // auto negotiation needs to be disabled to change duplex mode and link speed + if (!_auto_negotiation) { + if (!_setAutoNegotiation(_auto_negotiation)) { + return false; + } + if (!_setFullDuplex(_full_duplex)) { + return false; + } + if (!_setLinkSpeed(_link_speed)) { + return false; + } + } + if (_eth_ev_instance == NULL && esp_event_handler_instance_register(ETH_EVENT, ESP_EVENT_ANY_ID, &_eth_event_cb, NULL, &_eth_ev_instance)) { log_e("event_handler_instance_register for ETH_EVENT Failed!"); return false; @@ -367,6 +381,8 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i return false; } + _eth_started = true; + if (!perimanSetPinBus(_pin_rmii_clock, ESP32_BUS_TYPE_ETHERNET_CLK, (void *)(this), -1, -1)) { goto err; } @@ -788,6 +804,19 @@ bool ETHClass::beginSPI( return false; } + // auto negotiation needs to be disabled to change duplex mode and link speed + if (!_auto_negotiation) { + if (!_setAutoNegotiation(_auto_negotiation)) { + return false; + } + if (!_setFullDuplex(_full_duplex)) { + return false; + } + if (!_setLinkSpeed(_link_speed)) { + return false; + } + } + if (_eth_ev_instance == NULL && esp_event_handler_instance_register(ETH_EVENT, ESP_EVENT_ANY_ID, &_eth_event_cb, NULL, &_eth_ev_instance)) { log_e("event_handler_instance_register for ETH_EVENT Failed!"); return false; @@ -803,6 +832,8 @@ bool ETHClass::beginSPI( return false; } + _eth_started = true; + // If Arduino's SPI is used, cs pin is in GPIO mode #if ETH_SPI_SUPPORTS_CUSTOM if (_spi == NULL) { @@ -897,6 +928,9 @@ void ETHClass::end(void) { while (getStatusBits() & ESP_NETIF_STARTED_BIT) { delay(10); } + + _eth_started = false; + //delete glue first if (_glue_handle != NULL) { if (esp_eth_del_netif_glue(_glue_handle) != ESP_OK) { @@ -1010,7 +1044,7 @@ bool ETHClass::fullDuplex() const { return (link_duplex == ETH_DUPLEX_FULL); } -bool ETHClass::setFullDuplex(bool on) { +bool ETHClass::_setFullDuplex(bool on) { if (_eth_handle == NULL) { return false; } @@ -1022,6 +1056,18 @@ bool ETHClass::setFullDuplex(bool on) { return err == ESP_OK; } +bool ETHClass::setFullDuplex(bool on) { + if (_eth_started) { + log_e("This method must be called before ETH.begin()"); + return false; + } + if (_auto_negotiation) { + log_w("Auto Negotiation MUST be OFF for this setting to be applied"); + } + _full_duplex = on; + return true; +} + bool ETHClass::autoNegotiation() const { if (_eth_handle == NULL) { return false; @@ -1031,7 +1077,7 @@ bool ETHClass::autoNegotiation() const { return auto_nego; } -bool ETHClass::setAutoNegotiation(bool on) { +bool ETHClass::_setAutoNegotiation(bool on) { if (_eth_handle == NULL) { return false; } @@ -1042,6 +1088,15 @@ bool ETHClass::setAutoNegotiation(bool on) { return err == ESP_OK; } +bool ETHClass::setAutoNegotiation(bool on) { + if (_eth_started) { + log_e("This method must be called before ETH.begin()"); + return false; + } + _auto_negotiation = on; + return true; +} + uint32_t ETHClass::phyAddr() const { if (_eth_handle == NULL) { return 0; @@ -1060,7 +1115,7 @@ uint16_t ETHClass::linkSpeed() const { return (link_speed == ETH_SPEED_10M) ? 10 : 100; } -bool ETHClass::setLinkSpeed(uint16_t speed) { +bool ETHClass::_setLinkSpeed(uint16_t speed) { if (_eth_handle == NULL) { return false; } @@ -1072,6 +1127,22 @@ bool ETHClass::setLinkSpeed(uint16_t speed) { return err == ESP_OK; } +bool ETHClass::setLinkSpeed(uint16_t speed) { + if (speed != 10 && speed != 100) { + log_e("Ethernet currently supports only 10 or 100 Mbps link speed"); + return false; + } + if (_eth_started) { + log_e("This method must be called before ETH.begin()"); + return false; + } + if (_auto_negotiation) { + log_w("Auto Negotiation MUST be OFF for this setting to be applied"); + } + _link_speed = speed; + return true; +} + // void ETHClass::getMac(uint8_t* mac) // { // if(_eth_handle != NULL && mac != NULL){ diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index 1995fc77a77..c52aac6ec6f 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -229,6 +229,10 @@ class ETHClass : public NetworkInterface { esp_eth_netif_glue_handle_t _glue_handle; esp_eth_mac_t *_mac; esp_eth_phy_t *_phy; + bool _eth_started; + uint16_t _link_speed; + bool _full_duplex; + bool _auto_negotiation; #if ETH_SPI_SUPPORTS_CUSTOM SPIClass *_spi; char _cs_str[10]; @@ -257,6 +261,9 @@ class ETHClass : public NetworkInterface { #endif int sck, int miso, int mosi, spi_host_device_t spi_host, uint8_t spi_freq_mhz ); + bool _setFullDuplex(bool on); + bool _setLinkSpeed(uint16_t speed); + bool _setAutoNegotiation(bool on); friend class EthernetClass; // to access beginSPI }; From 98611d46dc48dd75127819f416a444b9b661a81f Mon Sep 17 00:00:00 2001 From: ShuishengPeng <63339353+ackPeng@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:29:57 +0800 Subject: [PATCH 10/56] fix: Add 16M flash option for xiao_esp32_s3_plus (#11183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: xiao_esp32_s3_plus supports 16M flash, adds 16M flash and 16M partition table options * fix: remove empty lines --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> --- boards.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards.txt b/boards.txt index 88d5eacfffc..661d1f7a990 100644 --- a/boards.txt +++ b/boards.txt @@ -35264,6 +35264,8 @@ XIAO_ESP32S3_Plus.menu.FlashMode.dio.build.flash_freq=80m XIAO_ESP32S3_Plus.menu.FlashSize.8M=8MB (64Mb) XIAO_ESP32S3_Plus.menu.FlashSize.8M.build.flash_size=8MB +XIAO_ESP32S3_Plus.menu.FlashSize.16M=16MB (128Mb) +XIAO_ESP32S3_Plus.menu.FlashSize.16M.build.flash_size=16MB XIAO_ESP32S3_Plus.menu.LoopCore.1=Core 1 XIAO_ESP32S3_Plus.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 @@ -35302,6 +35304,12 @@ XIAO_ESP32S3_Plus.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) XIAO_ESP32S3_Plus.menu.UploadMode.cdc.upload.use_1200bps_touch=true XIAO_ESP32S3_Plus.menu.UploadMode.cdc.upload.wait_for_upload_port=true +XIAO_ESP32S3_Plus.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +XIAO_ESP32S3_Plus.menu.PartitionScheme.fatflash.build.partitions=ffat +XIAO_ESP32S3_Plus.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +XIAO_ESP32S3_Plus.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +XIAO_ESP32S3_Plus.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +XIAO_ESP32S3_Plus.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 XIAO_ESP32S3_Plus.menu.PartitionScheme.default_8MB=Default with spiffs (3MB APP/1.5MB SPIFFS) XIAO_ESP32S3_Plus.menu.PartitionScheme.default_8MB.build.partitions=default_8MB XIAO_ESP32S3_Plus.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 From caa597143cd7b11204f9f038e36be1d61a853fdb Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Thu, 27 Mar 2025 07:31:31 -0300 Subject: [PATCH 11/56] ci(workflows): Lock actions to commits and improve readability (#11147) * Revert "ci(actions): Replace changed-files (#11130)" This reverts commit ba2ab1e4bb59fe9601e8dd9c0ebbc544dfeca242. * ci(workflows): Lock actions to commits and improve readability --- .github/scripts/set_push_chunks.sh | 93 +--------------------- .github/workflows/allboards.yml | 10 +-- .github/workflows/boards.yml | 10 +-- .github/workflows/build_py_tools.yml | 33 +++++--- .github/workflows/dangerjs.yml | 4 +- .github/workflows/docs_build.yml | 9 ++- .github/workflows/docs_deploy.yml | 7 +- .github/workflows/gh-pages.yml | 4 +- .github/workflows/lib.yml | 15 ++-- .github/workflows/pre-commit-status.yml | 4 +- .github/workflows/pre-commit.yml | 27 ++----- .github/workflows/publishlib.yml | 4 +- .github/workflows/publishsizes-2.x.yml | 6 +- .github/workflows/publishsizes.yml | 8 +- .github/workflows/push.yml | 80 +++++++++++++++---- .github/workflows/release.yml | 16 +++- .github/workflows/tests.yml | 6 +- .github/workflows/tests_build.yml | 10 +-- .github/workflows/tests_hw.yml | 12 +-- .github/workflows/tests_qemu.yml | 18 ++--- .github/workflows/tests_results.yml | 14 ++-- .github/workflows/tests_wokwi.yml | 32 ++++---- .github/workflows/upload-idf-component.yml | 4 +- 23 files changed, 199 insertions(+), 227 deletions(-) diff --git a/.github/scripts/set_push_chunks.sh b/.github/scripts/set_push_chunks.sh index 21ae83ddacd..ff0af7da6e8 100644 --- a/.github/scripts/set_push_chunks.sh +++ b/.github/scripts/set_push_chunks.sh @@ -2,93 +2,6 @@ build_all=false chunks_count=0 -last_check_files="" -last_check_result="" -gh_output="" - -# Define the file patterns -core_files=( - '\.github/.*' - 'cores/.*' - 'package/.*' - 'tools/.*' - 'platform\.txt' - 'programmers\.txt' - 'variants/esp32/.*' - 'variants/esp32c3/.*' - 'variants/esp32c6/.*' - 'variants/esp32h2/.*' - 'variants/esp32p4/.*' - 'variants/esp32s2/.*' - 'variants/esp32s3/.*' -) -library_files=( - 'libraries/.*/examples/.*' - 'libraries/.*/src/.*' -) -networking_files=( - 'libraries/Network/src/.*' -) -fs_files=( - 'libraries/FS/src/.*' -) -static_sketches_files=( - 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure\.ino' - 'libraries/BLE/examples/Server/Server\.ino' - 'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer\.ino' - 'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics\.ino' - 'libraries/NetworkClientSecure/src/.*' - 'libraries/BLE/src/.*' - 'libraries/Insights/src/.*' -) -idf_files=( - 'idf_component\.yml' - 'Kconfig\.projbuild' - 'CMakeLists\.txt' - 'variants/esp32c2/.*' -) - -# Function to check if any files match the patterns -check_files() { - local patterns=("$@") - local files_found="" - for pattern in "${patterns[@]}"; do - echo "Checking pattern: $pattern" - matched_files=$(echo "$gh_output" | grep -E "$pattern") - echo "matched_files: $matched_files" - files_found+="$matched_files " - done - - last_check_files=$(echo "$files_found" | xargs) - if [[ -n $last_check_files ]]; then - last_check_result="true" - else - last_check_result="false" - fi - echo "last_check_result: $last_check_result" -} - -if [[ $IS_PR != 'true' ]]; then - gh_output=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename') -else - gh_output=$(gh pr diff "$PR_NUM" --name-only) -fi -echo "gh_output: $gh_output" - -# Output the results -check_files "${core_files[@]}" -CORE_CHANGED=$last_check_result -check_files "${library_files[@]}" -LIB_CHANGED=$last_check_result -LIB_FILES=$last_check_files -check_files "${networking_files[@]}" -NETWORKING_CHANGED=$last_check_result -check_files "${fs_files[@]}" -FS_CHANGED=$last_check_result -check_files "${static_sketches_files[@]}" -STATIC_SKETCHES_CHANGED=$last_check_result -check_files "${idf_files[@]}" -IDF_CHANGED=$last_check_result if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then echo "Core files changed or not a PR. Building all." @@ -163,9 +76,9 @@ chunks+="]" { echo "build_all=$build_all" - echo "build_libraries=$LIB_CHANGED" - echo "build_static_sketches=$STATIC_SKETCHES_CHANGED" - echo "build_idf=$IDF_CHANGED" + echo "build_libraries=$BUILD_LIBRARIES" + echo "build_static_sketches=$BUILD_STATIC_SKETCHES" + echo "build_idf=$BUILD_IDF" echo "chunk_count=$chunks_count" echo "chunks=$chunks" } >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/allboards.yml b/.github/workflows/allboards.yml index 8c4dadcd03e..6910ad05d3f 100644 --- a/.github/workflows/allboards.yml +++ b/.github/workflows/allboards.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.client_payload.branch }} @@ -32,13 +32,13 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.client_payload.branch }} - run: npm install - name: Setup jq - uses: dcarbone/install-jq-action@v1.0.1 + uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1 - id: set-test-chunks name: Set Chunks @@ -64,7 +64,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.client_payload.branch }} @@ -74,7 +74,7 @@ jobs: FQBN: ${{ toJSON(matrix.chunk) }} - name: Compile sketch - uses: P-R-O-C-H-Y/compile-sketches@main + uses: P-R-O-C-H-Y/compile-sketches@a62f069b92dc8f5053da4ac439ea6d1950cf6379 # main with: platforms: | ${{ env.REPOSITORY }} diff --git a/.github/workflows/boards.yml b/.github/workflows/boards.yml index a51c794cfb4..287e97219c4 100644 --- a/.github/workflows/boards.yml +++ b/.github/workflows/boards.yml @@ -22,10 +22,10 @@ jobs: steps: # This step makes the contents of the repository available to the workflow - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup jq - uses: dcarbone/install-jq-action@v1.0.1 + uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1 - name: Get board name run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}} @@ -47,7 +47,7 @@ jobs: steps: # This step makes the contents of the repository available to the workflow - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Check if build.board is uppercase run: | @@ -60,7 +60,7 @@ jobs: fi - name: Get libs cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: libs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package/package_esp32_index.template.json', 'tools/get.py') }} path: | @@ -73,7 +73,7 @@ jobs: ./tools/xtensa-* - name: Compile sketch - uses: P-R-O-C-H-Y/compile-sketches@main + uses: P-R-O-C-H-Y/compile-sketches@a62f069b92dc8f5053da4ac439ea6d1950cf6379 # main with: platforms: | ${{ env.REPOSITORY }} diff --git a/.github/workflows/build_py_tools.yml b/.github/workflows/build_py_tools.yml index ca13da03136..bbb36589c84 100644 --- a/.github/workflows/build_py_tools.yml +++ b/.github/workflows/build_py_tools.yml @@ -18,7 +18,7 @@ jobs: all_changed_files: ${{ steps.verify-changed-files.outputs.all_changed_files }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 2 ref: ${{ github.event.pull_request.head.ref }} @@ -30,15 +30,16 @@ jobs: echo "Make sure you are using a branch inside the repository and not a fork." - name: Verify Python Tools Changed + uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1 id: verify-changed-files - run: | - CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ^HEAD -- tools/get.py tools/espota.py tools/gen_esp32part.py tools/gen_insights_package.py | xargs) - echo "all_changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT - if [ -n "$CHANGED_FILES" ]; then - echo "any_changed=true" >> $GITHUB_OUTPUT - else - echo "any_changed=false" >> $GITHUB_OUTPUT - fi + with: + fetch_depth: "2" + since_last_remote_commit: "true" + files: | + tools/get.py + tools/espota.py + tools/gen_esp32part.py + tools/gen_insights_package.py - name: List all changed files shell: bash @@ -88,25 +89,30 @@ jobs: for tool in ${{ env.CHANGED_TOOLS }}; do echo "tool $tool was changed" done + - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ secrets.TOOLS_UPLOAD_PAT }} ref: ${{ github.event.pull_request.head.ref }} + - name: Set up Python 3.8 - uses: actions/setup-python@master + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: python-version: 3.8 + - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller requests + - name: Build with PyInstaller shell: bash run: | for tool in ${{ env.CHANGED_TOOLS }}; do pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/$tool.py done + - name: Sign binaries if: matrix.os == 'windows-latest' env: @@ -119,12 +125,14 @@ jobs: { ./.github/pytools/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/$node.exe } + - name: Test binaries shell: bash run: | for tool in ${{ env.CHANGED_TOOLS }}; do ./${{ env.DISTPATH }}/$tool${{ matrix.EXTEN }} -h done + - name: Push binary to tools if: matrix.os == 'windows-latest' env: @@ -135,8 +143,9 @@ jobs: cp -f ./${{ env.DISTPATH }}/$tool.exe tools/$tool.exe done bash .github/scripts/upload_py_tools.sh "${{ env.CHANGED_TOOLS }}" + - name: Archive artifact - uses: actions/upload-artifact@master + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ env.DISTPATH }} path: ${{ env.DISTPATH }} diff --git a/.github/workflows/dangerjs.yml b/.github/workflows/dangerjs.yml index 8fa7b737317..13bc907566b 100644 --- a/.github/workflows/dangerjs.yml +++ b/.github/workflows/dangerjs.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out PR head - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} - name: DangerJS pull request linter - uses: espressif/shared-github-dangerjs@v1 + uses: espressif/shared-github-dangerjs@fb17367fd3e8ff7412603b8e946d9b19ffdb2d7f # v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/docs_build.yml b/.github/workflows/docs_build.yml index d2f12e1f7b5..d9b9f160228 100644 --- a/.github/workflows/docs_build.yml +++ b/.github/workflows/docs_build.yml @@ -21,14 +21,16 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - - uses: actions/setup-python@v5 + + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: cache-dependency-path: docs/requirements.txt cache: "pip" python-version: "3.10" + - name: Build run: | sudo apt update @@ -38,8 +40,9 @@ jobs: cd ./docs PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en + - name: Archive Docs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: docs path: docs diff --git a/.github/workflows/docs_deploy.yml b/.github/workflows/docs_deploy.yml index b558fd21aa5..9f45e35aef8 100644 --- a/.github/workflows/docs_deploy.yml +++ b/.github/workflows/docs_deploy.yml @@ -26,14 +26,17 @@ jobs: run: | echo "Release workflow failed. Exiting..." exit 1 - - uses: actions/checkout@v4 + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - - uses: actions/setup-python@v5 + + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: cache-dependency-path: docs/requirements.txt cache: "pip" python-version: "3.10" + - name: Deploy Documentation env: # Deploy to production server diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 47480e8239a..60795229eff 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,9 @@ jobs: name: Build GitHub Pages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Copy Files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 1197308c921..0cb50842e5d 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -62,10 +62,10 @@ jobs: steps: # This step makes the contents of the repository available to the workflow - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Compile sketch - uses: P-R-O-C-H-Y/compile-sketches@main + uses: P-R-O-C-H-Y/compile-sketches@a62f069b92dc8f5053da4ac439ea6d1950cf6379 # main with: platforms: | ${{ env.REPOSITORY }} @@ -80,7 +80,7 @@ jobs: - --warnings="all" - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}-${{ matrix.target }} path: ${{ env.SKETCHES_REPORTS_PATH }} @@ -92,7 +92,7 @@ jobs: steps: # Check out repository - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ env.GITHUB_TOKEN }} fetch-depth: "0" @@ -102,14 +102,14 @@ jobs: # This step is needed to get the size data produced by the compile jobs - name: Download sketches reports artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: pattern: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}-* merge-multiple: true path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Report results - uses: P-R-O-C-H-Y/report-size-deltas@main + uses: P-R-O-C-H-Y/report-size-deltas@4a79caa6dcc3579024293638b97156106edc588e # main with: sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} destination-file: ${{ env.RESULT_LIBRARY_TEST_FILE }} @@ -136,8 +136,9 @@ jobs: env: PR_NUM: ${{ github.event.number }} run: echo $PR_NUM > pr_num.txt + - name: Upload PR number - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: pr_number path: ./pr_num.txt diff --git a/.github/workflows/pre-commit-status.yml b/.github/workflows/pre-commit-status.yml index d0060668476..c7be9f8d352 100644 --- a/.github/workflows/pre-commit-status.yml +++ b/.github/workflows/pre-commit-status.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Report success - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const owner = '${{ github.repository_owner }}'; @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Report pending - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const owner = '${{ github.repository_owner }}'; diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6290b9ea908..a3b858dd0fb 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout latest commit - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 2 @@ -34,7 +34,7 @@ jobs: GH_TOKEN: ${{ github.token }} - name: Set up Python 3 - uses: actions/setup-python@v5 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: cache-dependency-path: tools/pre-commit/requirements.txt cache: "pip" @@ -46,7 +46,7 @@ jobs: echo "PY_HASH=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - name: Restore pre-commit cache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 id: restore-cache with: path: | @@ -58,28 +58,13 @@ jobs: - name: Get changed files id: changed-files - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUM: ${{ github.event.pull_request.number }} - IS_PR: ${{ github.event_name == 'pull_request' }} - GITHUB_SHA: ${{ github.sha }} - run: | - if [[ $IS_PR != 'true' ]]; then - files_changed=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename' | xargs) - else - files_changed=$(gh pr diff "$PR_NUM" --name-only | xargs) - fi - echo "all_changed_files=$files_changed" >> $GITHUB_OUTPUT - echo "Changed files:" - for file in $files_changed; do - echo " $file" - done + uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1 - name: Run pre-commit hooks in changed files run: pre-commit run --color=always --show-diff-on-failure --files ${{ steps.changed-files.outputs.all_changed_files }} - name: Save pre-commit cache - uses: actions/cache/save@v4 + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: ${{ always() && steps.restore-cache.outputs.cache-hit != 'true' }} continue-on-error: true with: @@ -88,7 +73,7 @@ jobs: key: ${{ steps.restore-cache.outputs.cache-primary-key }} - name: Push changes using pre-commit-ci-lite - uses: pre-commit-ci/lite-action@v1.1.0 + uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0 # Only push changes in PRs if: ${{ always() && github.event_name == 'pull_request' }} with: diff --git a/.github/workflows/publishlib.yml b/.github/workflows/publishlib.yml index 62393b80915..0e1c3f64afd 100644 --- a/.github/workflows/publishlib.yml +++ b/.github/workflows/publishlib.yml @@ -44,12 +44,12 @@ jobs: - name: Read the pr_num file id: pr_num_reader - uses: juliangruber/read-file-action@v1 + uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7 with: path: ./artifacts/workflows/pr_num.txt - name: Report results - uses: P-R-O-C-H-Y/report-size-deltas@libs + uses: P-R-O-C-H-Y/report-size-deltas@256d1f13e4195cd7fd436d2f959e6dc4d5e4b406 # libs with: sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} github-token: ${{ env.GITHUB_TOKEN }} diff --git a/.github/workflows/publishsizes-2.x.yml b/.github/workflows/publishsizes-2.x.yml index ffbd751838c..738e215bc3f 100644 --- a/.github/workflows/publishsizes-2.x.yml +++ b/.github/workflows/publishsizes-2.x.yml @@ -14,8 +14,8 @@ jobs: name: Sizes Comparison Results runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 # This step checks out the repository's code at gh-pages branch + - name: Checkout gh-pages branch + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: gh-pages @@ -34,7 +34,7 @@ jobs: mv v2.x_cli_compile/*.json artifacts/sizes-report/master/ - name: Report results - uses: P-R-O-C-H-Y/report-size-deltas@sizes_v2 + uses: P-R-O-C-H-Y/report-size-deltas@2043188c68f483a7b50527c4eacf609d05bb67a5 # sizes_v2 with: sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} github-token: ${{ env.GITHUB_TOKEN }} diff --git a/.github/workflows/publishsizes.yml b/.github/workflows/publishsizes.yml index 6c6d75eccce..69c18cf1835 100644 --- a/.github/workflows/publishsizes.yml +++ b/.github/workflows/publishsizes.yml @@ -21,8 +21,8 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: - - name: Checkout code - uses: actions/checkout@v4 # This step checks out the repository's code at gh-pages branch + - name: Checkout gh-pages branch + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: gh-pages @@ -60,12 +60,12 @@ jobs: - name: Read the pr_num file id: pr_num_reader - uses: juliangruber/read-file-action@v1 + uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7 with: path: ./artifacts/sizes-report/pr_num.txt - name: Report results - uses: P-R-O-C-H-Y/report-size-deltas@sizes_v2 + uses: P-R-O-C-H-Y/report-size-deltas@2043188c68f483a7b50527c4eacf609d05bb67a5 # sizes_v2 with: sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} github-token: ${{ env.GITHUB_TOKEN }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index feb32f95d03..d98da24fc07 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -66,7 +66,7 @@ jobs: runs-on: ubuntu-latest if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - run: bash ./.github/scripts/check-cmakelists.sh gen-chunks: @@ -82,23 +82,69 @@ jobs: chunks: ${{ steps.set-chunks.outputs.chunks }} steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 2 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1 + with: + files_yaml: | + core: + - '.github/**' + - 'cores/**' + - 'package/**' + - 'tools/**' + - 'platform.txt' + - 'programmers.txt' + - "variants/esp32/**/*" + - "variants/esp32c3/**/*" + - "variants/esp32c6/**/*" + - "variants/esp32h2/**/*" + - "variants/esp32p4/**/*" + - "variants/esp32s2/**/*" + - "variants/esp32s3/**/*" + libraries: + - 'libraries/**/examples/**' + - 'libraries/**/src/**' + networking: + - 'libraries/Network/src/**' + fs: + - 'libraries/FS/src/**' + static_sketeches: + - 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino' + - 'libraries/BLE/examples/Server/Server.ino' + - 'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino' + - 'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino' + - 'libraries/NetworkClientSecure/src/**' + - 'libraries/BLE/src/**' + - 'libraries/Insights/src/**' + idf: + - 'idf_component.yml' + - 'Kconfig.projbuild' + - 'CMakeLists.txt' + - "variants/esp32c2/**/*" + - name: Set chunks id: set-chunks env: + LIB_FILES: ${{ steps.changed-files.outputs.libraries_all_changed_files }} IS_PR: ${{ github.event_name == 'pull_request' }} - PR_NUM: ${{ github.event.pull_request.number }} MAX_CHUNKS: ${{ env.MAX_CHUNKS }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_IDF: ${{ steps.changed-files.outputs.idf_any_changed == 'true' }} + BUILD_LIBRARIES: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }} + BUILD_STATIC_SKETCHES: ${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }} + FS_CHANGED: ${{ steps.changed-files.outputs.fs_any_changed == 'true' }} + NETWORKING_CHANGED: ${{ steps.changed-files.outputs.networking_any_changed == 'true' }} + CORE_CHANGED: ${{ steps.changed-files.outputs.core_any_changed == 'true' }} + LIB_CHANGED: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }} run: | bash ./.github/scripts/set_push_chunks.sh - name: Upload sketches found if: ${{ steps.set-chunks.outputs.build_all == 'false' && steps.set-chunks.outputs.build_libraries == 'true' }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: sketches_found path: sketches_found.txt @@ -117,13 +163,13 @@ jobs: chunk: ${{ fromJson(needs.gen-chunks.outputs.chunks) }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: python-version: "3.x" - name: Get libs cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: libs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package/package_esp32_index.template.json', 'tools/get.py') }} path: | @@ -151,7 +197,7 @@ jobs: - name: Download sketches found if: ${{ needs.gen-chunks.outputs.build_all == 'false' && needs.gen-chunks.outputs.build_libraries == 'true' }} - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: name: sketches_found @@ -161,7 +207,7 @@ jobs: #Upload cli compile json as artifact - name: Upload cli compile json - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: pr_cli_compile_${{ matrix.chunk }} path: cli_compile_${{ matrix.chunk }}.json @@ -179,8 +225,8 @@ jobs: os: [windows-latest, macOS-latest] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: python-version: "3.x" - name: Build Sketches @@ -216,10 +262,11 @@ jobs: container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Check out arduino-esp32 as a component - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: recursive path: components/arduino-esp32 + - name: Build env: IDF_TARGET: ${{ matrix.idf_target }} @@ -239,7 +286,7 @@ jobs: steps: # Check out repository - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{secrets.GITHUB_TOKEN}} fetch-depth: "0" @@ -248,7 +295,7 @@ jobs: run: git checkout remotes/origin/gh-pages - name: Download sketches reports artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: pattern: pr_cli_compile_* merge-multiple: true @@ -278,8 +325,9 @@ jobs: env: PR_NUM: ${{ github.event.number }} run: echo $PR_NUM > pr_num.txt + - name: Upload PR number - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: pr_number path: ./pr_num.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53a512dd54f..7b23c80c49a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,14 +10,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/setup-python@v5 + + - name: Set up Python + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 with: python-version: "3.x" - - run: pip install packaging - - run: pip install pyserial + + - name: Install packaging + run: pip install packaging + + - name: Install pyserial + run: pip install pyserial + - name: Build Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0db3b98782b..ddc9b64aace 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: event_file path: ${{ github.event_path }} @@ -62,7 +62,7 @@ jobs: PERFORMANCE_ENABLED: ${{ contains(github.event.pull_request.labels.*.name, 'perf_test') }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: sparse-checkout: .github/scripts/tests_matrix.sh @@ -71,7 +71,7 @@ jobs: run: bash .github/scripts/tests_matrix.sh - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: matrix_info path: info/* diff --git a/.github/workflows/tests_build.yml b/.github/workflows/tests_build.yml index 7a10c95ed22..ac1f40644ed 100644 --- a/.github/workflows/tests_build.yml +++ b/.github/workflows/tests_build.yml @@ -22,7 +22,7 @@ jobs: - name: Check if already built id: cache-build-binaries if: github.event.pull_request.number != null - uses: actions/cache/restore@v4 + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: tests-${{ env.id }}-bin path: | @@ -46,10 +46,10 @@ jobs: - name: Checkout user repository if: ${{ steps.check-build.outputs.enabled == 'true' }} - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Get libs cache - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: ${{ steps.check-build.outputs.enabled == 'true' }} with: key: libs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package/package_esp32_index.template.json', 'tools/get.py') }} @@ -68,7 +68,7 @@ jobs: bash .github/scripts/tests_build.sh -c -type ${{ inputs.type }} -t ${{ inputs.chip }} - name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as cache - uses: actions/cache/save@v4 + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: steps.check-build.outputs.enabled == 'true' && github.event.pull_request.number != null with: key: tests-${{ env.id }}-bin @@ -79,7 +79,7 @@ jobs: ~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig - name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: tests-bin-${{ inputs.chip }}-${{ inputs.type }} overwrite: true diff --git a/.github/workflows/tests_hw.yml b/.github/workflows/tests_hw.yml index 6c15ba79a7f..6f5fc67f7b9 100644 --- a/.github/workflows/tests_hw.yml +++ b/.github/workflows/tests_hw.yml @@ -37,7 +37,7 @@ jobs: - name: Check if already passed id: cache-results if: github.event.pull_request.number != null - uses: actions/cache/restore@v4 + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: tests-${{ env.id }}-results-hw path: | @@ -59,13 +59,13 @@ jobs: - name: Checkout user repository if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: sparse-checkout: | * # setup-python currently only works on ubuntu images - # - uses: actions/setup-python@v5 + # - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 # if: ${{ steps.check-tests.outputs.enabled == 'true' }} # with: # cache-dependency-path: tests/requirements.txt @@ -82,7 +82,7 @@ jobs: - name: Get binaries if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: name: tests-bin-${{ inputs.chip }}-${{ inputs.type }} path: | @@ -99,7 +99,7 @@ jobs: bash .github/scripts/tests_run.sh -c -type ${{ inputs.type }} -t ${{ inputs.chip }} -i 0 -m 1 -e - name: Upload ${{ inputs.chip }} ${{ inputs.type }} hardware results as cache - uses: actions/cache/save@v4 + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: steps.check-tests.outputs.enabled == 'true' && github.event.pull_request.number != null with: key: tests-${{ env.id }}-results-hw @@ -108,7 +108,7 @@ jobs: tests/**/result_*.json - name: Upload ${{ inputs.chip }} ${{ inputs.type }} hardware results as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: tests-results-hw-${{ inputs.chip }}-${{ inputs.type }} diff --git a/.github/workflows/tests_qemu.yml b/.github/workflows/tests_qemu.yml index 6c5934ce69a..fa3f874cbbb 100644 --- a/.github/workflows/tests_qemu.yml +++ b/.github/workflows/tests_qemu.yml @@ -21,7 +21,7 @@ jobs: - name: Check if already passed id: get-cache-results if: github.event.pull_request.number != null - uses: actions/cache/restore@v4 + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: tests-${{ env.id }}-results-qemu path: | @@ -43,7 +43,7 @@ jobs: - name: Checkout user repository if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} persist-credentials: false @@ -60,7 +60,7 @@ jobs: cd .github curl https://codeload.github.com/${{ github.repository }}/tar.gz/master | tar -xz --strip=2 arduino-esp32-master/.github - - uses: actions/setup-python@v5 + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 if: ${{ steps.check-tests.outputs.enabled == 'true' }} with: cache-dependency-path: tests/requirements.txt @@ -74,14 +74,14 @@ jobs: pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi - name: Install APT dependencies - uses: awalsh128/cache-apt-pkgs-action@v1.4.2 + uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # v1.4.3 if: ${{ steps.check-tests.outputs.enabled == 'true' }} with: packages: libpixman-1-0 libnuma1 libglib2.0-0 libslirp0 libsdl2-2.0-0 version: 1.0 - name: Get QEMU version - uses: pozetroninc/github-action-get-latest-release@v0.7.0 + uses: pozetroninc/github-action-get-latest-release@2a61c339ea7ef0a336d1daa35ef0cb1418e7676c # v0.8.0 if: ${{ steps.check-tests.outputs.enabled == 'true' }} id: get-qemu-version with: @@ -92,7 +92,7 @@ jobs: - name: Cache QEMU id: cache-qemu - uses: actions/cache@v4 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: ${{ steps.check-tests.outputs.enabled == 'true' }} with: path: | @@ -113,7 +113,7 @@ jobs: - name: Get binaries if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: name: tests-bin-${{ inputs.chip }}-${{ inputs.type }} path: | @@ -124,7 +124,7 @@ jobs: run: QEMU_PATH="${{ env.QEMU_INSTALL_PATH }}" bash .github/scripts/tests_run.sh -c -type ${{inputs.type}} -t ${{inputs.chip}} -i 0 -m 1 -Q - name: Upload ${{ inputs.chip }} ${{ inputs.type }} QEMU results as cache - uses: actions/cache/save@v4 + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: steps.check-tests.outputs.enabled == 'true' && github.event.pull_request.number != null with: key: tests-${{ env.id }}-results-qemu @@ -133,7 +133,7 @@ jobs: tests/**/result_*.json - name: Upload ${{ inputs.chip }} ${{ inputs.type }} QEMU results as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: tests-results-qemu-${{ inputs.chip }}-${{ inputs.type }} diff --git a/.github/workflows/tests_results.yml b/.github/workflows/tests_results.yml index 9e213fad14e..ebba2a3aa08 100644 --- a/.github/workflows/tests_results.yml +++ b/.github/workflows/tests_results.yml @@ -24,12 +24,12 @@ jobs: pull-requests: write contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: gh-pages - name: Download and Extract Artifacts - uses: dawidd6/action-download-artifact@v6 + uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9 with: run_id: ${{ github.event.workflow_run.id }} path: ./artifacts @@ -83,7 +83,7 @@ jobs: echo "Wokwi tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}" - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 with: commit: ${{ env.original_sha }} event_file: ./artifacts/parent-artifacts/event_file/event.json @@ -95,7 +95,7 @@ jobs: json_suite_details: true - name: Upload JSON - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: ${{ always() }} with: name: unity_results @@ -109,7 +109,7 @@ jobs: - name: Clean up caches if: always() - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const ref = process.env.original_ref; @@ -139,7 +139,7 @@ jobs: }); - name: Report conclusion - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 if: always() with: script: | @@ -175,7 +175,7 @@ jobs: - name: Generate badge if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} # codespell:ignore cancelled - uses: jaywcjlove/generated-badges@v1.0.13 + uses: jaywcjlove/generated-badges@0e078ae4d4bab3777ea4f137de496ab44688f5ad # v1.0.13 with: label: Runtime Tests status: ${{ job.status == 'success' && 'passing' || 'failing' }} diff --git a/.github/workflows/tests_wokwi.yml b/.github/workflows/tests_wokwi.yml index 4e5d3ceca51..03dd64fc0fb 100644 --- a/.github/workflows/tests_wokwi.yml +++ b/.github/workflows/tests_wokwi.yml @@ -27,7 +27,7 @@ jobs: types: ${{ steps.set-ref.outputs.types }} steps: - name: Report pending - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const owner = '${{ github.repository_owner }}'; @@ -47,7 +47,7 @@ jobs: core.info(`${name} is ${state}`); - name: Download and extract event file - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} @@ -55,7 +55,7 @@ jobs: path: artifacts/event_file - name: Download and extract matrix info - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} @@ -130,7 +130,7 @@ jobs: echo "ref=$ref" >> $GITHUB_OUTPUT - name: Download and extract parent hardware results - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -140,7 +140,7 @@ jobs: path: artifacts/results/hw - name: Download and extract parent QEMU results - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -150,14 +150,14 @@ jobs: path: artifacts/results/qemu - name: Upload parent artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: parent-artifacts path: artifacts if-no-files-found: error - name: Report conclusion - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 if: always() with: script: | @@ -197,7 +197,7 @@ jobs: chip: ${{ fromJson(needs.get-artifacts.outputs.targets) }} steps: - name: Report pending - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const owner = '${{ github.repository_owner }}'; @@ -219,7 +219,7 @@ jobs: - name: Check if already passed id: get-cache-results if: needs.get-artifacts.outputs.pr_num - uses: actions/cache/restore@v4 + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: key: tests-${{ env.id }}-results-wokwi path: | @@ -243,11 +243,11 @@ jobs: # DO NOT CHECKOUT THE USER'S REPOSITORY IN THIS WORKFLOW. IT HAS HIGH SECURITY RISKS. - name: Checkout repository if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ needs.get-artifacts.outputs.base || github.ref }} - - uses: actions/setup-python@v5 + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 if: ${{ steps.check-tests.outputs.enabled == 'true' }} with: cache-dependency-path: tests/requirements.txt @@ -266,11 +266,11 @@ jobs: - name: Wokwi CI Server if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: wokwi/wokwi-ci-server-action@v1 + uses: wokwi/wokwi-ci-server-action@a6fabb5a49e080158c7a1d121ea5b789536a82c3 # v1 - name: Get binaries if: ${{ steps.check-tests.outputs.enabled == 'true' }} - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} @@ -286,7 +286,7 @@ jobs: bash .github/scripts/tests_run.sh -c -type ${{ matrix.type }} -t ${{ matrix.chip }} -i 0 -m 1 -W ${{ env.WOKWI_TIMEOUT }} - name: Upload ${{ matrix.chip }} ${{ matrix.type }} Wokwi results as cache - uses: actions/cache/save@v4 + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 if: steps.check-tests.outputs.enabled == 'true' && needs.get-artifacts.outputs.pr_num with: key: tests-${{ env.id }}-results-wokwi @@ -295,7 +295,7 @@ jobs: tests/**/result_*.json - name: Upload ${{ matrix.chip }} ${{ matrix.type }} Wokwi results as artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: tests-results-wokwi-${{ matrix.chip }}-${{ matrix.type }} @@ -305,7 +305,7 @@ jobs: tests/**/result_*.json - name: Report conclusion - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 if: always() with: script: | diff --git a/.github/workflows/upload-idf-component.yml b/.github/workflows/upload-idf-component.yml index 5ce4562c01a..687e721fbc2 100644 --- a/.github/workflows/upload-idf-component.yml +++ b/.github/workflows/upload-idf-component.yml @@ -45,13 +45,13 @@ jobs: echo "Tag: $tag" echo "RELEASE_TAG=$tag" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.git_ref || env.RELEASE_TAG }} submodules: "recursive" - name: Upload components to the component registry - uses: espressif/upload-components-ci-action@v1 + uses: espressif/upload-components-ci-action@b78a19fa5424714997596d3ecffa634aef8ae20b # v1.0.5 with: name: arduino-esp32 version: ${{ env.RELEASE_TAG }} From 1ca9dab521fd4252e2c33799e79f1929e93bbd02 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Thu, 27 Mar 2025 07:32:36 -0300 Subject: [PATCH 12/56] fix(arduino_pins): fixes Lolin-C3-Pico and C3-Mini RGB LED pin + C3-Pico SPI SCK pin definition (#11186) * fix(arduino_pins): fixes RGB LED pin and SPI SCK pin definition * fix(arduino_pins): lolin-c3-mini rgb led pin --- variants/lolin_c3_mini/pins_arduino.h | 10 +++++++++- variants/lolin_c3_pico/pins_arduino.h | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/variants/lolin_c3_mini/pins_arduino.h b/variants/lolin_c3_mini/pins_arduino.h index c7357975ac7..0236f02267d 100644 --- a/variants/lolin_c3_mini/pins_arduino.h +++ b/variants/lolin_c3_mini/pins_arduino.h @@ -2,10 +2,18 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" -static const uint8_t LED_BUILTIN = 7; +// based on https://www.wemos.cc/en/latest/c3/c3_mini.html +// WS2812 RGB LED on pin 7 +#define PIN_RGB_LED 7 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED; #define BUILTIN_LED LED_BUILTIN // backward compatibility #define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t TX = 21; static const uint8_t RX = 20; diff --git a/variants/lolin_c3_pico/pins_arduino.h b/variants/lolin_c3_pico/pins_arduino.h index 8d4cfc5c4f0..45087c3f9fc 100644 --- a/variants/lolin_c3_pico/pins_arduino.h +++ b/variants/lolin_c3_pico/pins_arduino.h @@ -4,10 +4,18 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" -static const uint8_t LED_BUILTIN = 7; +// based on https://www.wemos.cc/en/latest/c3/c3_pico.html +// WS2812 RGB LED on pin 7 +#define PIN_RGB_LED 7 +// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED; #define BUILTIN_LED LED_BUILTIN // backward compatibility #define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 static const uint8_t TX = 21; static const uint8_t RX = 20; @@ -17,7 +25,7 @@ static const uint8_t SCL = 10; static const uint8_t VBAT = 3; -static const uint8_t SCK = 2; +static const uint8_t SCK = 1; static const uint8_t MISO = 0; static const uint8_t MOSI = 4; static const uint8_t SS = 5; From 86221479b774e65b0a3dc74ba901e8f4a1a89663 Mon Sep 17 00:00:00 2001 From: FidelSch Date: Thu, 27 Mar 2025 07:35:19 -0300 Subject: [PATCH 13/56] fix: BLEAdvertising methods return error codes (#11154) * fix: BLEAdvertising methods return error codes Some methods returned void even if they could produce an error, in which case they failed silently. They now return the corresponding error code. * fix: methods which could error out return bool Changed from returning esp_error_t, in order to be more arduino compatible. --------- Co-authored-by: Sugar Glider --- libraries/BLE/src/BLEAdvertising.cpp | 34 ++++++++++++++++------------ libraries/BLE/src/BLEAdvertising.h | 10 ++++---- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/libraries/BLE/src/BLEAdvertising.cpp b/libraries/BLE/src/BLEAdvertising.cpp index 2d71c4d7478..fe39a69c206 100644 --- a/libraries/BLE/src/BLEAdvertising.cpp +++ b/libraries/BLE/src/BLEAdvertising.cpp @@ -183,7 +183,7 @@ void BLEAdvertising::setScanFilter(bool scanRequestWhitelistOnly, bool connectWh * @brief Set the advertisement data that is to be published in a regular advertisement. * @param [in] advertisementData The data to be advertised. */ -void BLEAdvertising::setAdvertisementData(BLEAdvertisementData &advertisementData) { +bool BLEAdvertising::setAdvertisementData(BLEAdvertisementData &advertisementData) { log_v(">> setAdvertisementData"); esp_err_t errRc = ::esp_ble_gap_config_adv_data_raw((uint8_t *)advertisementData.getPayload().c_str(), advertisementData.getPayload().length()); if (errRc != ESP_OK) { @@ -191,13 +191,14 @@ void BLEAdvertising::setAdvertisementData(BLEAdvertisementData &advertisementDat } m_customAdvData = true; // Set the flag that indicates we are using custom advertising data. log_v("<< setAdvertisementData"); + return ESP_OK == errRc; } // setAdvertisementData /** * @brief Set the advertisement data that is to be published in a scan response. * @param [in] advertisementData The data to be advertised. */ -void BLEAdvertising::setScanResponseData(BLEAdvertisementData &advertisementData) { +bool BLEAdvertising::setScanResponseData(BLEAdvertisementData &advertisementData) { log_v(">> setScanResponseData"); esp_err_t errRc = ::esp_ble_gap_config_scan_rsp_data_raw((uint8_t *)advertisementData.getPayload().c_str(), advertisementData.getPayload().length()); if (errRc != ESP_OK) { @@ -205,6 +206,7 @@ void BLEAdvertising::setScanResponseData(BLEAdvertisementData &advertisementData } m_customScanResponseData = true; // Set the flag that indicates we are using custom scan response data. log_v("<< setScanResponseData"); + return ESP_OK == errRc; } // setScanResponseData /** @@ -212,7 +214,7 @@ void BLEAdvertising::setScanResponseData(BLEAdvertisementData &advertisementData * Start advertising. * @return N/A. */ -void BLEAdvertising::start() { +bool BLEAdvertising::start() { log_v(">> start: customAdvData: %d, customScanResponseData: %d", m_customAdvData, m_customScanResponseData); // We have a vector of service UUIDs that we wish to advertise. In order to use the @@ -225,7 +227,7 @@ void BLEAdvertising::start() { m_advData.p_service_uuid = (uint8_t *)malloc(m_advData.service_uuid_len); if (!m_advData.p_service_uuid) { log_e(">> start failed: out of memory"); - return; + return false; } uint8_t *p = m_advData.p_service_uuid; @@ -250,7 +252,7 @@ void BLEAdvertising::start() { errRc = ::esp_ble_gap_config_adv_data(&m_advData); if (errRc != ESP_OK) { log_e("<< esp_ble_gap_config_adv_data: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; + return false; } } @@ -266,7 +268,7 @@ void BLEAdvertising::start() { errRc = ::esp_ble_gap_config_adv_data(&m_scanRespData); if (errRc != ESP_OK) { log_e("<< esp_ble_gap_config_adv_data (Scan response): rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; + return false; } } @@ -279,9 +281,10 @@ void BLEAdvertising::start() { errRc = ::esp_ble_gap_start_advertising(&m_advParams); if (errRc != ESP_OK) { log_e("<< esp_ble_gap_start_advertising: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; + } else { + log_v("<< start"); } - log_v("<< start"); + return ESP_OK == errRc; } // start /** @@ -289,14 +292,15 @@ void BLEAdvertising::start() { * Stop advertising. * @return N/A. */ -void BLEAdvertising::stop() { +bool BLEAdvertising::stop() { log_v(">> stop"); esp_err_t errRc = ::esp_ble_gap_stop_advertising(); if (errRc != ESP_OK) { log_e("esp_ble_gap_stop_advertising: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; + } else { + log_v("<< stop"); } - log_v("<< stop"); + return ESP_OK == errRc; } // stop /** @@ -305,17 +309,17 @@ void BLEAdvertising::stop() { * @param [in] Bluetooth address type. * Set BLE address. */ - -void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type) { +bool BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type) { log_v(">> setPrivateAddress"); m_advParams.own_addr_type = type; esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t *)addr); if (errRc != ESP_OK) { log_e("esp_ble_gap_set_rand_addr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc)); - return; + } else { + log_v("<< setPrivateAddress"); } - log_v("<< setPrivateAddress"); + return ESP_OK == errRc; } // setPrivateAddress /** diff --git a/libraries/BLE/src/BLEAdvertising.h b/libraries/BLE/src/BLEAdvertising.h index 9da70a3d9ca..1e573ac814f 100644 --- a/libraries/BLE/src/BLEAdvertising.h +++ b/libraries/BLE/src/BLEAdvertising.h @@ -54,18 +54,18 @@ class BLEAdvertising { bool removeServiceUUID(int index); bool removeServiceUUID(BLEUUID serviceUUID); bool removeServiceUUID(const char *serviceUUID); - void start(); - void stop(); + bool start(); + bool stop(); void setAppearance(uint16_t appearance); void setAdvertisementType(esp_ble_adv_type_t adv_type); void setAdvertisementChannelMap(esp_ble_adv_channel_t channel_map); void setMaxInterval(uint16_t maxinterval); void setMinInterval(uint16_t mininterval); - void setAdvertisementData(BLEAdvertisementData &advertisementData); + bool setAdvertisementData(BLEAdvertisementData &advertisementData); void setScanFilter(bool scanRequestWhitelistOnly, bool connectWhitelistOnly); - void setScanResponseData(BLEAdvertisementData &advertisementData); + bool setScanResponseData(BLEAdvertisementData &advertisementData); void setPrivateAddress(esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); - void setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); + bool setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM); void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); void setMinPreferred(uint16_t); From e37435c442a6385bab0a4c8a2a03e9d142f2b090 Mon Sep 17 00:00:00 2001 From: MikaFromTheRoof Date: Thu, 27 Mar 2025 11:56:30 +0100 Subject: [PATCH 14/56] feat(zigbee): Add Illuminance sensor endpoint (#11171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added Zigbee light sensor * Add comment for macro * Some last corrections * refactor(zigbee): changed class name to ZigbeeIlluminanceSensor * feat(zigbee): Illumanance sensor update * fix(zigbee): Change name of macro to avoid possible conflict with esp-zigbee-sdk * Update keywords.txt * fix(zigbee): Add Illuminance to Cmake file * fix(example): Update Illuminance example * ci(pre-commit): Apply automatic fixes * Update Zigbee_Illuminance_Sensor.ino * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- CMakeLists.txt | 1 + .../Zigbee_Illuminance_Sensor/README.md | 78 ++++++++++ .../Zigbee_Illuminance_Sensor.ino | 141 ++++++++++++++++++ .../Zigbee_Illuminance_Sensor/ci.json | 7 + libraries/Zigbee/keywords.txt | 4 + libraries/Zigbee/src/Zigbee.h | 1 + .../Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp | 74 +++++++++ .../Zigbee/src/ep/ZigbeeIlluminanceSensor.h | 51 +++++++ 8 files changed, 357 insertions(+) create mode 100644 libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/README.md create mode 100644 libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/Zigbee_Illuminance_Sensor.ino create mode 100644 libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/ci.json create mode 100644 libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp create mode 100644 libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d2a9162a9ba..7539601d9e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,7 @@ set(ARDUINO_LIBRARY_Zigbee_SRCS libraries/Zigbee/src/ep/ZigbeeRangeExtender.cpp libraries/Zigbee/src/ep/ZigbeeGateway.cpp libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp + libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp ) set(ARDUINO_LIBRARY_BLE_SRCS diff --git a/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/README.md b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/README.md new file mode 100644 index 00000000000..fe723696d5a --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/README.md @@ -0,0 +1,78 @@ +# Arduino-ESP32 Zigbee Illuminance Sensor Example + +This example demonstrates how to use the Zigbee library to create an end device illuminance sensor and use it as a Home Automation (HA) extended illuminance sensor. + +# Supported Targets + +Currently, this example supports the following targets. + +| Supported Targets | ESP32-C6 | ESP32-H2 | +| ----------------- | -------- | -------- | + +## Illuminance Sensor Functions + +1. Initialize a Zigbee illuminance sensor. +2. Measure illuminance value. +3. Report the measured value to the Zigbee network. + +## Hardware Required + +* ESP32-H2 or ESP32-C6 development board +* A USB cable for power supply and programming +* Some kind of light sensor, such as a photoresistor + +### Configure the Project + +In this example the raw analog value of a light sensor is used to calculate illuminance. +Alter the calculation according to your use case and calibrate it to receive correct lux values. +Set the illuminance sensor GPIO by changing the `illuminance_sensor_pin` variable to the pin to the pin to which your sensor is connected. +Set the button GPIO by changing the `button` variable. By default, it's the pin `BOOT_PIN` (BOOT button on ESP32-C6 and ESP32-H2). + +#### Using Arduino IDE + +To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits). + +* Before Compile/Verify, select the correct board: `Tools -> Board`. +* Select the End device Zigbee mode: `Tools -> Zigbee mode: Zigbee ED (end device)` +* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs` +* Enable USB CDC to be able to use the serial monitor: `Tools -> USB CDC On Boot: Enabled` +* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port. +* Optional: Set debug level to verbose to see all logs from Zigbee stack: `Tools -> Core Debug Level: Verbose`. + +## Troubleshooting + +If the End device flashed with this example is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board. It is recommended to do this if you re-flash the coordinator. +You can do the following: + +* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`. +* Add to the sketch `Zigbee.factoryReset();` to reset the device and Zigbee stack. + +By default, the coordinator network is closed after rebooting or flashing new firmware. +To open the network you have 2 options: + +* Open network after reboot by setting `Zigbee.setRebootOpenNetwork(time);` before calling `Zigbee.begin();`. +* In application you can anytime call `Zigbee.openNetwork(time);` to open the network for devices to join. + +***Important: Make sure that you are using a good quality USB cable with data lines and that you have a reliable power source*** + +* **LED not blinking:** Check the wiring connection and the IO selection. +* **Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed. +* **COM port not detected:** Check the USB cable and the USB to Serial driver installation. + +If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute). + +## Contribute + +To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst) + +If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome! + +Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else. + +## Resources + +* Official ESP32 Forum: [Link](https://esp32.com) +* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32) +* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) +* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) +* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com) diff --git a/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/Zigbee_Illuminance_Sensor.ino b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/Zigbee_Illuminance_Sensor.ino new file mode 100644 index 00000000000..bbb2cba569f --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/Zigbee_Illuminance_Sensor.ino @@ -0,0 +1,141 @@ +// Copyright 2025 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @brief This example demonstrates Zigbee illuminance sensor. + * + * The example demonstrates how to use Zigbee library to create a end device illuminance sensor. + * The illuminance sensor is a Zigbee end device, which is controlled by a Zigbee coordinator. + * + * Proper Zigbee mode must be selected in Tools->Zigbee mode + * and also the correct partition scheme must be selected in Tools->Partition Scheme. + * + * Please check the README.md for instructions and more detailed description. + * + * Created by MikaFromTheRoof (https://github.com/MikaFromTheRoof) + */ + +#ifndef ZIGBEE_MODE_ED +#error "Zigbee end device mode is not selected in Tools->Zigbee mode" +#endif + +#include "Zigbee.h" + +#define ZIGBEE_ILLUMINANCE_SENSOR_ENDPOINT 9 +uint8_t button = BOOT_PIN; +uint8_t illuminance_sensor_pin = 6; // Insert the analog pin to which the sensor (e.g. photoresistor) is connected + +ZigbeeIlluminanceSensor zbIlluminanceSensor = ZigbeeIlluminanceSensor(ZIGBEE_ILLUMINANCE_SENSOR_ENDPOINT); + +/********************* Illuminance sensor **************************/ +static void illuminance_sensor_value_update(void *arg) { + for (;;) { + // read the raw analog value from the sensor + int lsens_analog_raw = analogRead(illuminance_sensor_pin); + Serial.printf("[Illuminance Sensor] raw analog value: %d\r\n", lsens_analog_raw); + + // conversion into zigbee raw illuminance value (typically between 0 in darkness and 50000 in direct sunlight) + // depends on the value range of the raw analog sensor values and will need calibration for correct lux values + // for demonstration purpose map the 12-bit ADC value (0-4095) to Zigbee illuminance range (0-50000) + int lsens_illuminance_raw = map(lsens_analog_raw, 0, 4095, 0, 50000); + Serial.printf("[Illuminance Sensor] raw illuminance value: %d\r\n", lsens_illuminance_raw); + + // according to zigbee documentation the formular 10^(lsens_illuminance_raw/10000)-1 can be used to calculate lux value from raw illuminance value + // Note: Zigbee2MQTT seems to be using the formular 10^(lsens_illuminance_raw/10000) instead (without -1) + int lsens_illuminance_lux = round(pow(10, (lsens_illuminance_raw / 10000.0)) - 1); + Serial.printf("[Illuminance Sensor] lux value: %d lux\r\n", lsens_illuminance_lux); + + // Update illuminance in illuminance sensor EP + zbIlluminanceSensor.setIlluminance(lsens_illuminance_raw); // use raw illuminance here! + + delay(1000); // reduce delay (in ms), if you want your device to react more quickly to changes in illuminance + } +} + +/********************* Arduino functions **************************/ +void setup() { + Serial.begin(115200); + + // Optional: configure analog input + analogSetAttenuation(ADC_11db); // set analog to digital converter (ADC) attenuation to 11 dB (up to ~3.3V input) + analogReadResolution(12); // set analog read resolution to 12 bits (value range from 0 to 4095), 12 is default + + // Init button for factory reset + pinMode(button, INPUT_PULLUP); + + // Optional: Set Zigbee device name and model + zbIlluminanceSensor.setManufacturerAndModel("Espressif", "ZigbeeIlluminanceSensor"); + + // Optional: Set power source (choose between ZB_POWER_SOURCE_MAINS and ZB_POWER_SOURCE_BATTERY), defaults to unknown + zbIlluminanceSensor.setPowerSource(ZB_POWER_SOURCE_MAINS); + + // Set minimum and maximum for raw illuminance value (0 min and 50000 max equals to 0 lux - 100,000 lux) + zbIlluminanceSensor.setMinMaxValue(0, 50000); + + // Optional: Set tolerance for raw illuminance value + zbIlluminanceSensor.setTolerance(1); + + // Add endpoint to Zigbee Core + Serial.println("Adding Zigbee illuminance sensor endpoint to Zigbee Core"); + Zigbee.addEndpoint(&zbIlluminanceSensor); + + Serial.println("Starting Zigbee..."); + // When all EPs are registered, start Zigbee in End Device mode + if (!Zigbee.begin()) { + Serial.println("Zigbee failed to start!"); + Serial.println("Rebooting..."); + ESP.restart(); + } else { + Serial.println("Zigbee started successfully!"); + } + Serial.println("Connecting to network"); + while (!Zigbee.connected()) { + Serial.print("."); + delay(100); + } + Serial.println(); + + // Start illuminance sensor reading task + xTaskCreate(illuminance_sensor_value_update, "illuminance_sensor_update", 2048, NULL, 10, NULL); + + // Set reporting schedule for illuminance value measurement in seconds, must be called after Zigbee.begin() + // min_interval and max_interval in seconds, delta + // if min = 1 and max = 0, delta = 1000, reporting is sent when raw illuminance value changes by 1000, but at most once per second + // if min = 0 and max = 10, delta = 1000, reporting is sent every 10 seconds or if raw illuminance value changes by 1000 + // if min = 0, max = 10 and delta = 0, reporting is sent every 10 seconds regardless of illuminance change + // Note: On pairing with Zigbee Home Automation or Zigbee2MQTT the reporting schedule will most likely be overwritten with their default settings + zbIlluminanceSensor.setReporting(1, 0, 1000); +} + +/********************* Main loop **************************/ +void loop() { + // Checking button for factory reset + if (digitalRead(button) == LOW) { // Push button pressed + // Key debounce handling + delay(100); + int startTime = millis(); + while (digitalRead(button) == LOW) { + delay(50); + if ((millis() - startTime) > 3000) { + // If key pressed for more than 3 secs, factory reset Zigbee and reboot + Serial.println("Resetting Zigbee to factory and rebooting in 1s"); + delay(1000); + Zigbee.factoryReset(); + } + } + // force report of illuminance when button is pressed + zbIlluminanceSensor.report(); + } + delay(100); +} diff --git a/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/ci.json b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/ci.json new file mode 100644 index 00000000000..ceacc367801 --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/ci.json @@ -0,0 +1,7 @@ +{ + "fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed", + "requires": [ + "CONFIG_SOC_IEEE802154_SUPPORTED=y", + "CONFIG_ZB_ENABLED=y" + ] +} diff --git a/libraries/Zigbee/keywords.txt b/libraries/Zigbee/keywords.txt index 2eeed5878a7..586d2bdc677 100644 --- a/libraries/Zigbee/keywords.txt +++ b/libraries/Zigbee/keywords.txt @@ -29,6 +29,7 @@ ZigbeeGateway KEYWORD1 ZigbeeRangeExtender KEYWORD1 ZigbeeVibrationSensor KEYWORD1 ZigbeeWindowCovering KEYWORD1 +ZigbeeIlluminanceSensor KEYWORD1 # Other zigbee_role_t KEYWORD1 @@ -123,6 +124,9 @@ setHumidity KEYWORD2 setHumidityReporting KEYWORD2 reportHumidity KEYWORD2 +# ZigbeeIlluminanceSensor +setIlluminance KEYWORD2 + # ZigbeeFlowSensor setFlow KEYWORD2 diff --git a/libraries/Zigbee/src/Zigbee.h b/libraries/Zigbee/src/Zigbee.h index e5f669ba899..ea42e9dd41a 100644 --- a/libraries/Zigbee/src/Zigbee.h +++ b/libraries/Zigbee/src/Zigbee.h @@ -18,6 +18,7 @@ #include "ep/ZigbeeAnalog.h" #include "ep/ZigbeeFlowSensor.h" #include "ep/ZigbeeOccupancySensor.h" +#include "ep/ZigbeeIlluminanceSensor.h" #include "ep/ZigbeeCarbonDioxideSensor.h" #include "ep/ZigbeeContactSwitch.h" #include "ep/ZigbeeDoorWindowHandle.h" diff --git a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp new file mode 100644 index 00000000000..d38e9b1065f --- /dev/null +++ b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp @@ -0,0 +1,74 @@ +#include "ZigbeeIlluminanceSensor.h" +#if CONFIG_ZB_ENABLED + +ZigbeeIlluminanceSensor::ZigbeeIlluminanceSensor(uint8_t endpoint) : ZigbeeEP(endpoint) { + _device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID; + + esp_zb_light_sensor_cfg_t light_sensor_cfg = ZIGBEE_DEFAULT_ILLUMINANCE_SENSOR_CONFIG(); + _cluster_list = esp_zb_light_sensor_clusters_create(&light_sensor_cfg); + + _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID, .app_device_version = 0}; +} + +void ZigbeeIlluminanceSensor::setMinMaxValue(uint16_t min, uint16_t max) { + esp_zb_attribute_list_t *light_measure_cluster = + esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&min); + esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&max); +} + +void ZigbeeIlluminanceSensor::setTolerance(uint16_t tolerance) { + esp_zb_attribute_list_t *light_measure_cluster = + esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_illuminance_meas_cluster_add_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); +} + +void ZigbeeIlluminanceSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { + esp_zb_zcl_reporting_info_t reporting_info; + memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); + reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; + reporting_info.ep = _endpoint; + reporting_info.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT; + reporting_info.cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE; + reporting_info.attr_id = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MEASURED_VALUE_ID; + reporting_info.u.send_info.min_interval = min_interval; + reporting_info.u.send_info.max_interval = max_interval; + reporting_info.u.send_info.def_min_interval = min_interval; + reporting_info.u.send_info.def_max_interval = max_interval; + reporting_info.u.send_info.delta.u16 = delta; + reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; + reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + esp_zb_lock_acquire(portMAX_DELAY); + esp_zb_zcl_update_reporting_info(&reporting_info); + esp_zb_lock_release(); +} + +void ZigbeeIlluminanceSensor::setIlluminance(uint16_t illuminanceValue) { + log_v("Updating Illuminance..."); + /* Update illuminance sensor measured illuminance */ + log_d("Setting Illuminance to %d", illuminanceValue); + esp_zb_lock_acquire(portMAX_DELAY); + esp_zb_zcl_set_attribute_val( + _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MEASURED_VALUE_ID, + &illuminanceValue, false + ); + esp_zb_lock_release(); +} + +void ZigbeeIlluminanceSensor::report() { + /* Send report attributes command */ + esp_zb_zcl_report_attr_cmd_t report_attr_cmd; + report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; + report_attr_cmd.attributeID = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MEASURED_VALUE_ID; + report_attr_cmd.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_CLI; + report_attr_cmd.clusterID = ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT; + report_attr_cmd.zcl_basic_cmd.src_endpoint = _endpoint; + report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + + esp_zb_lock_acquire(portMAX_DELAY); + esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_zb_lock_release(); + log_v("Illuminance report sent"); +} + +#endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h new file mode 100644 index 00000000000..9c9d9e3fcaf --- /dev/null +++ b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h @@ -0,0 +1,51 @@ +/* Class of Zigbee Illuminance sensor endpoint inherited from common EP class */ + +#pragma once + +#include "soc/soc_caps.h" +#include "sdkconfig.h" +#if CONFIG_ZB_ENABLED + +#include "ZigbeeEP.h" +#include "ha/esp_zigbee_ha_standard.h" + +#define ZIGBEE_DEFAULT_ILLUMINANCE_SENSOR_CONFIG() \ + { \ + .basic_cfg = \ + { \ + .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \ + .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \ + }, \ + .identify_cfg = \ + { \ + .identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \ + }, \ + .illuminance_cfg = { \ + .measured_value = ESP_ZB_ZCL_ILLUMINANCE_MEASUREMENT_LIGHT_SENSOR_TYPE_DEFAULT_VALUE, \ + .min_value = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MIN_MEASURED_VALUE_MIN_VALUE, \ + .max_value = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MAX_MEASURED_VALUE_MAX_VALUE, \ + }, \ + } + +class ZigbeeIlluminanceSensor : public ZigbeeEP { +public: + ZigbeeIlluminanceSensor(uint8_t endpoint); + ~ZigbeeIlluminanceSensor() {} + + // Set the illuminance value + void setIlluminance(uint16_t value); + + // Set the min and max value for the illuminance sensor + void setMinMaxValue(uint16_t min, uint16_t max); + + // Set the tolerance value for the illuminance sensor + void setTolerance(uint16_t tolerance); + + // Set the reporting interval for illuminance measurement in seconds and delta + void setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); + + // Report the illuminance value + void report(); +}; + +#endif // CONFIG_ZB_ENABLED From 17258930e61a92a25831a25d52f087704419755a Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 27 Mar 2025 13:38:04 +0200 Subject: [PATCH 15/56] fix(wifi_scan): Fix some edge cases where WiFi Scan may fail (#11188) --- libraries/WiFi/src/WiFiScan.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/libraries/WiFi/src/WiFiScan.cpp b/libraries/WiFi/src/WiFiScan.cpp index 27d9edcc70c..086b875fcb2 100644 --- a/libraries/WiFi/src/WiFiScan.cpp +++ b/libraries/WiFi/src/WiFiScan.cpp @@ -92,9 +92,6 @@ int16_t } if (esp_wifi_scan_start(&config, false) == ESP_OK) { _scanStarted = millis(); - if (!_scanStarted) { //Prevent 0 from millis overflow - ++_scanStarted; - } WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT); WiFiGenericClass::setStatusBits(WIFI_SCANNING_BIT); @@ -118,21 +115,20 @@ int16_t void WiFiScanClass::_scanDone() { esp_wifi_scan_get_ap_num(&(WiFiScanClass::_scanCount)); if (WiFiScanClass::_scanResult) { - delete[] reinterpret_cast(WiFiScanClass::_scanResult); - WiFiScanClass::_scanResult = nullptr; + free(WiFiScanClass::_scanResult); + WiFiScanClass::_scanResult = NULL; } if (WiFiScanClass::_scanCount) { - WiFiScanClass::_scanResult = new (std::nothrow) wifi_ap_record_t[WiFiScanClass::_scanCount]; + WiFiScanClass::_scanResult = calloc(WiFiScanClass::_scanCount, sizeof(wifi_ap_record_t)); if (!WiFiScanClass::_scanResult) { WiFiScanClass::_scanCount = 0; } else if (esp_wifi_scan_get_ap_records(&(WiFiScanClass::_scanCount), (wifi_ap_record_t *)_scanResult) != ESP_OK) { - delete[] reinterpret_cast(WiFiScanClass::_scanResult); - WiFiScanClass::_scanResult = nullptr; + free(WiFiScanClass::_scanResult); + WiFiScanClass::_scanResult = NULL; WiFiScanClass::_scanCount = 0; } } - WiFiScanClass::_scanStarted = 0; //Reset after a scan is completed for normal behavior WiFiGenericClass::setStatusBits(WIFI_SCAN_DONE_BIT); WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); } @@ -161,15 +157,13 @@ int16_t WiFiScanClass::scanComplete() { } if (WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) { + // Check if the delay expired, return WIFI_SCAN_FAILED in this case + if ((millis() - WiFiScanClass::_scanStarted) > WiFiScanClass::_scanTimeout) { + WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); + return WIFI_SCAN_FAILED; + } return WIFI_SCAN_RUNNING; } - // last one to avoid time affecting Async mode - if (WiFiScanClass::_scanStarted - && (millis() - WiFiScanClass::_scanStarted) - > WiFiScanClass::_scanTimeout) { //Check is scan was started and if the delay expired, return WIFI_SCAN_FAILED in this case - WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); - return WIFI_SCAN_FAILED; - } return WIFI_SCAN_FAILED; } @@ -179,11 +173,12 @@ int16_t WiFiScanClass::scanComplete() { */ void WiFiScanClass::scanDelete() { WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT); + WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT); if (WiFiScanClass::_scanResult) { - delete[] reinterpret_cast(WiFiScanClass::_scanResult); - WiFiScanClass::_scanResult = nullptr; - WiFiScanClass::_scanCount = 0; + free(WiFiScanClass::_scanResult); + WiFiScanClass::_scanResult = NULL; } + WiFiScanClass::_scanCount = 0; } /** From bbaabb183a11d072cec64abf4fe2f22315cb95df Mon Sep 17 00:00:00 2001 From: SooDragon <82627949+SooDragon@users.noreply.github.com> Date: Thu, 27 Mar 2025 21:52:32 +0900 Subject: [PATCH 16/56] fix: Geekble Nano board setup update (#11131) * Geekble Nano board setup update Geekble Nano board setup update * fix: erase Comment Line fix: erase Comment Line * revert re-naming revert re-naming --- boards.txt | 90 +++++------------------------------------------------- 1 file changed, 8 insertions(+), 82 deletions(-) diff --git a/boards.txt b/boards.txt index 661d1f7a990..9190ee03a63 100644 --- a/boards.txt +++ b/boards.txt @@ -40874,8 +40874,8 @@ Geekble_Nano_ESP32S3.upload.tool.default=esptool_py Geekble_Nano_ESP32S3.upload.tool.network=esp_ota Geekble_Nano_ESP32S3.upload.maximum_size=1310720 - Geekble_Nano_ESP32S3.upload.maximum_data_size=327680 +Geekble_Nano_ESP32S3.upload.speed=921600 Geekble_Nano_ESP32S3.upload.flags= Geekble_Nano_ESP32S3.upload.extra_flags= Geekble_Nano_ESP32S3.upload.use_1200bps_touch=false @@ -40901,61 +40901,18 @@ Geekble_Nano_ESP32S3.build.flash_size=4MB Geekble_Nano_ESP32S3.build.flash_freq=80m Geekble_Nano_ESP32S3.build.flash_mode=dio Geekble_Nano_ESP32S3.build.boot=qio -Geekble_Nano_ESP32S3.build.boot_freq=80m Geekble_Nano_ESP32S3.build.partitions=default Geekble_Nano_ESP32S3.build.defines= -Geekble_Nano_ESP32S3.build.loop_core= -Geekble_Nano_ESP32S3.build.event_core= -Geekble_Nano_ESP32S3.build.psram_type=qspi -Geekble_Nano_ESP32S3.build.memory_type={build.boot}_{build.psram_type} - -Geekble_Nano_ESP32S3.menu.PSRAM.disabled=Disabled -Geekble_Nano_ESP32S3.menu.PSRAM.disabled.build.defines= -Geekble_Nano_ESP32S3.menu.PSRAM.disabled.build.psram_type=qspi -Geekble_Nano_ESP32S3.menu.PSRAM.enabled=Enabled -Geekble_Nano_ESP32S3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -Geekble_Nano_ESP32S3.menu.PSRAM.enabled.build.psram_type=qspi - -Geekble_Nano_ESP32S3.menu.FlashMode.qio=QIO 80MHz -Geekble_Nano_ESP32S3.menu.FlashMode.qio.build.flash_mode=dio -Geekble_Nano_ESP32S3.menu.FlashMode.qio.build.boot=qio -Geekble_Nano_ESP32S3.menu.FlashMode.qio.build.boot_freq=80m -Geekble_Nano_ESP32S3.menu.FlashMode.qio.build.flash_freq=80m -Geekble_Nano_ESP32S3.menu.FlashMode.qio120=QIO 120MHz -Geekble_Nano_ESP32S3.menu.FlashMode.qio120.build.flash_mode=dio -Geekble_Nano_ESP32S3.menu.FlashMode.qio120.build.boot=qio -Geekble_Nano_ESP32S3.menu.FlashMode.qio120.build.boot_freq=120m -Geekble_Nano_ESP32S3.menu.FlashMode.qio120.build.flash_freq=80m - -Geekble_Nano_ESP32S3.menu.LoopCore.1=Core 1 -Geekble_Nano_ESP32S3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 -Geekble_Nano_ESP32S3.menu.LoopCore.0=Core 0 -Geekble_Nano_ESP32S3.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 - -Geekble_Nano_ESP32S3.menu.EventsCore.1=Core 1 -Geekble_Nano_ESP32S3.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 -Geekble_Nano_ESP32S3.menu.EventsCore.0=Core 0 -Geekble_Nano_ESP32S3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 +Geekble_Nano_ESP32S3.build.memory_type=qio_qspi +Geekble_Nano_ESP32S3.build.loop_core=-DARDUINO_RUNNING_CORE=1 +Geekble_Nano_ESP32S3.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 -Geekble_Nano_ESP32S3.menu.USBMode.hwcdc=Hardware CDC and JTAG -Geekble_Nano_ESP32S3.menu.USBMode.hwcdc.build.usb_mode=1 Geekble_Nano_ESP32S3.menu.USBMode.default=USB-OTG (TinyUSB) Geekble_Nano_ESP32S3.menu.USBMode.default.build.usb_mode=0 - -Geekble_Nano_ESP32S3.menu.CDCOnBoot.default=Disabled -Geekble_Nano_ESP32S3.menu.CDCOnBoot.default.build.cdc_on_boot=0 -Geekble_Nano_ESP32S3.menu.CDCOnBoot.cdc=Enabled -Geekble_Nano_ESP32S3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 - -Geekble_Nano_ESP32S3.menu.MSCOnBoot.default=Disabled -Geekble_Nano_ESP32S3.menu.MSCOnBoot.default.build.msc_on_boot=0 -Geekble_Nano_ESP32S3.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) -Geekble_Nano_ESP32S3.menu.MSCOnBoot.msc.build.msc_on_boot=1 - -Geekble_Nano_ESP32S3.menu.DFUOnBoot.default=Disabled -Geekble_Nano_ESP32S3.menu.DFUOnBoot.default.build.dfu_on_boot=0 -Geekble_Nano_ESP32S3.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) -Geekble_Nano_ESP32S3.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 +Geekble_Nano_ESP32S3.menu.USBMode.default.build.cdc_on_boot=1 +Geekble_Nano_ESP32S3.menu.USBMode.hwcdc=Hardware CDC and JTAG +Geekble_Nano_ESP32S3.menu.USBMode.hwcdc.build.usb_mode=1 +Geekble_Nano_ESP32S3.menu.USBMode.hwcdc.build.cdc_on_boot=1 Geekble_Nano_ESP32S3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) Geekble_Nano_ESP32S3.menu.UploadMode.cdc.upload.use_1200bps_touch=true @@ -40989,46 +40946,16 @@ Geekble_Nano_ESP32S3.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 Geekble_Nano_ESP32S3.menu.PartitionScheme.rainmaker_4MB=RainMaker 4MB No OTA Geekble_Nano_ESP32S3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota Geekble_Nano_ESP32S3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 - Geekble_Nano_ESP32S3.menu.PartitionScheme.otanofs=OTA no FS (2MB APP with OTA) Geekble_Nano_ESP32S3.menu.PartitionScheme.otanofs.build.custom_partitions=ota_nofs_4MB Geekble_Nano_ESP32S3.menu.PartitionScheme.otanofs.upload.maximum_size=2031616 Geekble_Nano_ESP32S3.menu.PartitionScheme.all_app=Max APP (4MB APP no OTA) Geekble_Nano_ESP32S3.menu.PartitionScheme.all_app.build.custom_partitions=max_app_4MB Geekble_Nano_ESP32S3.menu.PartitionScheme.all_app.upload.maximum_size=4063232 - Geekble_Nano_ESP32S3.menu.PartitionScheme.custom=Custom Geekble_Nano_ESP32S3.menu.PartitionScheme.custom.build.partitions= Geekble_Nano_ESP32S3.menu.PartitionScheme.custom.upload.maximum_size=16777216 -Geekble_Nano_ESP32S3.menu.CPUFreq.240=240MHz (WiFi) -Geekble_Nano_ESP32S3.menu.CPUFreq.240.build.f_cpu=240000000L -Geekble_Nano_ESP32S3.menu.CPUFreq.160=160MHz (WiFi) -Geekble_Nano_ESP32S3.menu.CPUFreq.160.build.f_cpu=160000000L -Geekble_Nano_ESP32S3.menu.CPUFreq.80=80MHz (WiFi) -Geekble_Nano_ESP32S3.menu.CPUFreq.80.build.f_cpu=80000000L -Geekble_Nano_ESP32S3.menu.CPUFreq.40=40MHz -Geekble_Nano_ESP32S3.menu.CPUFreq.40.build.f_cpu=40000000L -Geekble_Nano_ESP32S3.menu.CPUFreq.20=20MHz -Geekble_Nano_ESP32S3.menu.CPUFreq.20.build.f_cpu=20000000L -Geekble_Nano_ESP32S3.menu.CPUFreq.10=10MHz -Geekble_Nano_ESP32S3.menu.CPUFreq.10.build.f_cpu=10000000L - -Geekble_Nano_ESP32S3.menu.UploadSpeed.921600=921600 -Geekble_Nano_ESP32S3.menu.UploadSpeed.921600.upload.speed=921600 -Geekble_Nano_ESP32S3.menu.UploadSpeed.115200=115200 -Geekble_Nano_ESP32S3.menu.UploadSpeed.115200.upload.speed=115200 -Geekble_Nano_ESP32S3.menu.UploadSpeed.256000.windows=256000 -Geekble_Nano_ESP32S3.menu.UploadSpeed.256000.upload.speed=256000 -Geekble_Nano_ESP32S3.menu.UploadSpeed.230400.windows.upload.speed=256000 -Geekble_Nano_ESP32S3.menu.UploadSpeed.230400=230400 -Geekble_Nano_ESP32S3.menu.UploadSpeed.230400.upload.speed=230400 -Geekble_Nano_ESP32S3.menu.UploadSpeed.460800.linux=460800 -Geekble_Nano_ESP32S3.menu.UploadSpeed.460800.macosx=460800 -Geekble_Nano_ESP32S3.menu.UploadSpeed.460800.upload.speed=460800 -Geekble_Nano_ESP32S3.menu.UploadSpeed.512000.windows=512000 -Geekble_Nano_ESP32S3.menu.UploadSpeed.512000.upload.speed=512000 - Geekble_Nano_ESP32S3.menu.DebugLevel.none=None Geekble_Nano_ESP32S3.menu.DebugLevel.none.build.code_debug=0 Geekble_Nano_ESP32S3.menu.DebugLevel.error=Error @@ -41047,7 +40974,6 @@ Geekble_Nano_ESP32S3.menu.EraseFlash.none.upload.erase_cmd= Geekble_Nano_ESP32S3.menu.EraseFlash.all=Enabled Geekble_Nano_ESP32S3.menu.EraseFlash.all.upload.erase_cmd=-e - ############################################################## waveshare_esp32_s3_zero.name=Waveshare ESP32-S3-Zero From a3b6fe61ba39fccf8770a0bdf06243377c907702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 27 Mar 2025 21:13:48 +0100 Subject: [PATCH 17/56] feat(zigbee): Add check, boolean returns, fix Analog, add optional reset on factoryReset (#11153) * feat(zigbee): Add checks on setting attrs and commands * feat(zigbee): Add error info in the logs * fix(zigbee): Fix memory leak, print esp_zb_zcl_status_t error, remove analogValue from analog EP * feat(example): Update factoryResetoption in sleepy example * fix(zigbee): Add error checks to Illuminance EP * fix(zigbee): Return false on first error hit * fix(zigbee): Apply same formatting on all returns * fix(zigbee): Add check when adding a OTA cluster * fix(zigbee): release locks before returning * fix(zigbee): use correct return in doorWindowHandle * fix/zigbee): Add missing return in WindowCovering * fix(zigbee): Added a note of future task * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../Zigbee_Temp_Hum_Sensor_Sleepy.ino | 6 +- libraries/Zigbee/src/ZigbeeCore.cpp | 29 ++- libraries/Zigbee/src/ZigbeeCore.h | 4 +- libraries/Zigbee/src/ZigbeeEP.cpp | 220 ++++++++++++++---- libraries/Zigbee/src/ZigbeeEP.h | 24 +- libraries/Zigbee/src/ep/ZigbeeAnalog.cpp | 84 ++++--- libraries/Zigbee/src/ep/ZigbeeAnalog.h | 37 +-- .../src/ep/ZigbeeCarbonDioxideSensor.cpp | 52 ++++- .../Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h | 10 +- .../src/ep/ZigbeeColorDimmableLight.cpp | 69 ++++-- .../Zigbee/src/ep/ZigbeeColorDimmableLight.h | 12 +- .../Zigbee/src/ep/ZigbeeContactSwitch.cpp | 31 ++- libraries/Zigbee/src/ep/ZigbeeContactSwitch.h | 6 +- .../Zigbee/src/ep/ZigbeeDimmableLight.cpp | 26 ++- libraries/Zigbee/src/ep/ZigbeeDimmableLight.h | 7 +- .../Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp | 39 +++- .../Zigbee/src/ep/ZigbeeDoorWindowHandle.h | 8 +- libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp | 58 ++++- libraries/Zigbee/src/ep/ZigbeeFlowSensor.h | 10 +- .../Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp | 54 ++++- .../Zigbee/src/ep/ZigbeeIlluminanceSensor.h | 10 +- libraries/Zigbee/src/ep/ZigbeeLight.cpp | 11 +- libraries/Zigbee/src/ep/ZigbeeLight.h | 2 +- .../Zigbee/src/ep/ZigbeeOccupancySensor.cpp | 34 ++- .../Zigbee/src/ep/ZigbeeOccupancySensor.h | 6 +- .../Zigbee/src/ep/ZigbeePressureSensor.cpp | 52 ++++- .../Zigbee/src/ep/ZigbeePressureSensor.h | 10 +- libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp | 88 +++++-- libraries/Zigbee/src/ep/ZigbeeTempSensor.h | 18 +- .../Zigbee/src/ep/ZigbeeVibrationSensor.cpp | 11 +- .../Zigbee/src/ep/ZigbeeVibrationSensor.h | 2 +- .../Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp | 54 ++++- .../Zigbee/src/ep/ZigbeeWindSpeedSensor.h | 10 +- .../Zigbee/src/ep/ZigbeeWindowCovering.cpp | 156 ++++++++++--- .../Zigbee/src/ep/ZigbeeWindowCovering.h | 16 +- 35 files changed, 889 insertions(+), 377 deletions(-) diff --git a/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino b/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino index 0bfbad1fe95..3eefd973dd2 100644 --- a/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino +++ b/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino @@ -133,7 +133,11 @@ void loop() { // If key pressed for more than 10secs, factory reset Zigbee and reboot Serial.println("Resetting Zigbee to factory and rebooting in 1s."); delay(1000); - Zigbee.factoryReset(); + // Optional set reset in factoryReset to false, to not restart device after erasing nvram, but set it to endless sleep manually instead + Zigbee.factoryReset(false); + Serial.println("Going to endless sleep, press RESET button or power off/on the device to wake up"); + esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER); + esp_deep_sleep_start(); } } } diff --git a/libraries/Zigbee/src/ZigbeeCore.cpp b/libraries/Zigbee/src/ZigbeeCore.cpp index 2200aec2662..b93542159a6 100644 --- a/libraries/Zigbee/src/ZigbeeCore.cpp +++ b/libraries/Zigbee/src/ZigbeeCore.cpp @@ -91,21 +91,26 @@ bool ZigbeeCore::begin(zigbee_role_t role, bool erase_nvs) { return started(); } -void ZigbeeCore::addEndpoint(ZigbeeEP *ep) { +bool ZigbeeCore::addEndpoint(ZigbeeEP *ep) { ep_objects.push_back(ep); log_d("Endpoint: %d, Device ID: 0x%04x", ep->_endpoint, ep->_device_id); //Register clusters and ep_list to the ZigbeeCore class's ep_list if (ep->_ep_config.endpoint == 0 || ep->_cluster_list == nullptr) { log_e("Endpoint config or Cluster list is not initialized, EP not added to ZigbeeCore's EP list"); - return; + return false; } - + esp_err_t ret = ESP_OK; if (ep->_device_id == ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID) { - esp_zb_ep_list_add_gateway_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config); + ret = esp_zb_ep_list_add_gateway_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config); } else { - esp_zb_ep_list_add_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config); + ret = esp_zb_ep_list_add_ep(_zb_ep_list, ep->_cluster_list, ep->_ep_config); + } + if (ret != ESP_OK) { + log_e("Failed to add endpoint: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; } + return true; } static void esp_zb_task(void *pvParameters) { @@ -368,16 +373,22 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) { case ESP_ZB_ZDO_SIGNAL_LEAVE: // End Device + Router // Device was removed from the network, factory reset the device if ((zigbee_role_t)Zigbee.getRole() != ZIGBEE_COORDINATOR) { - Zigbee.factoryReset(); + Zigbee.factoryReset(true); } break; default: log_v("ZDO signal: %s (0x%x), status: %s", esp_zb_zdo_signal_to_string(sig_type), sig_type, esp_err_to_name(err_status)); break; } } -void ZigbeeCore::factoryReset() { - log_v("Factory resetting Zigbee stack, device will reboot"); - esp_zb_factory_reset(); +void ZigbeeCore::factoryReset(bool restart) { + if (restart) { + log_v("Factory resetting Zigbee stack, device will reboot"); + esp_zb_factory_reset(); + } else { + log_v("Factory resetting Zigbee NVRAM to factory default"); + log_w("The device will not reboot, to take effect please reboot the device manually"); + esp_zb_zcl_reset_nvram_to_factory_default(); + } } void ZigbeeCore::scanCompleteCallback(esp_zb_zdp_status_t zdo_status, uint8_t count, esp_zb_network_descriptor_t *nwk_descriptor) { diff --git a/libraries/Zigbee/src/ZigbeeCore.h b/libraries/Zigbee/src/ZigbeeCore.h index 018f701d6e0..06c3ec4551a 100644 --- a/libraries/Zigbee/src/ZigbeeCore.h +++ b/libraries/Zigbee/src/ZigbeeCore.h @@ -129,7 +129,7 @@ class ZigbeeCore { return _role; } - void addEndpoint(ZigbeeEP *ep); + bool addEndpoint(ZigbeeEP *ep); //void removeEndpoint(ZigbeeEP *ep); void setRadioConfig(esp_zb_radio_config_t config); @@ -164,7 +164,7 @@ class ZigbeeCore { zigbee_scan_result_t *getScanResult(); void scanDelete(); - void factoryReset(); + void factoryReset(bool restart = true); // Friend function declaration to allow access to private members friend void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct); diff --git a/libraries/Zigbee/src/ZigbeeEP.cpp b/libraries/Zigbee/src/ZigbeeEP.cpp index 7052a558192..e7d507dc441 100644 --- a/libraries/Zigbee/src/ZigbeeEP.cpp +++ b/libraries/Zigbee/src/ZigbeeEP.cpp @@ -32,71 +32,95 @@ void ZigbeeEP::setVersion(uint8_t version) { _ep_config.app_device_version = version; } -void ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { +bool ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { // Convert manufacturer to ZCL string - size_t length = strlen(name); - if (length > 32) { - log_e("Manufacturer name is too long"); - return; + size_t name_length = strlen(name); + size_t model_length = strlen(model); + if (name_length > 32 || model_length > 32) { + log_e("Manufacturer or model name is too long"); + return false; } // Allocate a new array of size length + 2 (1 for the length, 1 for null terminator) - char *zb_name = new char[length + 2]; + char *zb_name = new char[name_length + 2]; + char *zb_model = new char[model_length + 2]; // Store the length as the first element - zb_name[0] = static_cast(length); // Cast size_t to char + zb_name[0] = static_cast(name_length); // Cast size_t to char + zb_model[0] = static_cast(model_length); // Use memcpy to copy the characters to the result array - memcpy(zb_name + 1, name, length); + memcpy(zb_name + 1, name, name_length); + memcpy(zb_model + 1, model, model_length); // Null-terminate the array - zb_name[length + 1] = '\0'; - - // Convert model to ZCL string - length = strlen(model); - if (length > 32) { - log_e("Model name is too long"); - delete[] zb_name; - return; - } - char *zb_model = new char[length + 2]; - zb_model[0] = static_cast(length); - memcpy(zb_model + 1, model, length); - zb_model[length + 1] = '\0'; + zb_name[name_length + 1] = '\0'; + zb_model[model_length + 1] = '\0'; // Get the basic cluster and update the manufacturer and model attributes esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, (void *)zb_name); - esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, (void *)zb_model); + esp_err_t ret_name = esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, (void *)zb_name); + if (ret_name != ESP_OK) { + log_e("Failed to set manufacturer: 0x%x: %s", ret_name, esp_err_to_name(ret_name)); + } + esp_err_t ret_model = esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, (void *)zb_model); + if (ret_model != ESP_OK) { + log_e("Failed to set model: 0x%x: %s", ret_model, esp_err_to_name(ret_model)); + } + delete[] zb_name; + delete[] zb_model; + return ret_name == ESP_OK && ret_model == ESP_OK; } -void ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_percentage) { +bool ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_percentage) { esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, (void *)&power_source); + esp_err_t ret = esp_zb_cluster_update_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, (void *)&power_source); + if (ret != ESP_OK) { + log_e("Failed to set power source: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } if (power_source == ZB_POWER_SOURCE_BATTERY) { // Add power config cluster and battery percentage attribute + if (battery_percentage > 100) { + battery_percentage = 100; + } battery_percentage = battery_percentage * 2; esp_zb_attribute_list_t *power_config_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG); - esp_zb_power_config_cluster_add_attr(power_config_cluster, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID, (void *)&battery_percentage); - esp_zb_cluster_list_add_power_config_cluster(_cluster_list, power_config_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + ret = esp_zb_power_config_cluster_add_attr(power_config_cluster, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID, (void *)&battery_percentage); + if (ret != ESP_OK) { + log_e("Failed to add battery percentage attribute: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_list_add_power_config_cluster(_cluster_list, power_config_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add power config cluster: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } } _power_source = power_source; + return true; } -void ZigbeeEP::setBatteryPercentage(uint8_t percentage) { +bool ZigbeeEP::setBatteryPercentage(uint8_t percentage) { // 100% = 200 in decimal, 0% = 0 // Convert percentage to 0-200 range + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; if (percentage > 100) { percentage = 100; } percentage = percentage * 2; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID, &percentage, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set battery percentage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } log_v("Battery percentage updated"); + return true; } -void ZigbeeEP::reportBatteryPercentage() { +bool ZigbeeEP::reportBatteryPercentage() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -107,9 +131,14 @@ void ZigbeeEP::reportBatteryPercentage() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to report battery percentage: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Battery percentage reported"); + return true; } char *ZigbeeEP::readManufacturer(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_addr_t ieee_addr) { @@ -134,7 +163,9 @@ char *ZigbeeEP::readManufacturer(uint8_t endpoint, uint16_t short_addr, esp_zb_i read_req.attr_number = ZB_ARRAY_LENTH(attributes); read_req.attr_field = attributes; - // clear read manufacturer + if (_read_manufacturer != nullptr) { + free(_read_manufacturer); + } _read_manufacturer = nullptr; esp_zb_lock_acquire(portMAX_DELAY); @@ -170,7 +201,9 @@ char *ZigbeeEP::readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_add read_req.attr_number = ZB_ARRAY_LENTH(attributes); read_req.attr_field = attributes; - // clear read model + if (_read_model != nullptr) { + free(_read_model); + } _read_model = nullptr; esp_zb_lock_acquire(portMAX_DELAY); @@ -240,7 +273,7 @@ void ZigbeeEP::zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message) { } } -void ZigbeeEP::addTimeCluster(tm time, int32_t gmt_offset) { +bool ZigbeeEP::addTimeCluster(tm time, int32_t gmt_offset) { time_t utc_time = 0; // Check if time is set if (time.tm_year > 0) { @@ -250,28 +283,63 @@ void ZigbeeEP::addTimeCluster(tm time, int32_t gmt_offset) { // Create time cluster server attributes esp_zb_attribute_list_t *time_cluster_server = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_TIME); - esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID, (void *)&gmt_offset); - esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_ID, (void *)&utc_time); - esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_STATUS_ID, (void *)&_time_status); + esp_err_t ret = esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID, (void *)&gmt_offset); + if (ret != ESP_OK) { + log_e("Failed to add time zone attribute: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_ID, (void *)&utc_time); + if (ret != ESP_OK) { + log_e("Failed to add time attribute: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_time_cluster_add_attr(time_cluster_server, ESP_ZB_ZCL_ATTR_TIME_TIME_STATUS_ID, (void *)&_time_status); + if (ret != ESP_OK) { + log_e("Failed to add time status attribute: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } // Create time cluster client attributes esp_zb_attribute_list_t *time_cluster_client = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_TIME); // Add time clusters to cluster list - esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_server, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_client, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); + ret = esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_server, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add time cluster (server role): 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_list_add_time_cluster(_cluster_list, time_cluster_client, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add time cluster (client role): 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeEP::setTime(tm time) { +bool ZigbeeEP::setTime(tm time) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; time_t utc_time = mktime(&time); log_d("Setting time to %lld", utc_time); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_ID, &utc_time, false); + ret = esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_ID, &utc_time, false); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set time: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeEP::setTimezone(int32_t gmt_offset) { +bool ZigbeeEP::setTimezone(int32_t gmt_offset) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; + log_d("Setting timezone to %d", gmt_offset); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID, &gmt_offset, false); + ret = + esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_TIME, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID, &gmt_offset, false); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set timezone: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } tm ZigbeeEP::getTime(uint8_t endpoint, int32_t short_addr, esp_zb_ieee_addr_t ieee_addr) { @@ -390,7 +458,7 @@ void ZigbeeEP::zbReadTimeCluster(const esp_zb_zcl_attribute_t *attribute) { // uint8_t max_data_size; /*!< The maximum size of OTA data */ // } esp_zb_zcl_ota_upgrade_client_variable_t; -void ZigbeeEP::addOTAClient( +bool ZigbeeEP::addOTAClient( uint32_t file_version, uint32_t downloaded_file_ver, uint16_t hw_version, uint16_t manufacturer, uint16_t image_type, uint8_t max_data_size ) { @@ -410,11 +478,27 @@ void ZigbeeEP::addOTAClient( uint16_t ota_upgrade_server_addr = 0xffff; uint8_t ota_upgrade_server_ep = 0xff; - ESP_ERROR_CHECK(esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_CLIENT_DATA_ID, (void *)&variable_config)); - ESP_ERROR_CHECK(esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ADDR_ID, (void *)&ota_upgrade_server_addr)); - ESP_ERROR_CHECK(esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ENDPOINT_ID, (void *)&ota_upgrade_server_ep)); - - ESP_ERROR_CHECK(esp_zb_cluster_list_add_ota_cluster(_cluster_list, ota_cluster, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE)); + esp_err_t ret = esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_CLIENT_DATA_ID, (void *)&variable_config); + if (ret != ESP_OK) { + log_e("Failed to add OTA client data: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ADDR_ID, (void *)&ota_upgrade_server_addr); + if (ret != ESP_OK) { + log_e("Failed to add OTA server address: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_ota_cluster_add_attr(ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ENDPOINT_ID, (void *)&ota_upgrade_server_ep); + if (ret != ESP_OK) { + log_e("Failed to add OTA server endpoint: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_list_add_ota_cluster(_cluster_list, ota_cluster, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add OTA cluster: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } static void findOTAServer(esp_zb_zdp_status_t zdo_status, uint16_t addr, uint8_t endpoint, void *user_ctx) { @@ -445,4 +529,42 @@ void ZigbeeEP::requestOTAUpdate() { esp_zb_lock_release(); } +const char *ZigbeeEP::esp_zb_zcl_status_to_name(esp_zb_zcl_status_t status) { + switch (status) { + case ESP_ZB_ZCL_STATUS_SUCCESS: return "Success"; + case ESP_ZB_ZCL_STATUS_FAIL: return "Fail"; + case ESP_ZB_ZCL_STATUS_NOT_AUTHORIZED: return "Not authorized"; + case ESP_ZB_ZCL_STATUS_MALFORMED_CMD: return "Malformed command"; + case ESP_ZB_ZCL_STATUS_UNSUP_CLUST_CMD: return "Unsupported cluster command"; + case ESP_ZB_ZCL_STATUS_UNSUP_GEN_CMD: return "Unsupported general command"; + case ESP_ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD: return "Unsupported manufacturer cluster command"; + case ESP_ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD: return "Unsupported manufacturer general command"; + case ESP_ZB_ZCL_STATUS_INVALID_FIELD: return "Invalid field"; + case ESP_ZB_ZCL_STATUS_UNSUP_ATTRIB: return "Unsupported attribute"; + case ESP_ZB_ZCL_STATUS_INVALID_VALUE: return "Invalid value"; + case ESP_ZB_ZCL_STATUS_READ_ONLY: return "Read only"; + case ESP_ZB_ZCL_STATUS_INSUFF_SPACE: return "Insufficient space"; + case ESP_ZB_ZCL_STATUS_DUPE_EXISTS: return "Duplicate exists"; + case ESP_ZB_ZCL_STATUS_NOT_FOUND: return "Not found"; + case ESP_ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB: return "Unreportable attribute"; + case ESP_ZB_ZCL_STATUS_INVALID_TYPE: return "Invalid type"; + case ESP_ZB_ZCL_STATUS_WRITE_ONLY: return "Write only"; + case ESP_ZB_ZCL_STATUS_INCONSISTENT: return "Inconsistent"; + case ESP_ZB_ZCL_STATUS_ACTION_DENIED: return "Action denied"; + case ESP_ZB_ZCL_STATUS_TIMEOUT: return "Timeout"; + case ESP_ZB_ZCL_STATUS_ABORT: return "Abort"; + case ESP_ZB_ZCL_STATUS_INVALID_IMAGE: return "Invalid OTA upgrade image"; + case ESP_ZB_ZCL_STATUS_WAIT_FOR_DATA: return "Server does not have data block available yet"; + case ESP_ZB_ZCL_STATUS_NO_IMAGE_AVAILABLE: return "No image available"; + case ESP_ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE: return "Require more image"; + case ESP_ZB_ZCL_STATUS_NOTIFICATION_PENDING: return "Notification pending"; + case ESP_ZB_ZCL_STATUS_HW_FAIL: return "Hardware failure"; + case ESP_ZB_ZCL_STATUS_SW_FAIL: return "Software failure"; + case ESP_ZB_ZCL_STATUS_CALIB_ERR: return "Calibration error"; + case ESP_ZB_ZCL_STATUS_UNSUP_CLUST: return "Cluster is not found on the target endpoint"; + case ESP_ZB_ZCL_STATUS_LIMIT_REACHED: return "Limit reached"; + default: return "Unknown status"; + } +} + #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ZigbeeEP.h b/libraries/Zigbee/src/ZigbeeEP.h index 0a4e3e9d252..bd142344929 100644 --- a/libraries/Zigbee/src/ZigbeeEP.h +++ b/libraries/Zigbee/src/ZigbeeEP.h @@ -70,21 +70,21 @@ class ZigbeeEP { } // Set Manufacturer name and model - void setManufacturerAndModel(const char *name, const char *model); + bool setManufacturerAndModel(const char *name, const char *model); // Methods to read manufacturer and model name from selected endpoint and short address char *readManufacturer(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_addr_t ieee_addr); char *readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_addr_t ieee_addr); // Set Power source and battery percentage for battery powered devices - void setPowerSource(zb_power_source_t power_source, uint8_t percentage = 255); - void setBatteryPercentage(uint8_t percentage); - void reportBatteryPercentage(); + bool setPowerSource(zb_power_source_t power_source, uint8_t percentage = 255); + bool setBatteryPercentage(uint8_t percentage); + bool reportBatteryPercentage(); // Set time - void addTimeCluster(tm time = {}, int32_t gmt_offset = 0); // gmt offset in seconds - void setTime(tm time); - void setTimezone(int32_t gmt_offset); + bool addTimeCluster(tm time = {}, int32_t gmt_offset = 0); // gmt offset in seconds + bool setTime(tm time); + bool setTimezone(int32_t gmt_offset); // Get time from Coordinator or specific endpoint (blocking until response) struct tm getTime(uint8_t endpoint = 1, int32_t short_addr = 0x0000, esp_zb_ieee_addr_t ieee_addr = {0}); @@ -104,8 +104,9 @@ class ZigbeeEP { * @param manufacturer The manufacturer code (default: 0x1001). * @param image_type The image type code (default: 0x1011). * @param max_data_size The maximum data size for OTA transfer (default and recommended: 223). + * @return true if the OTA client was added successfully, false otherwise. */ - void addOTAClient( + bool addOTAClient( uint32_t file_version, uint32_t downloaded_file_ver, uint16_t hw_version, uint16_t manufacturer = 0x1001, uint16_t image_type = 0x1011, uint8_t max_data_size = 223 ); @@ -114,10 +115,10 @@ class ZigbeeEP { */ void requestOTAUpdate(); - // findEndpoind may be implemented by EPs to find and bind devices + // findEndpoint may be implemented by EPs to find and bind devices virtual void findEndpoint(esp_zb_zdo_match_desc_req_param_t *cmd_req) {}; - //list of all handlers function calls, to be override by EPs implementation + // list of all handlers function calls, to be override by EPs implementation virtual void zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {}; virtual void zbAttributeRead(uint16_t cluster_id, const esp_zb_zcl_attribute_t *attribute) {}; virtual void zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute); //already implemented @@ -144,6 +145,9 @@ class ZigbeeEP { int32_t _read_timezone; protected: + // Convert ZCL status to name + const char *esp_zb_zcl_status_to_name(esp_zb_zcl_status_t status); + uint8_t _endpoint; esp_zb_ha_standard_devices_t _device_id; esp_zb_endpoint_config_t _ep_config; diff --git a/libraries/Zigbee/src/ep/ZigbeeAnalog.cpp b/libraries/Zigbee/src/ep/ZigbeeAnalog.cpp index 417eeb6d98c..a95668b7afe 100644 --- a/libraries/Zigbee/src/ep/ZigbeeAnalog.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeAnalog.cpp @@ -1,38 +1,35 @@ #include "ZigbeeAnalog.h" #if CONFIG_ZB_ENABLED -esp_zb_cluster_list_t *zigbee_analog_clusters_create(zigbee_analog_cfg_t *analog_sensor) { - esp_zb_basic_cluster_cfg_t *basic_cfg = analog_sensor ? &(analog_sensor->basic_cfg) : NULL; - esp_zb_identify_cluster_cfg_t *identify_cfg = analog_sensor ? &(analog_sensor->identify_cfg) : NULL; - esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create(); - esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - return cluster_list; -} - ZigbeeAnalog::ZigbeeAnalog(uint8_t endpoint) : ZigbeeEP(endpoint) { _device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID; - //Create custom analog sensor configuration - zigbee_analog_cfg_t analog_cfg = ZIGBEE_DEFAULT_ANALOG_CONFIG(); - _cluster_list = zigbee_analog_clusters_create(&analog_cfg); + //Create basic analog sensor clusters without configuration + _cluster_list = esp_zb_zcl_cluster_list_create(); + esp_zb_cluster_list_add_basic_cluster(_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_list_add_identify_cluster(_cluster_list, esp_zb_identify_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeeAnalog::addAnalogValue() { - esp_zb_cluster_list_add_analog_value_cluster(_cluster_list, esp_zb_analog_value_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - _analog_clusters |= ANALOG_VALUE; -} - -void ZigbeeAnalog::addAnalogInput() { - esp_zb_cluster_list_add_analog_input_cluster(_cluster_list, esp_zb_analog_input_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); +bool ZigbeeAnalog::addAnalogInput() { + esp_err_t ret = esp_zb_cluster_list_add_analog_input_cluster(_cluster_list, esp_zb_analog_input_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add Analog Input cluster: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } _analog_clusters |= ANALOG_INPUT; + return true; } -void ZigbeeAnalog::addAnalogOutput() { - esp_zb_cluster_list_add_analog_output_cluster(_cluster_list, esp_zb_analog_output_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); +bool ZigbeeAnalog::addAnalogOutput() { + esp_err_t ret = esp_zb_cluster_list_add_analog_output_cluster(_cluster_list, esp_zb_analog_output_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + if (ret != ESP_OK) { + log_e("Failed to add Analog Output cluster: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } _analog_clusters |= ANALOG_OUTPUT; + return true; } //set attribute method -> method overridden in child class @@ -57,35 +54,26 @@ void ZigbeeAnalog::analogOutputChanged(float analog_output) { } } -void ZigbeeAnalog::setAnalogValue(float analog) { - if (!(_analog_clusters & ANALOG_VALUE)) { - log_e("Analog Value cluster not added"); - return; - } - // float zb_analog = analog; - log_d("Setting analog value to %.1f", analog); - esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( - _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ANALOG_VALUE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ANALOG_VALUE_PRESENT_VALUE_ID, &analog, false - ); - esp_zb_lock_release(); -} - -void ZigbeeAnalog::setAnalogInput(float analog) { +bool ZigbeeAnalog::setAnalogInput(float analog) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; if (!(_analog_clusters & ANALOG_INPUT)) { log_e("Analog Input cluster not added"); - return; + return false; } - // float zb_analog = analog; log_d("Setting analog input to %.1f", analog); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ANALOG_INPUT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ANALOG_INPUT_PRESENT_VALUE_ID, &analog, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set analog input: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeAnalog::reportAnalogInput() { +bool ZigbeeAnalog::reportAnalogInput() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -96,12 +84,17 @@ void ZigbeeAnalog::reportAnalogInput() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send Analog Input report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Analog Input report sent"); + return true; } -void ZigbeeAnalog::setAnalogInputReporting(uint16_t min_interval, uint16_t max_interval, float delta) { +bool ZigbeeAnalog::setAnalogInputReporting(uint16_t min_interval, uint16_t max_interval, float delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -118,8 +111,13 @@ void ZigbeeAnalog::setAnalogInputReporting(uint16_t min_interval, uint16_t max_i reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set Analog Input reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeAnalog.h b/libraries/Zigbee/src/ep/ZigbeeAnalog.h index 8993c6ea1a4..03fbc678b6e 100644 --- a/libraries/Zigbee/src/ep/ZigbeeAnalog.h +++ b/libraries/Zigbee/src/ep/ZigbeeAnalog.h @@ -9,32 +9,15 @@ #include "ZigbeeEP.h" #include "ha/esp_zigbee_ha_standard.h" -// clang-format off -#define ZIGBEE_DEFAULT_ANALOG_CONFIG() \ - { \ - .basic_cfg = \ - { \ - .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \ - .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \ - }, \ - .identify_cfg = \ - { \ - .identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \ - }, \ - } -// clang-format on - //enum for bits set to check what analog cluster were added enum zigbee_analog_clusters { - ANALOG_VALUE = 1, - ANALOG_INPUT = 2, - ANALOG_OUTPUT = 4 + ANALOG_INPUT = 1, + ANALOG_OUTPUT = 2 }; typedef struct zigbee_analog_cfg_s { esp_zb_basic_cluster_cfg_t basic_cfg; esp_zb_identify_cluster_cfg_t identify_cfg; - esp_zb_analog_value_cluster_cfg_t analog_value_cfg; esp_zb_analog_output_cluster_cfg_t analog_output_cfg; esp_zb_analog_input_cluster_cfg_t analog_input_cfg; } zigbee_analog_cfg_t; @@ -45,24 +28,22 @@ class ZigbeeAnalog : public ZigbeeEP { ~ZigbeeAnalog() {} // Add analog clusters - void addAnalogValue(); - void addAnalogInput(); - void addAnalogOutput(); + bool addAnalogInput(); + bool addAnalogOutput(); // Use to set a cb function to be called on analog output change void onAnalogOutputChange(void (*callback)(float analog)) { _on_analog_output_change = callback; } - // Set the analog value / input - void setAnalogValue(float analog); - void setAnalogInput(float analog); + // Set the analog input value + bool setAnalogInput(float analog); - // Report Analog Input - void reportAnalogInput(); + // Report Analog Input value + bool reportAnalogInput(); // Set reporting for Analog Input - void setAnalogInputReporting(uint16_t min_interval, uint16_t max_interval, float delta); + bool setAnalogInputReporting(uint16_t min_interval, uint16_t max_interval, float delta); private: void zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) override; diff --git a/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp index 2718d9275c2..2b8271f09a9 100644 --- a/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp @@ -24,25 +24,39 @@ ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint) : ZigbeeE _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeeCarbonDioxideSensor::setMinMaxValue(float min, float max) { +bool ZigbeeCarbonDioxideSensor::setMinMaxValue(float min, float max) { float zb_min = min / 1000000.0f; float zb_max = max / 1000000.0f; esp_zb_attribute_list_t *carbon_dioxide_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&zb_min); - esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&zb_max); + esp_err_t ret = esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&zb_min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&zb_max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeCarbonDioxideSensor::setTolerance(float tolerance) { +bool ZigbeeCarbonDioxideSensor::setTolerance(float tolerance) { float zb_tolerance = tolerance / 1000000.0f; esp_zb_attribute_list_t *carbon_dioxide_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_carbon_dioxide_measurement_cluster_add_attr( + esp_err_t ret = esp_zb_carbon_dioxide_measurement_cluster_add_attr( carbon_dioxide_measure_cluster, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance ); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { +bool ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -60,24 +74,35 @@ void ZigbeeCarbonDioxideSensor::setReporting(uint16_t min_interval, uint16_t max memcpy(&reporting_info.u.send_info.delta.s32, &delta_f, sizeof(float)); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeCarbonDioxideSensor::setCarbonDioxide(float carbon_dioxide) { +bool ZigbeeCarbonDioxideSensor::setCarbonDioxide(float carbon_dioxide) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; float zb_carbon_dioxide = carbon_dioxide / 1000000.0f; log_v("Updating carbon dioxide sensor value..."); /* Update carbon dioxide sensor measured value */ log_d("Setting carbon dioxide to %0.1f", carbon_dioxide); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_CARBON_DIOXIDE_MEASUREMENT_MEASURED_VALUE_ID, &zb_carbon_dioxide, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set carbon dioxide: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeCarbonDioxideSensor::report() { +bool ZigbeeCarbonDioxideSensor::report() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -88,9 +113,14 @@ void ZigbeeCarbonDioxideSensor::report() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send carbon dioxide report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Carbon dioxide report sent"); + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h b/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h index 41a9a4fb355..e0a6de48648 100644 --- a/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h @@ -42,20 +42,20 @@ class ZigbeeCarbonDioxideSensor : public ZigbeeEP { ~ZigbeeCarbonDioxideSensor() {} // Set the carbon dioxide value in ppm - void setCarbonDioxide(float carbon_dioxide); + bool setCarbonDioxide(float carbon_dioxide); // Set the min and max value for the carbon dioxide sensor in ppm - void setMinMaxValue(float min, float max); + bool setMinMaxValue(float min, float max); // Set the tolerance value for the carbon dioxide sensor in ppm - void setTolerance(float tolerance); + bool setTolerance(float tolerance); // Set the reporting interval for carbon dioxide measurement in seconds and delta (carbon dioxide change in ppm) // NOTE: Delta reporting is currently not supported by the carbon dioxide sensor - void setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); + bool setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); // Report the carbon dioxide value - void report(); + bool report(); }; #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp b/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp index 585b1549816..caac73b5c68 100644 --- a/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp @@ -117,7 +117,8 @@ void ZigbeeColorDimmableLight::lightChanged() { } } -void ZigbeeColorDimmableLight::setLight(bool state, uint8_t level, uint8_t red, uint8_t green, uint8_t blue) { +bool ZigbeeColorDimmableLight::setLight(bool state, uint8_t level, uint8_t red, uint8_t green, uint8_t blue) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; //Update all attributes _current_state = state; _current_level = level; @@ -126,55 +127,83 @@ void ZigbeeColorDimmableLight::setLight(bool state, uint8_t level, uint8_t red, espXyColor_t xy_color = espRgbColorToXYColor(_current_color); espHsvColor_t hsv_color = espRgbColorToHsvColor(_current_color); + uint8_t hue = (uint8_t)hsv_color.h; log_v("Updating light state: %d, level: %d, color: %d, %d, %d", state, level, red, green, blue); /* Update light clusters */ esp_zb_lock_acquire(portMAX_DELAY); //set on/off state - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ON_OFF, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID, &_current_state, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light state: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } //set level - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID, &_current_level, false ); - //set xy color - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light level: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + //set x color + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_X_ID, &xy_color.x, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light xy color: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + //set y color + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_Y_ID, &xy_color.y, false ); - //set hsv color - uint8_t hue = (uint8_t)hsv_color.h; - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light y color: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + //set hue + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_HUE_ID, &hue, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light hue: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + //set saturation + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_SATURATION_ID, &hsv_color.s, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light saturation: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } -void ZigbeeColorDimmableLight::setLightState(bool state) { - setLight(state, _current_level, _current_color.r, _current_color.g, _current_color.b); +bool ZigbeeColorDimmableLight::setLightState(bool state) { + return setLight(state, _current_level, _current_color.r, _current_color.g, _current_color.b); } -void ZigbeeColorDimmableLight::setLightLevel(uint8_t level) { - setLight(_current_state, level, _current_color.r, _current_color.g, _current_color.b); +bool ZigbeeColorDimmableLight::setLightLevel(uint8_t level) { + return setLight(_current_state, level, _current_color.r, _current_color.g, _current_color.b); } -void ZigbeeColorDimmableLight::setLightColor(uint8_t red, uint8_t green, uint8_t blue) { - setLight(_current_state, _current_level, red, green, blue); +bool ZigbeeColorDimmableLight::setLightColor(uint8_t red, uint8_t green, uint8_t blue) { + return setLight(_current_state, _current_level, red, green, blue); } -void ZigbeeColorDimmableLight::setLightColor(espRgbColor_t rgb_color) { - setLight(_current_state, _current_level, rgb_color.r, rgb_color.g, rgb_color.b); +bool ZigbeeColorDimmableLight::setLightColor(espRgbColor_t rgb_color) { + return setLight(_current_state, _current_level, rgb_color.r, rgb_color.g, rgb_color.b); } -void ZigbeeColorDimmableLight::setLightColor(espHsvColor_t hsv_color) { +bool ZigbeeColorDimmableLight::setLightColor(espHsvColor_t hsv_color) { espRgbColor_t rgb_color = espHsvColorToRgbColor(hsv_color); - setLight(_current_state, _current_level, rgb_color.r, rgb_color.g, rgb_color.b); + return setLight(_current_state, _current_level, rgb_color.r, rgb_color.g, rgb_color.b); } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h b/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h index 64df3565793..6681f213ad0 100644 --- a/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h +++ b/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h @@ -62,12 +62,12 @@ class ZigbeeColorDimmableLight : public ZigbeeEP { lightChanged(); } - void setLightState(bool state); - void setLightLevel(uint8_t level); - void setLightColor(uint8_t red, uint8_t green, uint8_t blue); - void setLightColor(espRgbColor_t rgb_color); - void setLightColor(espHsvColor_t hsv_color); - void setLight(bool state, uint8_t level, uint8_t red, uint8_t green, uint8_t blue); + bool setLightState(bool state); + bool setLightLevel(uint8_t level); + bool setLightColor(uint8_t red, uint8_t green, uint8_t blue); + bool setLightColor(espRgbColor_t rgb_color); + bool setLightColor(espHsvColor_t hsv_color); + bool setLight(bool state, uint8_t level, uint8_t red, uint8_t green, uint8_t blue); bool getLightState() { return _current_state; diff --git a/libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp b/libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp index 6237315d5d9..ced8e43d6ea 100644 --- a/libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp @@ -29,29 +29,39 @@ void ZigbeeContactSwitch::setIASClientEndpoint(uint8_t ep_number) { _ias_cie_endpoint = ep_number; } -void ZigbeeContactSwitch::setClosed() { +bool ZigbeeContactSwitch::setClosed() { log_v("Setting Contact switch to closed"); uint8_t closed = 0; // ALARM1 = 0, ALARM2 = 0 esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + esp_err_t ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &closed, false ); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set contact switch to closed: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } _zone_status = closed; - report(); + return report(); } -void ZigbeeContactSwitch::setOpen() { +bool ZigbeeContactSwitch::setOpen() { log_v("Setting Contact switch to open"); uint8_t open = ESP_ZB_ZCL_IAS_ZONE_ZONE_STATUS_ALARM1 | ESP_ZB_ZCL_IAS_ZONE_ZONE_STATUS_ALARM2; // ALARM1 = 1, ALARM2 = 1 esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &open, false); + esp_err_t ret = esp_zb_zcl_set_attribute_val( + _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &open, false + ); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set contact switch to open: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } _zone_status = open; - report(); + return report(); } -void ZigbeeContactSwitch::report() { +bool ZigbeeContactSwitch::report() { /* Send IAS Zone status changed notification command */ esp_zb_zcl_ias_zone_status_change_notif_cmd_t status_change_notif_cmd; @@ -66,9 +76,14 @@ void ZigbeeContactSwitch::report() { status_change_notif_cmd.delay = 0; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_ias_zone_status_change_notif_cmd_req(&status_change_notif_cmd); + esp_err_t ret = esp_zb_zcl_ias_zone_status_change_notif_cmd_req(&status_change_notif_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send IAS Zone status changed notification: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("IAS Zone status changed notification sent"); + return true; } void ZigbeeContactSwitch::zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) { diff --git a/libraries/Zigbee/src/ep/ZigbeeContactSwitch.h b/libraries/Zigbee/src/ep/ZigbeeContactSwitch.h index f44ce1cec40..b33effd8dfc 100644 --- a/libraries/Zigbee/src/ep/ZigbeeContactSwitch.h +++ b/libraries/Zigbee/src/ep/ZigbeeContactSwitch.h @@ -48,13 +48,13 @@ class ZigbeeContactSwitch : public ZigbeeEP { void setIASClientEndpoint(uint8_t ep_number); // Set the contact switch value to closed - void setClosed(); + bool setClosed(); // Set the contact switch value to open - void setOpen(); + bool setOpen(); // Report the contact switch value, done automatically after setting the position - void report(); + bool report(); private: void zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) override; diff --git a/libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp b/libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp index 34622d1d2db..05a7e5ad6c1 100644 --- a/libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp @@ -1,4 +1,3 @@ - #include "ZigbeeDimmableLight.h" #if CONFIG_ZB_ENABLED @@ -52,7 +51,8 @@ void ZigbeeDimmableLight::lightChanged() { } } -void ZigbeeDimmableLight::setLight(bool state, uint8_t level) { +bool ZigbeeDimmableLight::setLight(bool state, uint8_t level) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; // Update all attributes _current_state = state; _current_level = level; @@ -62,22 +62,32 @@ void ZigbeeDimmableLight::setLight(bool state, uint8_t level) { /* Update light clusters */ esp_zb_lock_acquire(portMAX_DELAY); // set on/off state - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ON_OFF, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID, &_current_state, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light state: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } // set level - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID, &_current_level, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light level: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } -void ZigbeeDimmableLight::setLightState(bool state) { - setLight(state, _current_level); +bool ZigbeeDimmableLight::setLightState(bool state) { + return setLight(state, _current_level); } -void ZigbeeDimmableLight::setLightLevel(uint8_t level) { - setLight(_current_state, level); +bool ZigbeeDimmableLight::setLightLevel(uint8_t level) { + return setLight(_current_state, level); } esp_zb_cluster_list_t *ZigbeeDimmableLight::zigbee_dimmable_light_clusters_create(zigbee_dimmable_light_cfg_t *light_cfg) { diff --git a/libraries/Zigbee/src/ep/ZigbeeDimmableLight.h b/libraries/Zigbee/src/ep/ZigbeeDimmableLight.h index 45c3e97c00b..747fdbafaef 100644 --- a/libraries/Zigbee/src/ep/ZigbeeDimmableLight.h +++ b/libraries/Zigbee/src/ep/ZigbeeDimmableLight.h @@ -76,9 +76,9 @@ class ZigbeeDimmableLight : public ZigbeeEP { lightChanged(); } - void setLightState(bool state); - void setLightLevel(uint8_t level); - void setLight(bool state, uint8_t level); + bool setLightState(bool state); + bool setLightLevel(uint8_t level); + bool setLight(bool state, uint8_t level); bool getLightState() { return _current_state; @@ -89,7 +89,6 @@ class ZigbeeDimmableLight : public ZigbeeEP { private: void zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) override; - void lightChanged(); // callback function to be called on light change (State, Level) void (*_on_light_change)(bool, uint8_t); diff --git a/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp b/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp index 70008fbab10..c5b62ee2b75 100644 --- a/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp @@ -29,41 +29,58 @@ void ZigbeeDoorWindowHandle::setIASClientEndpoint(uint8_t ep_number) { _ias_cie_endpoint = ep_number; } -void ZigbeeDoorWindowHandle::setClosed() { +bool ZigbeeDoorWindowHandle::setClosed() { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Setting Door/Window handle to closed"); uint8_t closed = 0; // ALARM1 = 0, ALARM2 = 0 esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &closed, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set door/window handle to closed: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } _zone_status = closed; - report(); + return report(); } -void ZigbeeDoorWindowHandle::setOpen() { +bool ZigbeeDoorWindowHandle::setOpen() { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Setting Door/Window handle to open"); uint8_t open = ESP_ZB_ZCL_IAS_ZONE_ZONE_STATUS_ALARM1 | ESP_ZB_ZCL_IAS_ZONE_ZONE_STATUS_ALARM2; // ALARM1 = 1, ALARM2 = 1 esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val(_endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &open, false); + ret = esp_zb_zcl_set_attribute_val( + _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &open, false + ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set door/window handle to open: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } _zone_status = open; - report(); + return report(); } -void ZigbeeDoorWindowHandle::setTilted() { +bool ZigbeeDoorWindowHandle::setTilted() { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Setting Door/Window handle to tilted"); uint8_t tilted = ESP_ZB_ZCL_IAS_ZONE_ZONE_STATUS_ALARM1; // ALARM1 = 1, ALARM2 = 0 esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &tilted, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set door/window handle to tilted: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } _zone_status = tilted; - report(); + return report(); } -void ZigbeeDoorWindowHandle::report() { +bool ZigbeeDoorWindowHandle::report() { /* Send IAS Zone status changed notification command */ esp_zb_zcl_ias_zone_status_change_notif_cmd_t status_change_notif_cmd; @@ -77,10 +94,12 @@ void ZigbeeDoorWindowHandle::report() { status_change_notif_cmd.zone_id = _zone_id; status_change_notif_cmd.delay = 0; + //NOTE: Check result of esp_zb_zcl_ias_zone_status_change_notif_cmd_req() and return true if success, false if failure esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_ias_zone_status_change_notif_cmd_req(&status_change_notif_cmd); esp_zb_lock_release(); log_v("IAS Zone status changed notification sent"); + return true; } void ZigbeeDoorWindowHandle::zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) { diff --git a/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h b/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h index 8d4eff9e45a..efffd34b12f 100644 --- a/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h +++ b/libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h @@ -49,16 +49,16 @@ class ZigbeeDoorWindowHandle : public ZigbeeEP { void setIASClientEndpoint(uint8_t ep_number); // Set the door/window handle value to closed - void setClosed(); + bool setClosed(); // Set the door/window handle value to open - void setOpen(); + bool setOpen(); // Set the door/window handle value to tilted - void setTilted(); + bool setTilted(); // Report the door/window handle value, done automatically after setting the position - void report(); + bool report(); private: void zbIASZoneEnrollResponse(const esp_zb_zcl_ias_zone_enroll_response_message_t *message) override; diff --git a/libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp index 11fbf7c906b..8a60af5a8e1 100644 --- a/libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp @@ -22,24 +22,37 @@ ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint) : ZigbeeEP(endpoint) { _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeeFlowSensor::setMinMaxValue(float min, float max) { +bool ZigbeeFlowSensor::setMinMaxValue(float min, float max) { uint16_t zb_min = (uint16_t)(min * 10); uint16_t zb_max = (uint16_t)(max * 10); esp_zb_attribute_list_t *flow_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_FLOW_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_MIN_VALUE_ID, (void *)&zb_min); - esp_zb_cluster_update_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_MAX_VALUE_ID, (void *)&zb_max); + esp_err_t ret = esp_zb_cluster_update_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_MIN_VALUE_ID, (void *)&zb_min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_MAX_VALUE_ID, (void *)&zb_max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeFlowSensor::setTolerance(float tolerance) { - // Convert tolerance to ZCL uint16_t +bool ZigbeeFlowSensor::setTolerance(float tolerance) { uint16_t zb_tolerance = (uint16_t)(tolerance * 10); esp_zb_attribute_list_t *flow_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_FLOW_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_flow_meas_cluster_add_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + esp_err_t ret = esp_zb_flow_meas_cluster_add_attr(flow_measure_cluster, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeFlowSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { +bool ZigbeeFlowSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -54,24 +67,39 @@ void ZigbeeFlowSensor::setReporting(uint16_t min_interval, uint16_t max_interval reporting_info.u.send_info.delta.u16 = (uint16_t)(delta * 10); // Convert delta to ZCL uint16_t reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeFlowSensor::setFlow(float flow) { +bool ZigbeeFlowSensor::setFlow(float flow) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; uint16_t zb_flow = (uint16_t)(flow * 10); log_v("Updating flow sensor value..."); /* Update temperature sensor measured value */ log_d("Setting flow to %d", zb_flow); + esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_FLOW_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_FLOW_MEASUREMENT_VALUE_ID, &zb_flow, false ); esp_zb_lock_release(); + + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set flow value: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeFlowSensor::report() { +bool ZigbeeFlowSensor::report() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -82,9 +110,15 @@ void ZigbeeFlowSensor::report() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + + if (ret != ESP_OK) { + log_e("Failed to send flow report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Flow report sent"); + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeFlowSensor.h b/libraries/Zigbee/src/ep/ZigbeeFlowSensor.h index 5e9e20e4d1a..fa16b4a5636 100644 --- a/libraries/Zigbee/src/ep/ZigbeeFlowSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeFlowSensor.h @@ -42,19 +42,19 @@ class ZigbeeFlowSensor : public ZigbeeEP { ~ZigbeeFlowSensor() {} // Set the flow value in 0,1 m3/h - void setFlow(float value); + bool setFlow(float value); // Set the min and max value for the flow sensor in 0,1 m3/h - void setMinMaxValue(float min, float max); + bool setMinMaxValue(float min, float max); // Set the tolerance value for the flow sensor in 0,01 m3/h - void setTolerance(float tolerance); + bool setTolerance(float tolerance); // Set the reporting interval for flow measurement in seconds and delta (temp change in 0,1 m3/h) - void setReporting(uint16_t min_interval, uint16_t max_interval, float delta); + bool setReporting(uint16_t min_interval, uint16_t max_interval, float delta); // Report the flow value - void report(); + bool report(); }; #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp index d38e9b1065f..f1661c3a026 100644 --- a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp @@ -10,20 +10,34 @@ ZigbeeIlluminanceSensor::ZigbeeIlluminanceSensor(uint8_t endpoint) : ZigbeeEP(en _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeeIlluminanceSensor::setMinMaxValue(uint16_t min, uint16_t max) { +bool ZigbeeIlluminanceSensor::setMinMaxValue(uint16_t min, uint16_t max) { esp_zb_attribute_list_t *light_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&min); - esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&max); + esp_err_t ret = esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeIlluminanceSensor::setTolerance(uint16_t tolerance) { +bool ZigbeeIlluminanceSensor::setTolerance(uint16_t tolerance) { esp_zb_attribute_list_t *light_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_illuminance_meas_cluster_add_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); + esp_err_t ret = esp_zb_illuminance_meas_cluster_add_attr(light_measure_cluster, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeIlluminanceSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { +bool ZigbeeIlluminanceSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -38,24 +52,37 @@ void ZigbeeIlluminanceSensor::setReporting(uint16_t min_interval, uint16_t max_i reporting_info.u.send_info.delta.u16 = delta; reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeIlluminanceSensor::setIlluminance(uint16_t illuminanceValue) { +bool ZigbeeIlluminanceSensor::setIlluminance(uint16_t illuminanceValue) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Updating Illuminance..."); /* Update illuminance sensor measured illuminance */ log_d("Setting Illuminance to %d", illuminanceValue); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MEASURED_VALUE_ID, &illuminanceValue, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set illuminance: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeIlluminanceSensor::report() { +bool ZigbeeIlluminanceSensor::report() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -66,9 +93,14 @@ void ZigbeeIlluminanceSensor::report() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send illuminance report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Illuminance report sent"); + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h index 9c9d9e3fcaf..133dfc315db 100644 --- a/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h @@ -33,19 +33,19 @@ class ZigbeeIlluminanceSensor : public ZigbeeEP { ~ZigbeeIlluminanceSensor() {} // Set the illuminance value - void setIlluminance(uint16_t value); + bool setIlluminance(uint16_t value); // Set the min and max value for the illuminance sensor - void setMinMaxValue(uint16_t min, uint16_t max); + bool setMinMaxValue(uint16_t min, uint16_t max); // Set the tolerance value for the illuminance sensor - void setTolerance(uint16_t tolerance); + bool setTolerance(uint16_t tolerance); // Set the reporting interval for illuminance measurement in seconds and delta - void setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); + bool setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); // Report the illuminance value - void report(); + bool report(); }; #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeLight.cpp b/libraries/Zigbee/src/ep/ZigbeeLight.cpp index 2a87db71287..edfac04fcdf 100644 --- a/libraries/Zigbee/src/ep/ZigbeeLight.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeLight.cpp @@ -33,17 +33,24 @@ void ZigbeeLight::lightChanged() { } } -void ZigbeeLight::setLight(bool state) { +bool ZigbeeLight::setLight(bool state) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; _current_state = state; lightChanged(); log_v("Updating on/off light state to %d", state); /* Update on/off light state */ esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_ON_OFF, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID, &_current_state, false ); esp_zb_lock_release(); + + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set light state: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeLight.h b/libraries/Zigbee/src/ep/ZigbeeLight.h index 807802be9b3..773fbb14ec5 100644 --- a/libraries/Zigbee/src/ep/ZigbeeLight.h +++ b/libraries/Zigbee/src/ep/ZigbeeLight.h @@ -23,7 +23,7 @@ class ZigbeeLight : public ZigbeeEP { lightChanged(); } // Use to control light state - void setLight(bool state); + bool setLight(bool state); // Use to get light state bool getLightState() { return _current_state; diff --git a/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp b/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp index 31a1f7e90e1..b8f88fed4a4 100644 --- a/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp @@ -22,26 +22,41 @@ ZigbeeOccupancySensor::ZigbeeOccupancySensor(uint8_t endpoint) : ZigbeeEP(endpoi _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeeOccupancySensor::setSensorType(uint8_t sensor_type) { +bool ZigbeeOccupancySensor::setSensorType(uint8_t sensor_type) { uint8_t sensor_type_bitmap = 1 << sensor_type; esp_zb_attribute_list_t *occupancy_sens_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(occupancy_sens_cluster, ESP_ZB_ZCL_ATTR_OCCUPANCY_SENSING_OCCUPANCY_SENSOR_TYPE_ID, (void *)&sensor_type); - esp_zb_cluster_update_attr(occupancy_sens_cluster, ESP_ZB_ZCL_ATTR_OCCUPANCY_SENSING_OCCUPANCY_SENSOR_TYPE_BITMAP_ID, (void *)&sensor_type_bitmap); + esp_err_t ret = esp_zb_cluster_update_attr(occupancy_sens_cluster, ESP_ZB_ZCL_ATTR_OCCUPANCY_SENSING_OCCUPANCY_SENSOR_TYPE_ID, (void *)&sensor_type); + if (ret != ESP_OK) { + log_e("Failed to set sensor type: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(occupancy_sens_cluster, ESP_ZB_ZCL_ATTR_OCCUPANCY_SENSING_OCCUPANCY_SENSOR_TYPE_BITMAP_ID, (void *)&sensor_type_bitmap); + if (ret != ESP_OK) { + log_e("Failed to set sensor type bitmap: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeOccupancySensor::setOccupancy(bool occupied) { +bool ZigbeeOccupancySensor::setOccupancy(bool occupied) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Updating occupancy sensor value..."); /* Update occupancy sensor value */ log_d("Setting occupancy to %d", occupied); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_OCCUPANCY_SENSING_OCCUPANCY_ID, &occupied, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set occupancy: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeOccupancySensor::report() { +bool ZigbeeOccupancySensor::report() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -52,9 +67,14 @@ void ZigbeeOccupancySensor::report() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send occupancy report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Occupancy report sent"); + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h b/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h index fa622d5a707..7408e10a76b 100644 --- a/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeOccupancySensor.h @@ -42,13 +42,13 @@ class ZigbeeOccupancySensor : public ZigbeeEP { ~ZigbeeOccupancySensor() {} // Set the occupancy value. True for occupied, false for unoccupied - void setOccupancy(bool occupied); + bool setOccupancy(bool occupied); // Set the sensor type, see esp_zb_zcl_occupancy_sensing_occupancy_sensor_type_t - void setSensorType(uint8_t sensor_type); + bool setSensorType(uint8_t sensor_type); // Report the occupancy value - void report(); + bool report(); }; #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp b/libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp index 21456a51511..bca06a35d0c 100644 --- a/libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp @@ -22,21 +22,33 @@ ZigbeePressureSensor::ZigbeePressureSensor(uint8_t endpoint) : ZigbeeEP(endpoint _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; } -void ZigbeePressureSensor::setMinMaxValue(int16_t min, int16_t max) { - +bool ZigbeePressureSensor::setMinMaxValue(int16_t min, int16_t max) { esp_zb_attribute_list_t *pressure_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MIN_VALUE_ID, (void *)&min); - esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MAX_VALUE_ID, (void *)&max); + esp_err_t ret = esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MIN_VALUE_ID, (void *)&min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MAX_VALUE_ID, (void *)&max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeePressureSensor::setTolerance(uint16_t tolerance) { +bool ZigbeePressureSensor::setTolerance(uint16_t tolerance) { esp_zb_attribute_list_t *pressure_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_pressure_meas_cluster_add_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); + esp_err_t ret = esp_zb_pressure_meas_cluster_add_attr(pressure_measure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + } + return ret == ESP_OK; } -void ZigbeePressureSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { +bool ZigbeePressureSensor::setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -52,22 +64,33 @@ void ZigbeePressureSensor::setReporting(uint16_t min_interval, uint16_t max_inte reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeePressureSensor::setPressure(int16_t pressure) { +bool ZigbeePressureSensor::setPressure(int16_t pressure) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Updating pressure sensor value..."); /* Update pressure sensor measured value */ log_d("Setting pressure to %d hPa", pressure); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_VALUE_ID, &pressure, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set pressure: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeePressureSensor::report() { +bool ZigbeePressureSensor::report() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -78,9 +101,14 @@ void ZigbeePressureSensor::report() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send pressure report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Pressure report sent"); + return true; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeePressureSensor.h b/libraries/Zigbee/src/ep/ZigbeePressureSensor.h index db14dd1c341..f93df7a7411 100644 --- a/libraries/Zigbee/src/ep/ZigbeePressureSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeePressureSensor.h @@ -42,19 +42,19 @@ class ZigbeePressureSensor : public ZigbeeEP { ~ZigbeePressureSensor() {} // Set the pressure value in 1 hPa - void setPressure(int16_t value); + bool setPressure(int16_t value); // Set the min and max value for the pressure sensor in 1 hPa - void setMinMaxValue(int16_t min, int16_t max); + bool setMinMaxValue(int16_t min, int16_t max); // Set the tolerance value for the pressure sensor in 1 hPa - void setTolerance(uint16_t tolerance); + bool setTolerance(uint16_t tolerance); // Set the reporting interval for pressure measurement in seconds and delta (pressure change in 1 hPa) - void setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); + bool setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta); // Report the pressure value - void report(); + bool report(); }; #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp index b3ff03f0a6b..7126dae15cf 100644 --- a/libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp @@ -17,24 +17,38 @@ static int16_t zb_float_to_s16(float temp) { return (int16_t)(temp * 100); } -void ZigbeeTempSensor::setMinMaxValue(float min, float max) { +bool ZigbeeTempSensor::setMinMaxValue(float min, float max) { int16_t zb_min = zb_float_to_s16(min); int16_t zb_max = zb_float_to_s16(max); esp_zb_attribute_list_t *temp_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, (void *)&zb_min); - esp_zb_cluster_update_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, (void *)&zb_max); + esp_err_t ret = esp_zb_cluster_update_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, (void *)&zb_min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, (void *)&zb_max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::setTolerance(float tolerance) { +bool ZigbeeTempSensor::setTolerance(float tolerance) { // Convert tolerance to ZCL uint16_t uint16_t zb_tolerance = (uint16_t)(tolerance * 100); esp_zb_attribute_list_t *temp_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_temperature_meas_cluster_add_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + esp_err_t ret = esp_zb_temperature_meas_cluster_add_attr(temp_measure_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { +bool ZigbeeTempSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -50,23 +64,34 @@ void ZigbeeTempSensor::setReporting(uint16_t min_interval, uint16_t max_interval reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::setTemperature(float temperature) { +bool ZigbeeTempSensor::setTemperature(float temperature) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; int16_t zb_temperature = zb_float_to_s16(temperature); log_v("Updating temperature sensor value..."); /* Update temperature sensor measured value */ log_d("Setting temperature to %d", zb_temperature); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID, &zb_temperature, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set temperature: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::reportTemperature() { +bool ZigbeeTempSensor::reportTemperature() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -77,9 +102,14 @@ void ZigbeeTempSensor::reportTemperature() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send temperature report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Temperature report sent"); + return true; } void ZigbeeTempSensor::addHumiditySensor(float min, float max, float tolerance) { @@ -96,20 +126,26 @@ void ZigbeeTempSensor::addHumiditySensor(float min, float max, float tolerance) _humidity_sensor = true; } -void ZigbeeTempSensor::setHumidity(float humidity) { +bool ZigbeeTempSensor::setHumidity(float humidity) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; int16_t zb_humidity = zb_float_to_s16(humidity); log_v("Updating humidity sensor value..."); /* Update humidity sensor measured value */ log_d("Setting humidity to %d", zb_humidity); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID, &zb_humidity, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set humidity: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::reportHumidity() { +bool ZigbeeTempSensor::reportHumidity() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -120,12 +156,17 @@ void ZigbeeTempSensor::reportHumidity() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send humidity report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Humidity report sent"); + return true; } -void ZigbeeTempSensor::setHumidityReporting(uint16_t min_interval, uint16_t max_interval, float delta) { +bool ZigbeeTempSensor::setHumidityReporting(uint16_t min_interval, uint16_t max_interval, float delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -141,15 +182,22 @@ void ZigbeeTempSensor::setHumidityReporting(uint16_t min_interval, uint16_t max_ reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set humidity reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeTempSensor::report() { - reportTemperature(); +bool ZigbeeTempSensor::report() { + bool temp_ret = reportTemperature(); + bool hum_ret = true; if (_humidity_sensor) { - reportHumidity(); + hum_ret = reportHumidity(); } + return temp_ret && hum_ret; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeTempSensor.h b/libraries/Zigbee/src/ep/ZigbeeTempSensor.h index 41da03d9db8..bc769b32de6 100644 --- a/libraries/Zigbee/src/ep/ZigbeeTempSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeTempSensor.h @@ -15,34 +15,34 @@ class ZigbeeTempSensor : public ZigbeeEP { ~ZigbeeTempSensor() {} // Set the temperature value in 0,01°C - void setTemperature(float value); + bool setTemperature(float value); // Set the min and max value for the temperature sensor in 0,01°C - void setMinMaxValue(float min, float max); + bool setMinMaxValue(float min, float max); // Set the tolerance value for the temperature sensor in 0,01°C - void setTolerance(float tolerance); + bool setTolerance(float tolerance); // Set the reporting interval for temperature measurement in seconds and delta (temp change in 0,01 °C) - void setReporting(uint16_t min_interval, uint16_t max_interval, float delta); + bool setReporting(uint16_t min_interval, uint16_t max_interval, float delta); // Report the temperature value - void reportTemperature(); + bool reportTemperature(); // Add humidity cluster to the temperature sensor device void addHumiditySensor(float min, float max, float tolerance); // Set the humidity value in 0,01% - void setHumidity(float value); + bool setHumidity(float value); // Set the reporting interval for humidity measurement in seconds and delta (humidity change in 0,01%) - void setHumidityReporting(uint16_t min_interval, uint16_t max_interval, float delta); + bool setHumidityReporting(uint16_t min_interval, uint16_t max_interval, float delta); // Report the humidity value - void reportHumidity(); + bool reportHumidity(); // Report the temperature and humidity values if humidity sensor is added - void report(); + bool report(); private: bool _humidity_sensor; diff --git a/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp index 9fc75297262..6be457c389a 100644 --- a/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp @@ -29,16 +29,22 @@ void ZigbeeVibrationSensor::setIASClientEndpoint(uint8_t ep_number) { _ias_cie_endpoint = ep_number; } -void ZigbeeVibrationSensor::setVibration(bool sensed) { +bool ZigbeeVibrationSensor::setVibration(bool sensed) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; log_v("Setting Vibration sensor to %s", sensed ? "sensed" : "not sensed"); uint8_t vibration = (uint8_t)sensed; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID, &vibration, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set vibration status: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } _zone_status = vibration; report(); + return true; } void ZigbeeVibrationSensor::report() { @@ -49,7 +55,6 @@ void ZigbeeVibrationSensor::report() { status_change_notif_cmd.zcl_basic_cmd.src_endpoint = _endpoint; status_change_notif_cmd.zcl_basic_cmd.dst_endpoint = _ias_cie_endpoint; //default is 1 memcpy(status_change_notif_cmd.zcl_basic_cmd.dst_addr_u.addr_long, _ias_cie_addr, sizeof(esp_zb_ieee_addr_t)); - status_change_notif_cmd.zone_status = _zone_status; status_change_notif_cmd.extend_status = 0; status_change_notif_cmd.zone_id = _zone_id; diff --git a/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.h b/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.h index 1ee3740dcc3..2f67c7bb6b4 100644 --- a/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeVibrationSensor.h @@ -48,7 +48,7 @@ class ZigbeeVibrationSensor : public ZigbeeEP { void setIASClientEndpoint(uint8_t ep_number); // Set the vibration sensor value (true = sensed, false = not sensed) - void setVibration(bool sensed); + bool setVibration(bool sensed); // Report the vibration sensor value, done automatically after setting the sensed value void report(); diff --git a/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp b/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp index d93b02adbc3..72184927d4d 100644 --- a/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp @@ -28,25 +28,39 @@ static uint16_t zb_windspeed_to_u16(float windspeed) { return (uint16_t)(windspeed * 100); } -void ZigbeeWindSpeedSensor::setMinMaxValue(float min, float max) { +bool ZigbeeWindSpeedSensor::setMinMaxValue(float min, float max) { uint16_t zb_min = zb_windspeed_to_u16(min); uint16_t zb_max = zb_windspeed_to_u16(max); esp_zb_attribute_list_t *windspeed_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WIND_SPEED_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - // - esp_zb_cluster_update_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&zb_min); - esp_zb_cluster_update_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&zb_max); + esp_err_t ret = esp_zb_cluster_update_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&zb_min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&zb_max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindSpeedSensor::setTolerance(float tolerance) { +bool ZigbeeWindSpeedSensor::setTolerance(float tolerance) { // Convert tolerance to ZCL uint16_t uint16_t zb_tolerance = zb_windspeed_to_u16(tolerance); esp_zb_attribute_list_t *windspeed_measure_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WIND_SPEED_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_wind_speed_measurement_cluster_add_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + esp_err_t ret = + esp_zb_wind_speed_measurement_cluster_add_attr(windspeed_measure_cluster, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_TOLERANCE_ID, (void *)&zb_tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindSpeedSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { +bool ZigbeeWindSpeedSensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { esp_zb_zcl_reporting_info_t reporting_info; memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; @@ -62,24 +76,35 @@ void ZigbeeWindSpeedSensor::setReporting(uint16_t min_interval, uint16_t max_int reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_update_reporting_info(&reporting_info); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindSpeedSensor::setWindSpeed(float windspeed) { +bool ZigbeeWindSpeedSensor::setWindSpeed(float windspeed) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; uint16_t zb_windspeed = zb_windspeed_to_u16(windspeed); log_v("Updating windspeed sensor value..."); /* Update windspeed sensor measured value */ log_d("Setting windspeed to %d", zb_windspeed); esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WIND_SPEED_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WIND_SPEED_MEASUREMENT_MEASURED_VALUE_ID, &zb_windspeed, false ); esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set wind speed: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindSpeedSensor::reportWindSpeed() { +bool ZigbeeWindSpeedSensor::reportWindSpeed() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; @@ -90,9 +115,14 @@ void ZigbeeWindSpeedSensor::reportWindSpeed() { report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send wind speed report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } log_v("Wind speed measurement report sent"); + return true; } #endif //CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.h b/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.h index e091d3ae548..641c1d84780 100644 --- a/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.h +++ b/libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.h @@ -40,17 +40,17 @@ class ZigbeeWindSpeedSensor : public ZigbeeEP { ~ZigbeeWindSpeedSensor() {} // Set the WindSpeed value in 0,01 m/s - void setWindSpeed(float value); + bool setWindSpeed(float value); // Set the min and max value for the WindSpeed sensor - void setMinMaxValue(float min, float max); + bool setMinMaxValue(float min, float max); // Set the tolerance value for the WindSpeed sensor - void setTolerance(float tolerance); + bool setTolerance(float tolerance); // Set the reporting interval for WindSpeed measurement in seconds and delta - void setReporting(uint16_t min_interval, uint16_t max_interval, float delta); - void reportWindSpeed(); + bool setReporting(uint16_t min_interval, uint16_t max_interval, float delta); + bool reportWindSpeed(); }; #endif //CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp b/libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp index f6d6ec268ea..7c7889dbbf7 100644 --- a/libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp +++ b/libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp @@ -1,4 +1,3 @@ - #include "ZigbeeWindowCovering.h" #if CONFIG_ZB_ENABLED @@ -72,13 +71,18 @@ ZigbeeWindowCovering::ZigbeeWindowCovering(uint8_t endpoint) : ZigbeeEP(endpoint } // Configuration methods for window covering -void ZigbeeWindowCovering::setCoveringType(ZigbeeWindowCoveringType covering_type) { +bool ZigbeeWindowCovering::setCoveringType(ZigbeeWindowCoveringType covering_type) { esp_zb_attribute_list_t *window_covering_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_WINDOW_COVERING_TYPE_ID, (void *)&covering_type); + esp_err_t ret = esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_WINDOW_COVERING_TYPE_ID, (void *)&covering_type); + if (ret != ESP_OK) { + log_e("Failed to set covering type: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindowCovering::setConfigStatus( +bool ZigbeeWindowCovering::setConfigStatus( bool operational, bool online, bool commands_reversed, bool lift_closed_loop, bool tilt_closed_loop, bool lift_encoder_controlled, bool tilt_encoder_controlled ) { @@ -93,10 +97,15 @@ void ZigbeeWindowCovering::setConfigStatus( esp_zb_attribute_list_t *window_covering_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CONFIG_STATUS_ID, (void *)&config_status); + esp_err_t ret = esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CONFIG_STATUS_ID, (void *)&config_status); + if (ret != ESP_OK) { + log_e("Failed to set config status: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindowCovering::setMode(bool motor_reversed, bool calibration_mode, bool maintenance_mode, bool leds_on) { +bool ZigbeeWindowCovering::setMode(bool motor_reversed, bool calibration_mode, bool maintenance_mode, bool leds_on) { uint8_t mode = (motor_reversed ? ESP_ZB_ZCL_ATTR_WINDOW_COVERING_TYPE_REVERSED_MOTOR_DIRECTION : 0) | (calibration_mode ? ESP_ZB_ZCL_ATTR_WINDOW_COVERING_TYPE_RUN_IN_CALIBRATION_MODE : 0) | (maintenance_mode ? ESP_ZB_ZCL_ATTR_WINDOW_COVERING_TYPE_MOTOR_IS_RUNNING_IN_MAINTENANCE_MODE : 0) @@ -106,10 +115,15 @@ void ZigbeeWindowCovering::setMode(bool motor_reversed, bool calibration_mode, b esp_zb_attribute_list_t *window_covering_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_MODE_ID, (void *)&mode); + esp_err_t ret = esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_MODE_ID, (void *)&mode); + if (ret != ESP_OK) { + log_e("Failed to set mode: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } -void ZigbeeWindowCovering::setLimits( +bool ZigbeeWindowCovering::setLimits( uint16_t installed_open_limit_lift, uint16_t installed_closed_limit_lift, uint16_t installed_open_limit_tilt, uint16_t installed_closed_limit_tilt ) { _installed_open_limit_lift = installed_open_limit_lift; @@ -121,12 +135,41 @@ void ZigbeeWindowCovering::setLimits( esp_zb_attribute_list_t *window_covering_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_OPEN_LIMIT_LIFT_ID, (void *)&_installed_open_limit_lift); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_CLOSED_LIMIT_LIFT_ID, (void *)&_installed_closed_limit_lift); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_OPEN_LIMIT_TILT_ID, (void *)&_installed_open_limit_tilt); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_CLOSED_LIMIT_TILT_ID, (void *)&_installed_closed_limit_tilt); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_PHYSICAL_CLOSED_LIMIT_LIFT_ID, (void *)&_physical_closed_limit_lift); - esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_PHY_CLOSED_LIMIT_TILT_ID, (void *)&_physical_closed_limit_tilt); + esp_err_t ret = + esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_OPEN_LIMIT_LIFT_ID, (void *)&_installed_open_limit_lift); + if (ret != ESP_OK) { + log_e("Failed to set installed open limit lift: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = + esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_CLOSED_LIMIT_LIFT_ID, (void *)&_installed_closed_limit_lift); + if (ret != ESP_OK) { + log_e("Failed to set installed closed limit lift: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_OPEN_LIMIT_TILT_ID, (void *)&_installed_open_limit_tilt); + if (ret != ESP_OK) { + log_e("Failed to set installed open limit tilt: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = + esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_INSTALLED_CLOSED_LIMIT_TILT_ID, (void *)&_installed_closed_limit_tilt); + if (ret != ESP_OK) { + log_e("Failed to set installed closed limit tilt: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = + esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_PHYSICAL_CLOSED_LIMIT_LIFT_ID, (void *)&_physical_closed_limit_lift); + if (ret != ESP_OK) { + log_e("Failed to set physical closed limit lift: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(window_covering_cluster, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_PHY_CLOSED_LIMIT_TILT_ID, (void *)&_physical_closed_limit_tilt); + if (ret != ESP_OK) { + log_e("Failed to set physical closed limit tilt: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; } // Callback for handling incoming messages and commands @@ -183,12 +226,13 @@ void ZigbeeWindowCovering::zbWindowCoveringMovementCmd(const esp_zb_zcl_window_c if (_current_lift_percentage != message->payload.percentage_lift_value) { _current_lift_percentage = message->payload.percentage_lift_value; goToLiftPercentage(_current_lift_percentage); + return; } - return; } else if (message->command == ESP_ZB_ZCL_CMD_WINDOW_COVERING_GO_TO_TILT_PERCENTAGE) { if (_current_tilt_percentage != message->payload.percentage_tilt_value) { _current_tilt_percentage = message->payload.percentage_tilt_value; goToTiltPercentage(_current_tilt_percentage); + return; } } else { log_w("Received message ignored. Command: %d not supported for Window Covering", message->command); @@ -229,80 +273,122 @@ void ZigbeeWindowCovering::stop() { } // Methods to control window covering from user application -void ZigbeeWindowCovering::setLiftPosition(uint16_t lift_position) { +bool ZigbeeWindowCovering::setLiftPosition(uint16_t lift_position) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; // Update both lift attributes _current_lift_position = lift_position; _current_lift_percentage = ((lift_position - _installed_open_limit_lift) * 100) / (_installed_closed_limit_lift - _installed_open_limit_lift); - log_v("Updating window covering lift position to %d (%d%)", _current_lift_position, _current_lift_percentage); - // set lift state + esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_LIFT_ID, &_current_lift_position, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set lift position: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_LIFT_PERCENTAGE_ID, &_current_lift_percentage, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set lift percentage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } -void ZigbeeWindowCovering::setLiftPercentage(uint8_t lift_percentage) { +bool ZigbeeWindowCovering::setLiftPercentage(uint8_t lift_percentage) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; // Update both lift attributes _current_lift_percentage = lift_percentage; _current_lift_position = _installed_open_limit_lift + ((_installed_closed_limit_lift - _installed_open_limit_lift) * lift_percentage) / 100; + log_v("Updating window covering lift percentage to %d%% (%d)", _current_lift_percentage, _current_lift_position); - log_v("Updating window covering lift position to %d (%d%)", _current_lift_position, _current_lift_percentage); - // set lift state esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_LIFT_ID, &_current_lift_position, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set lift position: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_LIFT_PERCENTAGE_ID, &_current_lift_percentage, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set lift percentage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } -void ZigbeeWindowCovering::setTiltPosition(uint16_t tilt_position) { +bool ZigbeeWindowCovering::setTiltPosition(uint16_t tilt_position) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; // Update both tilt attributes _current_tilt_position = tilt_position; _current_tilt_percentage = ((tilt_position - _installed_open_limit_tilt) * 100) / (_installed_closed_limit_tilt - _installed_open_limit_tilt); log_v("Updating window covering tilt position to %d (%d%)", _current_tilt_position, _current_tilt_percentage); - // set lift state + esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_TILT_ID, &_current_tilt_position, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set tilt position: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_TILT_PERCENTAGE_ID, &_current_tilt_percentage, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set tilt percentage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } -void ZigbeeWindowCovering::setTiltPercentage(uint8_t tilt_percentage) { +bool ZigbeeWindowCovering::setTiltPercentage(uint8_t tilt_percentage) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; // Update both tilt attributes _current_tilt_percentage = tilt_percentage; - _current_tilt_position = _installed_open_limit_lift + ((_installed_closed_limit_tilt - _installed_open_limit_tilt) * tilt_percentage) / 100; + _current_tilt_position = _installed_open_limit_tilt + ((_installed_closed_limit_tilt - _installed_open_limit_tilt) * tilt_percentage) / 100; + + log_v("Updating window covering tilt percentage to %d%% (%d)", _current_tilt_percentage, _current_tilt_position); - log_v("Updating window covering tilt position to %d (%d%)", _current_tilt_position, _current_tilt_percentage); - // set lift state esp_zb_lock_acquire(portMAX_DELAY); - esp_zb_zcl_set_attribute_val( + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_TILT_ID, &_current_tilt_position, false ); - esp_zb_zcl_set_attribute_val( + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set tilt position: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } + ret = esp_zb_zcl_set_attribute_val( _endpoint, ESP_ZB_ZCL_CLUSTER_ID_WINDOW_COVERING, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_WINDOW_COVERING_CURRENT_POSITION_TILT_PERCENTAGE_ID, &_current_tilt_percentage, false ); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set tilt percentage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + goto unlock_and_return; + } +unlock_and_return: esp_zb_lock_release(); + return ret == ESP_ZB_ZCL_STATUS_SUCCESS; } #endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeeWindowCovering.h b/libraries/Zigbee/src/ep/ZigbeeWindowCovering.h index f3a368370c4..288d92c5765 100644 --- a/libraries/Zigbee/src/ep/ZigbeeWindowCovering.h +++ b/libraries/Zigbee/src/ep/ZigbeeWindowCovering.h @@ -87,25 +87,25 @@ class ZigbeeWindowCovering : public ZigbeeEP { } // Set the window covering position in centimeters or percentage (0-100) - void setLiftPosition(uint16_t lift_position); - void setLiftPercentage(uint8_t lift_percentage); - void setTiltPosition(uint16_t tilt_position); - void setTiltPercentage(uint8_t tilt_percentage); + bool setLiftPosition(uint16_t lift_position); + bool setLiftPercentage(uint8_t lift_percentage); + bool setTiltPosition(uint16_t tilt_position); + bool setTiltPercentage(uint8_t tilt_percentage); // Set the window covering type (see ZigbeeWindowCoveringType) - void setCoveringType(ZigbeeWindowCoveringType covering_type); + bool setCoveringType(ZigbeeWindowCoveringType covering_type); // Set window covering config/status, for more info see esp_zb_zcl_window_covering_config_status_t - void setConfigStatus( + bool setConfigStatus( bool operational, bool online, bool commands_reversed, bool lift_closed_loop, bool tilt_closed_loop, bool lift_encoder_controlled, bool tilt_encoder_controlled ); // Set configuration mode of window covering, for more info see esp_zb_zcl_window_covering_mode_t - void setMode(bool motor_reversed, bool calibration_mode, bool maintenance_mode, bool leds_on); + bool setMode(bool motor_reversed, bool calibration_mode, bool maintenance_mode, bool leds_on); // Set limits of motion, for more info see esp_zb_zcl_window_covering_info_attr_t - void setLimits( + bool setLimits( uint16_t installed_open_limit_lift, uint16_t installed_closed_limit_lift, uint16_t installed_open_limit_tilt, uint16_t installed_closed_limit_tilt ); From 1014937965fa4148a57793dfb1ad92d66d71d519 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Fri, 28 Mar 2025 10:37:48 +0200 Subject: [PATCH 18/56] IDF release/v5.4 (#11149) * IDF release/v5.4 5cbd2a38 * fix(ci): Disable RainMaker examples on ESP32 * IDF release/v5.4 5cbd2a38 * IDF release/v5.4 2f7dcd86 --- .../RainMaker/examples/RMakerCustom/ci.json | 3 + .../RainMaker/examples/RMakerSwitch/ci.json | 3 + package/package_esp32_index.template.json | 68 +++++++++---------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/libraries/RainMaker/examples/RMakerCustom/ci.json b/libraries/RainMaker/examples/RMakerCustom/ci.json index 1c80eda1d90..ce63fe9ccf0 100644 --- a/libraries/RainMaker/examples/RMakerCustom/ci.json +++ b/libraries/RainMaker/examples/RMakerCustom/ci.json @@ -1,4 +1,7 @@ { + "targets": { + "esp32": false + }, "fqbn_append": "PartitionScheme=rainmaker_4MB", "requires": [ "CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*" diff --git a/libraries/RainMaker/examples/RMakerSwitch/ci.json b/libraries/RainMaker/examples/RMakerSwitch/ci.json index 1c80eda1d90..ce63fe9ccf0 100644 --- a/libraries/RainMaker/examples/RMakerSwitch/ci.json +++ b/libraries/RainMaker/examples/RMakerSwitch/ci.json @@ -1,4 +1,7 @@ { + "targets": { + "esp32": false + }, "fqbn_append": "PartitionScheme=rainmaker_4MB", "requires": [ "CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*" diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index b0d7c3200d1..19254d11682 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -51,7 +51,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-d4aa25a3-v1" + "version": "idf-release_v5.4-2f7dcd86-v1" }, { "packager": "esp32", @@ -104,63 +104,63 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-d4aa25a3-v1", + "version": "idf-release_v5.4-2f7dcd86-v1", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-d4aa25a3-v1.zip", - "checksum": "SHA-256:81101d580ebafb78f71bd494f4f5162fd829279d18634282c0f8f95c9e928335", - "size": "350941396" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", + "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", + "size": "352347498" } ] }, From de184bd0cbb6f8d6c68497236657a1cb591f5ce4 Mon Sep 17 00:00:00 2001 From: Lewis He Date: Fri, 28 Mar 2025 16:38:31 +0800 Subject: [PATCH 19/56] Update LilyGo variants and add new variants (#11192) * Update LilyGo T-Watch-S3 definition and expansion options * Update LilyGo T-Watch-Ultra definition and expand options * Added variant LilyGo-T-LoRa-Pager * Update partition table order * Update LilyGo board partition table order * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- boards.txt | 175 +++++++++++++++++++- variants/lilygo_tlora_pager/pins_arduino.h | 100 +++++++++++ variants/lilygo_twatch_s3/pins_arduino.h | 7 + variants/lilygo_twatch_ultra/pins_arduino.h | 51 ++++-- 4 files changed, 310 insertions(+), 23 deletions(-) create mode 100644 variants/lilygo_tlora_pager/pins_arduino.h diff --git a/boards.txt b/boards.txt index 9190ee03a63..f0df27762c2 100644 --- a/boards.txt +++ b/boards.txt @@ -6070,10 +6070,12 @@ twatchs3.menu.EraseFlash.none.upload.erase_cmd= twatchs3.menu.EraseFlash.all=Enabled twatchs3.menu.EraseFlash.all.upload.erase_cmd=-e -twatchs3.menu.Revision.Radio_SX1280=Radio-SX1280 -twatchs3.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 twatchs3.menu.Revision.Radio_SX1262=Radio-SX1262 twatchs3.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262 +twatchs3.menu.Revision.Radio_SX1280=Radio-SX1280 +twatchs3.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 +twatchs3.menu.Revision.Radio_CC1101=Radio-CC1101 +twatchs3.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 ############################################################## @@ -6166,12 +6168,12 @@ twatch_ultra.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) twatch_ultra.menu.UploadMode.cdc.upload.use_1200bps_touch=true twatch_ultra.menu.UploadMode.cdc.upload.wait_for_upload_port=true -twatch_ultra.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) -twatch_ultra.menu.PartitionScheme.fatflash.build.partitions=ffat -twatch_ultra.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 twatch_ultra.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) twatch_ultra.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB twatch_ultra.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +twatch_ultra.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +twatch_ultra.menu.PartitionScheme.fatflash.build.partitions=ffat +twatch_ultra.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 twatch_ultra.menu.PartitionScheme.rainmaker=RainMaker twatch_ultra.menu.PartitionScheme.rainmaker.build.partitions=rainmaker twatch_ultra.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 @@ -6233,7 +6235,170 @@ twatch_ultra.menu.Revision.Radio_SX1280=Radio-SX1280 twatch_ultra.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 twatch_ultra.menu.Revision.Radio_SX1262=Radio-SX1262 twatch_ultra.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262 +twatch_ultra.menu.Revision.Radio_CC1101=Radio-CC1101 +twatch_ultra.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 + + +############################################################## + +tlora_pager.name=LilyGo-T-LoRa-Pager + +tlora_pager.bootloader.tool=esptool_py +tlora_pager.bootloader.tool.default=esptool_py + +tlora_pager.upload.tool=esptool_py +tlora_pager.upload.tool.default=esptool_py +tlora_pager.upload.tool.network=esp_ota + +tlora_pager.upload.maximum_size=1310720 +tlora_pager.upload.maximum_data_size=327680 +tlora_pager.upload.flags= +tlora_pager.upload.extra_flags= +tlora_pager.upload.use_1200bps_touch=false +tlora_pager.upload.wait_for_upload_port=false + +tlora_pager.serial.disableDTR=false +tlora_pager.serial.disableRTS=false + +tlora_pager.build.tarch=xtensa +tlora_pager.build.bootloader_addr=0x0 +tlora_pager.build.target=esp32s3 +tlora_pager.build.mcu=esp32s3 +tlora_pager.build.core=esp32 +tlora_pager.build.variant=lilygo_tlora_pager +tlora_pager.build.board=T_LORA_PAGER + +tlora_pager.build.usb_mode=1 +tlora_pager.build.cdc_on_boot=1 +tlora_pager.build.msc_on_boot=0 +tlora_pager.build.dfu_on_boot=0 +tlora_pager.build.f_cpu=240000000L +tlora_pager.build.flash_size=16MB +tlora_pager.build.flash_freq=80m +tlora_pager.build.flash_mode=dio +tlora_pager.build.boot=qio +tlora_pager.build.boot_freq=80m +tlora_pager.build.partitions=app3M_fat9M_16MB +tlora_pager.build.defines=-DBOARD_HAS_PSRAM -DARDUINO_T_LORA_PAGER +tlora_pager.build.loop_core= +tlora_pager.build.event_core= +tlora_pager.build.psram_type=qspi +tlora_pager.build.memory_type={build.boot}_{build.psram_type} +## IDE 2.0 Seems to not update the value +tlora_pager.menu.JTAGAdapter.default=Disabled +tlora_pager.menu.JTAGAdapter.default.build.copy_jtag_files=0 +tlora_pager.menu.JTAGAdapter.builtin=Integrated USB JTAG +tlora_pager.menu.JTAGAdapter.builtin.build.openocdscript=esp32s3-builtin.cfg +tlora_pager.menu.JTAGAdapter.builtin.build.copy_jtag_files=1 + +tlora_pager.menu.LoopCore.1=Core 1 +tlora_pager.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +tlora_pager.menu.LoopCore.0=Core 0 +tlora_pager.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +tlora_pager.menu.EventsCore.1=Core 1 +tlora_pager.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +tlora_pager.menu.EventsCore.0=Core 0 +tlora_pager.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +tlora_pager.menu.USBMode.hwcdc=Hardware CDC and JTAG +tlora_pager.menu.USBMode.hwcdc.build.usb_mode=1 +tlora_pager.menu.USBMode.default=USB-OTG (TinyUSB) +tlora_pager.menu.USBMode.default.build.usb_mode=0 + +tlora_pager.menu.CDCOnBoot.default=Enabled +tlora_pager.menu.CDCOnBoot.default.build.cdc_on_boot=1 +tlora_pager.menu.CDCOnBoot.cdc=Disabled +tlora_pager.menu.CDCOnBoot.cdc.build.cdc_on_boot=0 + +tlora_pager.menu.MSCOnBoot.default=Disabled +tlora_pager.menu.MSCOnBoot.default.build.msc_on_boot=0 +tlora_pager.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +tlora_pager.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +tlora_pager.menu.DFUOnBoot.default=Disabled +tlora_pager.menu.DFUOnBoot.default.build.dfu_on_boot=0 +tlora_pager.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +tlora_pager.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +tlora_pager.menu.UploadMode.default=UART0 / Hardware CDC +tlora_pager.menu.UploadMode.default.upload.use_1200bps_touch=false +tlora_pager.menu.UploadMode.default.upload.wait_for_upload_port=false +tlora_pager.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +tlora_pager.menu.UploadMode.cdc.upload.use_1200bps_touch=true +tlora_pager.menu.UploadMode.cdc.upload.wait_for_upload_port=true + +tlora_pager.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +tlora_pager.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +tlora_pager.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +tlora_pager.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +tlora_pager.menu.PartitionScheme.fatflash.build.partitions=ffat +tlora_pager.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +tlora_pager.menu.PartitionScheme.rainmaker=RainMaker +tlora_pager.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +tlora_pager.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 +tlora_pager.menu.PartitionScheme.esp_sr_16=ESP SR 16M (3MB APP/7MB SPIFFS/2.9MB MODEL) +tlora_pager.menu.PartitionScheme.esp_sr_16.upload.maximum_size=3145728 +tlora_pager.menu.PartitionScheme.esp_sr_16.upload.extra_flags=0xD10000 {build.path}/srmodels.bin +tlora_pager.menu.PartitionScheme.esp_sr_16.build.partitions=esp_sr_16 +tlora_pager.menu.PartitionScheme.custom=Custom +tlora_pager.menu.PartitionScheme.custom.build.partitions= +tlora_pager.menu.PartitionScheme.custom.upload.maximum_size=16777216 + +tlora_pager.menu.CPUFreq.240=240MHz (WiFi) +tlora_pager.menu.CPUFreq.240.build.f_cpu=240000000L +tlora_pager.menu.CPUFreq.160=160MHz (WiFi) +tlora_pager.menu.CPUFreq.160.build.f_cpu=160000000L +tlora_pager.menu.CPUFreq.80=80MHz (WiFi) +tlora_pager.menu.CPUFreq.80.build.f_cpu=80000000L +tlora_pager.menu.CPUFreq.40=40MHz +tlora_pager.menu.CPUFreq.40.build.f_cpu=40000000L +tlora_pager.menu.CPUFreq.20=20MHz +tlora_pager.menu.CPUFreq.20.build.f_cpu=20000000L +tlora_pager.menu.CPUFreq.10=10MHz +tlora_pager.menu.CPUFreq.10.build.f_cpu=10000000L + +tlora_pager.menu.UploadSpeed.921600=921600 +tlora_pager.menu.UploadSpeed.921600.upload.speed=921600 +tlora_pager.menu.UploadSpeed.115200=115200 +tlora_pager.menu.UploadSpeed.115200.upload.speed=115200 +tlora_pager.menu.UploadSpeed.256000.windows=256000 +tlora_pager.menu.UploadSpeed.256000.upload.speed=256000 +tlora_pager.menu.UploadSpeed.230400.windows.upload.speed=256000 +tlora_pager.menu.UploadSpeed.230400=230400 +tlora_pager.menu.UploadSpeed.230400.upload.speed=230400 +tlora_pager.menu.UploadSpeed.460800.linux=460800 +tlora_pager.menu.UploadSpeed.460800.macosx=460800 +tlora_pager.menu.UploadSpeed.460800.upload.speed=460800 +tlora_pager.menu.UploadSpeed.512000.windows=512000 +tlora_pager.menu.UploadSpeed.512000.upload.speed=512000 + +tlora_pager.menu.DebugLevel.none=None +tlora_pager.menu.DebugLevel.none.build.code_debug=0 +tlora_pager.menu.DebugLevel.error=Error +tlora_pager.menu.DebugLevel.error.build.code_debug=1 +tlora_pager.menu.DebugLevel.warn=Warn +tlora_pager.menu.DebugLevel.warn.build.code_debug=2 +tlora_pager.menu.DebugLevel.info=Info +tlora_pager.menu.DebugLevel.info.build.code_debug=3 +tlora_pager.menu.DebugLevel.debug=Debug +tlora_pager.menu.DebugLevel.debug.build.code_debug=4 +tlora_pager.menu.DebugLevel.verbose=Verbose +tlora_pager.menu.DebugLevel.verbose.build.code_debug=5 + +tlora_pager.menu.EraseFlash.none=Disabled +tlora_pager.menu.EraseFlash.none.upload.erase_cmd= +tlora_pager.menu.EraseFlash.all=Enabled +tlora_pager.menu.EraseFlash.all.upload.erase_cmd=-e + + +tlora_pager.menu.Revision.Radio_SX1280=Radio-SX1280 +tlora_pager.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 +tlora_pager.menu.Revision.Radio_SX1262=Radio-SX1262 +tlora_pager.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262 +tlora_pager.menu.Revision.Radio_CC1101=Radio-CC1101 +tlora_pager.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 ############################################################## diff --git a/variants/lilygo_tlora_pager/pins_arduino.h b/variants/lilygo_tlora_pager/pins_arduino.h new file mode 100644 index 00000000000..1a1d8e5da3f --- /dev/null +++ b/variants/lilygo_tlora_pager/pins_arduino.h @@ -0,0 +1,100 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#ifndef digitalPinToInterrupt +#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) +#endif + +#define USB_VID 0x303a +#define USB_PID 0x82D1 +#define USB_MANUFACTURER "LILYGO" +#define USB_PRODUCT "T-LoRa-Pager" + +// ST7796 +#define DISP_WIDTH (222) +#define DISP_HEIGHT (480) +#define SD_CS (21) + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +//BHI260,PCF85063,BQ25896,DRV2605L,ES8311 share I2C Bus +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; + +// Default sd cs pin +static const uint8_t SS = SD_CS; +static const uint8_t MOSI = 34; +static const uint8_t MISO = 33; +static const uint8_t SCK = 35; + +#define KB_INT (6) +#define KB_BACKLIGHT (46) + +// Rotary +#define ROTARY_A (40) +#define ROTARY_B (41) +#define ROTARY_C (7) + +// Interrupt IO port +#define RTC_INT (1) +#define NFC_INT (5) +#define SENSOR_INT (8) +#define NFC_CS (39) + +// ES8311 +#define I2S_WS (18) +#define I2S_SCK (11) +#define I2S_MCLK (10) +#define I2S_SDOUT (45) +#define I2S_SDIN (17) + +// GPS +#define GPS_TX (12) +#define GPS_RX (4) +#define GPS_PPS (13) + +// LoRa, SD, ST25R3916 card share SPI bus +#define LORA_SCK (SCK) // share spi bus +#define LORA_MISO (MISO) // share spi bus +#define LORA_MOSI (MOSI) // share spi bus +#define LORA_CS (36) +#define LORA_RST (47) +#define LORA_BUSY (48) +#define LORA_IRQ (14) + +// SPI interface display +#define DISP_MOSI (MOSI) +#define DISP_MISO (MISO) +#define DISP_SCK (SCK) +#define DISP_RST (-1) +#define DISP_CS (38) +#define DISP_DC (37) +#define DISP_BL (42) + +// External expansion chip IO definition +#define EXPANDS_DRV_EN (0) +#define EXPANDS_AMP_EN (1) +#define EXPANDS_KB_RST (2) +#define EXPANDS_LORA_EN (3) +#define EXPANDS_GPS_EN (4) +#define EXPANDS_NFC_EN (5) +#define EXPANDS_DISP_RST (6) +#define EXPANDS_GPS_RST (7) +#define EXPANDS_KB_EN (8) +#define EXPANDS_GPIO_EN (9) + +// Peripheral definition exists +#define USING_AUDIO_CODEC +#define USING_XL9555_EXPANDS +#define USING_PPM_MANAGE +#define USING_BQ_GAUGE +#define USING_INPUT_DEV_ROTARY +#define USING_INPUT_DEV_KEYBOARD +#define USING_ST25R3916 +#define USING_BHI260_SENSOR +#define HAS_SD_CARD_SOCKET + +#endif /* Pins_Arduino_h */ diff --git a/variants/lilygo_twatch_s3/pins_arduino.h b/variants/lilygo_twatch_s3/pins_arduino.h index 59434161d98..b184dc9ba17 100644 --- a/variants/lilygo_twatch_s3/pins_arduino.h +++ b/variants/lilygo_twatch_s3/pins_arduino.h @@ -66,4 +66,11 @@ static const uint8_t SCK = 3; #define GPS_TX (TX) #define GPS_RX (RX) +// Peripheral definition exists +#define USING_PCM_AMPLIFIER +#define USING_PDM_MICROPHONE +#define USING_PMU_MANAGE +#define USING_INPUT_DEV_TOUCHPAD +#define USING_IR_REMOTE + #endif /* Pins_Arduino_h */ diff --git a/variants/lilygo_twatch_ultra/pins_arduino.h b/variants/lilygo_twatch_ultra/pins_arduino.h index 57f6c2c3fea..c90c1ba584e 100644 --- a/variants/lilygo_twatch_ultra/pins_arduino.h +++ b/variants/lilygo_twatch_ultra/pins_arduino.h @@ -12,27 +12,25 @@ #define USB_MANUFACTURER "LILYGO" #define USB_PRODUCT "T-Watch-Ultra" -#define DISP_WIDTH (240) -#define DISP_HEIGHT (296) - -#define DISP_D0 (39) -#define DISP_D1 (40) -#define DISP_D2 (45) -#define DISP_D3 (42) -#define DISP_SCK (41) -#define DISP_RST (6) -#define DISP_CS (38) -#define DISP_TE (37) - -// touch screen -#define TP_INT (12) -#define TP_RST (46) +#define DISP_WIDTH 502 +#define DISP_HEIGHT 410 + +// QSPI interface display +#define DISP_D0 (38) +#define DISP_D1 (39) +#define DISP_D2 (42) +#define DISP_D3 (45) +#define DISP_SCK (40) +#define DISP_CS (41) +#define DISP_TE (6) + // Interrupt IO port +#define TP_INT (12) #define RTC_INT (1) #define PMU_INT (7) #define NFC_INT (5) #define SENSOR_INT (8) -#define NFC_RST (4) +#define NFC_CS (4) // PDM microphone #define MIC_SCK (17) @@ -59,8 +57,9 @@ static const uint8_t MOSI = 34; static const uint8_t MISO = 33; static const uint8_t SCK = 35; -#define GPS_TX (TX) -#define GPS_RX (RX) +#define GPS_TX (TX) +#define GPS_RX (RX) +#define GPS_PPS (13) #define TP_SDA (SDA) #define TP_SCL (SCL) @@ -74,4 +73,20 @@ static const uint8_t SCK = 35; #define LORA_BUSY (48) #define LORA_IRQ (14) +// External expansion chip IO definition +#define EXPANDS_DRV_EN (6) +#define EXPANDS_DISP_EN (7) +#define EXPANDS_TOUCH_RST (10) +#define EXPANDS_DISP_RST (11) + +// Peripheral definition exists +#define USING_XL9555_EXPANDS +#define USING_PCM_AMPLIFIER +#define USING_PDM_MICROPHONE +#define USING_PMU_MANAGE +#define USING_INPUT_DEV_TOUCHPAD +#define USING_ST25R3916 +#define USING_BHI260_SENSOR +#define HAS_SD_CARD_SOCKET + #endif /* Pins_Arduino_h */ From fbca62fd6889b31a686f8bd8bca05358796efe28 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Sat, 29 Mar 2025 14:13:57 +0200 Subject: [PATCH 20/56] Update Issue-report.yml with the latest versions --- .github/ISSUE_TEMPLATE/Issue-report.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Issue-report.yml b/.github/ISSUE_TEMPLATE/Issue-report.yml index a902184f06b..1229df2d947 100644 --- a/.github/ISSUE_TEMPLATE/Issue-report.yml +++ b/.github/ISSUE_TEMPLATE/Issue-report.yml @@ -39,8 +39,11 @@ body: label: Version description: What version of Arduino ESP32 are you running? If possible, consider updating to the latest version. options: - - latest master (checkout manually) + - latest stable Release (if not listed below) - latest development Release Candidate (RC-X) + - latest master (checkout manually) + - v3.2.0 + - v3.1.3 - v3.1.2 - v3.1.1 - v3.1.0 From 7b0298b4621561e62c248fed7318406677a8a4e2 Mon Sep 17 00:00:00 2001 From: Lewis He Date: Mon, 31 Mar 2025 16:06:18 +0800 Subject: [PATCH 21/56] Modify T-LoRa-Pager device PID (#11194) Co-authored-by: Sugar Glider --- variants/lilygo_tlora_pager/pins_arduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/lilygo_tlora_pager/pins_arduino.h b/variants/lilygo_tlora_pager/pins_arduino.h index 1a1d8e5da3f..a7e03c759bd 100644 --- a/variants/lilygo_tlora_pager/pins_arduino.h +++ b/variants/lilygo_tlora_pager/pins_arduino.h @@ -8,7 +8,7 @@ #endif #define USB_VID 0x303a -#define USB_PID 0x82D1 +#define USB_PID 0x82D4 #define USB_MANUFACTURER "LILYGO" #define USB_PRODUCT "T-LoRa-Pager" From 22f07d01c88009ba707e30f04b1d2687aec14286 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 1 Apr 2025 09:36:19 -0300 Subject: [PATCH 22/56] fix(rmt): memset all config structs to zero before using (#11203) * fix(rmt): memset all config structs to zero to increase code safety --- cores/esp32/esp32-hal-rmt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cores/esp32/esp32-hal-rmt.c b/cores/esp32/esp32-hal-rmt.c index e3877b5ff48..7bca1a1b529 100644 --- a/cores/esp32/esp32-hal-rmt.c +++ b/cores/esp32/esp32-hal-rmt.c @@ -206,7 +206,8 @@ bool rmtSetCarrier(int pin, bool carrier_en, bool carrier_level, uint32_t freque log_w("GPIO %d - RMT Carrier must be a float percentage from 0 to 1. Setting to 50%.", pin); duty_percent = 0.5; } - rmt_carrier_config_t carrier_cfg = {0}; + rmt_carrier_config_t carrier_cfg; + memset((void *)&carrier_cfg, 0, sizeof(rmt_carrier_config_t)); carrier_cfg.duty_cycle = duty_percent; // duty cycle carrier_cfg.frequency_hz = carrier_en ? frequency_Hz : 0; // carrier frequency in Hz carrier_cfg.flags.polarity_active_low = carrier_level; // carrier modulation polarity level @@ -313,7 +314,8 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl return false; } - rmt_transmit_config_t transmit_cfg = {0}; // loop mode disabled + rmt_transmit_config_t transmit_cfg; // loop mode disabled + memset((void *)&transmit_cfg, 0, sizeof(rmt_transmit_config_t)); bool retCode = true; RMT_MUTEX_LOCK(bus); @@ -380,6 +382,7 @@ static bool _rmtRead(int pin, rmt_data_t *data, size_t *num_rmt_symbols, bool wa // request reading RMT Channel Data rmt_receive_config_t receive_config; + memset((void *)&receive_config, 0, sizeof(rmt_receive_config_t)); receive_config.signal_range_min_ns = bus->signal_range_min_ns; receive_config.signal_range_max_ns = bus->signal_range_max_ns; @@ -530,6 +533,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ if (channel_direction == RMT_TX_MODE) { // TX Channel rmt_tx_channel_config_t tx_cfg; + memset((void *)&tx_cfg, 0, sizeof(rmt_tx_channel_config_t)); tx_cfg.gpio_num = pin; // CLK_APB for ESP32|S2|S3|C3 -- CLK_PLL_F80M for C6 -- CLK_XTAL for H2 tx_cfg.clk_src = RMT_CLK_SRC_DEFAULT; @@ -559,6 +563,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ } else { // RX Channel rmt_rx_channel_config_t rx_cfg; + memset((void *)&rx_cfg, 0, sizeof(rmt_rx_channel_config_t)); rx_cfg.gpio_num = pin; // CLK_APB for ESP32|S2|S3|C3 -- CLK_PLL_F80M for C6 -- CLK_XTAL for H2 rx_cfg.clk_src = RMT_CLK_SRC_DEFAULT; @@ -585,7 +590,8 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_ } // allocate memory for the RMT Copy encoder - rmt_copy_encoder_config_t copy_encoder_config = {}; + rmt_copy_encoder_config_t copy_encoder_config; + memset((void *)©_encoder_config, 0, sizeof(rmt_copy_encoder_config_t)); if (rmt_new_copy_encoder(©_encoder_config, &bus->rmt_copy_encoder_h) != ESP_OK) { log_e("GPIO %d - RMT Encoder Memory Allocation error.", pin); goto Err; From 23ded939ead68c5bbb608218aedc29a0499159a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Sat, 5 Apr 2025 17:46:20 +0200 Subject: [PATCH 23/56] feat(zigbee): Add PM2.5 endpoint support (#11205) * feat(zigbee): Add PM2.5 endpoint support * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- CMakeLists.txt | 1 + .../examples/Zigbee_PM25_Sensor/README.md | 72 +++++++++++ .../Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.ino | 109 ++++++++++++++++ .../examples/Zigbee_PM25_Sensor/ci.json | 7 ++ libraries/Zigbee/src/Zigbee.h | 28 +++-- libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp | 118 ++++++++++++++++++ libraries/Zigbee/src/ep/ZigbeePM25Sensor.h | 60 +++++++++ 7 files changed, 384 insertions(+), 11 deletions(-) create mode 100644 libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.md create mode 100644 libraries/Zigbee/examples/Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.ino create mode 100644 libraries/Zigbee/examples/Zigbee_PM25_Sensor/ci.json create mode 100644 libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp create mode 100644 libraries/Zigbee/src/ep/ZigbeePM25Sensor.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7539601d9e5..14fcb19b6da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,6 +300,7 @@ set(ARDUINO_LIBRARY_Zigbee_SRCS libraries/Zigbee/src/ep/ZigbeeGateway.cpp libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp + libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp ) set(ARDUINO_LIBRARY_BLE_SRCS diff --git a/libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.md b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.md new file mode 100644 index 00000000000..51bf11459b7 --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/README.md @@ -0,0 +1,72 @@ +# Arduino-ESP32 PM2.5 Sensor + +This example shows how to configure the Zigbee end device and use it as a Home Automation (HA) simple sensor device type with particulate matter (PM2.5) measuring + +# Supported Targets + +Currently, this example supports the following targets. + +| Supported Targets | ESP32-C6 | ESP32-H2 | +| ----------------- | -------- | -------- | + +## Pressure + Flow Sensor Functions + + * After this board first starts up, it would be configured locally to report the PM2.5 on every 30 seconds. + * By clicking the button (BOOT) on this board, this board will immediately send a report of the current PM2.5 to the network. + +## Hardware Required + +* A USB cable for power supply and programming + +### Configure the Project + +In this example, the internal temperature sensor is used to demonstrate reading of the PM2.5 sensors. +Set the Button GPIO by changing the `button` variable. By default, it's the pin `BOOT_PIN` (BOOT button on ESP32-C6 and ESP32-H2). + +#### Using Arduino IDE + +To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits). + +* Before Compile/Verify, select the correct board: `Tools -> Board`. +* Select the End device Zigbee mode: `Tools -> Zigbee mode: Zigbee ED (end device)` +* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs` +* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port. +* Optional: Set debug level to verbose to see all logs from Zigbee stack: `Tools -> Core Debug Level: Verbose`. + +## Troubleshooting + +If the End device flashed with this example is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board. It is recommended to do this if you re-flash the coordinator. +You can do the following: + +* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`. +* Add to the sketch `Zigbee.factoryReset();` to reset the device and Zigbee stack. + +By default, the coordinator network is closed after rebooting or flashing new firmware. +To open the network you have 2 options: + +* Open network after reboot by setting `Zigbee.setRebootOpenNetwork(time);` before calling `Zigbee.begin();`. +* In application you can anytime call `Zigbee.openNetwork(time);` to open the network for devices to join. + +***Important: Make sure you are using a good quality USB cable and that you have a reliable power source*** + +* **LED not blinking:** Check the wiring connection and the IO selection. +* **Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed. +* **COM port not detected:** Check the USB cable and the USB to Serial driver installation. + +If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute). + +## Contribute + +To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst) + +If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome! + +Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else. + +## Resources + +* Official ESP32 Forum: [Link](https://esp32.com) +* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32) +* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) +* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) +* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com) diff --git a/libraries/Zigbee/examples/Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.ino b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.ino new file mode 100644 index 00000000000..a98d697f700 --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/Zigbee_PM25_Sensor.ino @@ -0,0 +1,109 @@ +// Copyright 2024 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @brief This example demonstrates Zigbee PM2.5 sensor. + * + * The example demonstrates how to use Zigbee library to create a end device PM2.5 sensor. + * + * Proper Zigbee mode must be selected in Tools->Zigbee mode + * and also the correct partition scheme must be selected in Tools->Partition Scheme. + * + * Please check the README.md for instructions and more detailed description. + * + * Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/) + */ + +#ifndef ZIGBEE_MODE_ED +#error "Zigbee end device mode is not selected in Tools->Zigbee mode" +#endif + +#include "Zigbee.h" + +/* Zigbee PM2.5 sensor configuration */ +#define PM2_5_SENSOR_ENDPOINT_NUMBER 1 +uint8_t button = BOOT_PIN; + +ZigbeePM25Sensor zbPM25Sensor = ZigbeePM25Sensor(PM2_5_SENSOR_ENDPOINT_NUMBER); + +void setup() { + Serial.begin(115200); + + // Init button switch + pinMode(button, INPUT_PULLUP); + + // Optional: set Zigbee device name and model + zbPM25Sensor.setManufacturerAndModel("Espressif", "ZigbeePM25Sensor"); + + // Set minimum and maximum PM2.5 measurement value in µg/m³ + zbPM25Sensor.setMinMaxValue(0, 350); + + // Set tolerance for PM2.5 measurement in µg/m³ + zbPM25Sensor.setTolerance(0.1); + + // Add endpoints to Zigbee Core + Zigbee.addEndpoint(&zbPM25Sensor); + + Serial.println("Starting Zigbee..."); + // When all EPs are registered, start Zigbee in End Device mode + if (!Zigbee.begin()) { + Serial.println("Zigbee failed to start!"); + Serial.println("Rebooting..."); + ESP.restart(); + } else { + Serial.println("Zigbee started successfully!"); + } + Serial.println("Connecting to network"); + while (!Zigbee.connected()) { + Serial.print("."); + delay(100); + } + Serial.println(); + + // Set reporting interval for PM2.5 measurement to be done every 30 seconds, must be called after Zigbee.begin() + // min_interval and max_interval in seconds, delta (PM2.5 change in µg/m³) + // if min = 1 and max = 0, reporting is sent only when PM2.5 changes by delta + // if min = 0 and max = 10, reporting is sent every 10 seconds or when PM2.5 changes by delta + // if min = 0, max = 10 and delta = 0, reporting is sent every 10 seconds regardless of delta change + zbPM25Sensor.setReporting(0, 30, 0); +} + +void loop() { + static uint32_t timeCounter = 0; + // Read PM2.5 sensor every 2s + if (!(timeCounter++ % 20)) { // delaying for 100ms x 20 = 2s + // Read sensor value - here is chip temperature used + 50 as a dummy value for demonstration + float pm25_value = 50.5 + temperatureRead(); + Serial.printf("Updating PM2.5 sensor value to %0.1f µg/m³\r\n", pm25_value); + zbPM25Sensor.setPM25(pm25_value); + } + + // Checking button for factory reset and reporting + if (digitalRead(button) == LOW) { // Push button pressed + // Key debounce handling + delay(100); + int startTime = millis(); + while (digitalRead(button) == LOW) { + delay(50); + if ((millis() - startTime) > 3000) { + // If key pressed for more than 3secs, factory reset Zigbee and reboot + Serial.println("Resetting Zigbee to factory and rebooting in 1s."); + delay(1000); + Zigbee.factoryReset(); + } + } + zbPM25Sensor.report(); + } + delay(100); +} diff --git a/libraries/Zigbee/examples/Zigbee_PM25_Sensor/ci.json b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/ci.json new file mode 100644 index 00000000000..ceacc367801 --- /dev/null +++ b/libraries/Zigbee/examples/Zigbee_PM25_Sensor/ci.json @@ -0,0 +1,7 @@ +{ + "fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed", + "requires": [ + "CONFIG_SOC_IEEE802154_SUPPORTED=y", + "CONFIG_ZB_ENABLED=y" + ] +} diff --git a/libraries/Zigbee/src/Zigbee.h b/libraries/Zigbee/src/Zigbee.h index ea42e9dd41a..7f44d7813af 100644 --- a/libraries/Zigbee/src/Zigbee.h +++ b/libraries/Zigbee/src/Zigbee.h @@ -7,23 +7,29 @@ #include "ZigbeeEP.h" // Endpoints -#include "ep/ZigbeeLight.h" +//// Switches +#include "ep/ZigbeeColorDimmerSwitch.h" #include "ep/ZigbeeSwitch.h" -#include "ep/ZigbeeDimmableLight.h" +//// Lights #include "ep/ZigbeeColorDimmableLight.h" -#include "ep/ZigbeeColorDimmerSwitch.h" -#include "ep/ZigbeeTempSensor.h" +#include "ep/ZigbeeDimmableLight.h" +#include "ep/ZigbeeLight.h" +//// Controllers #include "ep/ZigbeeThermostat.h" -#include "ep/ZigbeePressureSensor.h" +//// Sensors #include "ep/ZigbeeAnalog.h" -#include "ep/ZigbeeFlowSensor.h" -#include "ep/ZigbeeOccupancySensor.h" -#include "ep/ZigbeeIlluminanceSensor.h" #include "ep/ZigbeeCarbonDioxideSensor.h" #include "ep/ZigbeeContactSwitch.h" #include "ep/ZigbeeDoorWindowHandle.h" -#include "ep/ZigbeeWindowCovering.h" +#include "ep/ZigbeeFlowSensor.h" +#include "ep/ZigbeeIlluminanceSensor.h" +#include "ep/ZigbeeOccupancySensor.h" +#include "ep/ZigbeePM25Sensor.h" +#include "ep/ZigbeePressureSensor.h" +#include "ep/ZigbeeTempSensor.h" #include "ep/ZigbeeVibrationSensor.h" -#include "ep/ZigbeeRangeExtender.h" -#include "ep/ZigbeeGateway.h" #include "ep/ZigbeeWindSpeedSensor.h" +#include "ep/ZigbeeWindowCovering.h" +//// Other +#include "ep/ZigbeeGateway.h" +#include "ep/ZigbeeRangeExtender.h" diff --git a/libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp b/libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp new file mode 100644 index 00000000000..d25d15e5de3 --- /dev/null +++ b/libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp @@ -0,0 +1,118 @@ +#include "ZigbeePM25Sensor.h" +#if CONFIG_ZB_ENABLED + +esp_zb_cluster_list_t *zigbee_pm2_5_sensor_clusters_create(zigbee_pm2_5_sensor_cfg_t *pm2_5_sensor) { + esp_zb_basic_cluster_cfg_t *basic_cfg = pm2_5_sensor ? &(pm2_5_sensor->basic_cfg) : NULL; + esp_zb_identify_cluster_cfg_t *identify_cfg = pm2_5_sensor ? &(pm2_5_sensor->identify_cfg) : NULL; + esp_zb_pm2_5_measurement_cluster_cfg_t *pm2_5_meas_cfg = pm2_5_sensor ? &(pm2_5_sensor->pm2_5_meas_cfg) : NULL; + esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create(); + esp_zb_cluster_list_add_basic_cluster(cluster_list, esp_zb_basic_cluster_create(basic_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(identify_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_list_add_pm2_5_measurement_cluster(cluster_list, esp_zb_pm2_5_measurement_cluster_create(pm2_5_meas_cfg), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + return cluster_list; +} + +ZigbeePM25Sensor::ZigbeePM25Sensor(uint8_t endpoint) : ZigbeeEP(endpoint) { + _device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID; + + //Create custom PM2.5 sensor configuration + zigbee_pm2_5_sensor_cfg_t pm2_5_sensor_cfg = ZIGBEE_DEFAULT_PM2_5_SENSOR_CONFIG(); + _cluster_list = zigbee_pm2_5_sensor_clusters_create(&pm2_5_sensor_cfg); + + _ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0}; +} + +bool ZigbeePM25Sensor::setMinMaxValue(float min, float max) { + esp_zb_attribute_list_t *pm2_5_measure_cluster = + esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_err_t ret = esp_zb_cluster_update_attr(pm2_5_measure_cluster, ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_MIN_MEASURED_VALUE_ID, (void *)&min); + if (ret != ESP_OK) { + log_e("Failed to set min value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + ret = esp_zb_cluster_update_attr(pm2_5_measure_cluster, ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_MAX_MEASURED_VALUE_ID, (void *)&max); + if (ret != ESP_OK) { + log_e("Failed to set max value: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; +} + +bool ZigbeePM25Sensor::setTolerance(float tolerance) { + esp_zb_attribute_list_t *pm2_5_measure_cluster = + esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_err_t ret = esp_zb_pm2_5_measurement_cluster_add_attr(pm2_5_measure_cluster, ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_TOLERANCE_ID, (void *)&tolerance); + if (ret != ESP_OK) { + log_e("Failed to set tolerance: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; +} + +bool ZigbeePM25Sensor::setReporting(uint16_t min_interval, uint16_t max_interval, float delta) { + esp_zb_zcl_reporting_info_t reporting_info; + memset(&reporting_info, 0, sizeof(esp_zb_zcl_reporting_info_t)); + reporting_info.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV; + reporting_info.ep = _endpoint; + reporting_info.cluster_id = ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT; + reporting_info.cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE; + reporting_info.attr_id = ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_MEASURED_VALUE_ID; + reporting_info.u.send_info.min_interval = min_interval; + reporting_info.u.send_info.max_interval = max_interval; + reporting_info.u.send_info.def_min_interval = min_interval; + reporting_info.u.send_info.def_max_interval = max_interval; + // reporting_info.u.send_info.delta.u16 = (uint16_t)(delta * 100); // Convert delta to ZCL uint16_t + reporting_info.dst.profile_id = ESP_ZB_AF_HA_PROFILE_ID; + reporting_info.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + float delta_f = delta; + memcpy(&reporting_info.u.send_info.delta.s32, &delta_f, sizeof(float)); + + esp_zb_lock_acquire(portMAX_DELAY); + esp_err_t ret = esp_zb_zcl_update_reporting_info(&reporting_info); + esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to set reporting: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + return true; +} + +bool ZigbeePM25Sensor::setPM25(float pm25) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; + log_v("Updating PM2.5 sensor value..."); + /* Update PM2.5 sensor measured value */ + log_d("Setting PM2.5 to %0.1f", pm25); + esp_zb_lock_acquire(portMAX_DELAY); + ret = esp_zb_zcl_set_attribute_val( + _endpoint, ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_MEASURED_VALUE_ID, &pm25, false + ); + esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set PM2.5: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + return true; +} + +bool ZigbeePM25Sensor::report() { + /* Send report attributes command */ + esp_zb_zcl_report_attr_cmd_t report_attr_cmd; + report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; + report_attr_cmd.attributeID = ESP_ZB_ZCL_ATTR_PM2_5_MEASUREMENT_MEASURED_VALUE_ID; + report_attr_cmd.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_CLI; + report_attr_cmd.clusterID = ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT; + report_attr_cmd.zcl_basic_cmd.src_endpoint = _endpoint; + report_attr_cmd.manuf_code = ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC; + + esp_zb_lock_acquire(portMAX_DELAY); + esp_err_t ret = esp_zb_zcl_report_attr_cmd_req(&report_attr_cmd); + esp_zb_lock_release(); + if (ret != ESP_OK) { + log_e("Failed to send PM2.5 report: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } + log_v("PM2.5 report sent"); + return true; +} + +#endif // CONFIG_ZB_ENABLED diff --git a/libraries/Zigbee/src/ep/ZigbeePM25Sensor.h b/libraries/Zigbee/src/ep/ZigbeePM25Sensor.h new file mode 100644 index 00000000000..344f3e1f479 --- /dev/null +++ b/libraries/Zigbee/src/ep/ZigbeePM25Sensor.h @@ -0,0 +1,60 @@ +/* Class of Zigbee PM2.5 sensor endpoint inherited from common EP class */ + +#pragma once + +#include "soc/soc_caps.h" +#include "sdkconfig.h" +#if CONFIG_ZB_ENABLED + +#include "ZigbeeEP.h" +#include "ha/esp_zigbee_ha_standard.h" + +// clang-format off +#define ZIGBEE_DEFAULT_PM2_5_SENSOR_CONFIG() \ + { \ + .basic_cfg = \ + { \ + .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \ + .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \ + }, \ + .identify_cfg = \ + { \ + .identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \ + }, \ + .pm2_5_meas_cfg = \ + { \ + .measured_value = 0.0, \ + .min_measured_value = 0.0, \ + .max_measured_value = 500.0, \ + }, \ + } +// clang-format on + +typedef struct zigbee_pm2_5_sensor_cfg_s { + esp_zb_basic_cluster_cfg_t basic_cfg; + esp_zb_identify_cluster_cfg_t identify_cfg; + esp_zb_pm2_5_measurement_cluster_cfg_t pm2_5_meas_cfg; +} zigbee_pm2_5_sensor_cfg_t; + +class ZigbeePM25Sensor : public ZigbeeEP { +public: + ZigbeePM25Sensor(uint8_t endpoint); + ~ZigbeePM25Sensor() {} + + // Set the PM2.5 value in 0.1 µg/m³ + bool setPM25(float pm25); + + // Set the min and max value for the PM2.5 sensor in 0.1 µg/m³ + bool setMinMaxValue(float min, float max); + + // Set the tolerance value for the PM2.5 sensor in 0.1 µg/m³ + bool setTolerance(float tolerance); + + // Set the reporting interval for PM2.5 measurement in seconds and delta (PM2.5 change in 0.1 µg/m³) + bool setReporting(uint16_t min_interval, uint16_t max_interval, float delta); + + // Report the PM2.5 value + bool report(); +}; + +#endif // CONFIG_ZB_ENABLED From b333bf2697463f76e98640d4421dfd1560482c1f Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Sat, 5 Apr 2025 12:47:38 -0300 Subject: [PATCH 24/56] fix(zigbeeEP): review of names and memory allocation (#11199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(zigbeeEP): review of names and memory allocation * fix(zigbeeEP): destructor shall free any allocated memory * fix(zigbee_ep): forgotten var name change * feat(zigbee_ep): use static heap memory for manufacturer and model names * feat(zigbee_ep): changed model and manufacturer to heap * feat(zigbee_ep): use static heap memory allocation * fix(zigbee_ep): using stack only for adding attribute * feat(zigbee_ep): reverting back read data type * fix(zigbee_ep): rooling back to use malloc for remote attr reading * feat(zigbee_ep): check malloc return for null * fix(zigbee_ep): replace nullptr by NULL after C malloc() * ci(pre-commit): Apply automatic fixes * fix(zigbee_ep): fix variable scope Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(zigbee_ep): fix variable scope Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- libraries/Zigbee/src/ZigbeeEP.cpp | 59 +++++++++++++++++++------------ libraries/Zigbee/src/ZigbeeEP.h | 4 +++ 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/libraries/Zigbee/src/ZigbeeEP.cpp b/libraries/Zigbee/src/ZigbeeEP.cpp index e7d507dc441..338a4107cf2 100644 --- a/libraries/Zigbee/src/ZigbeeEP.cpp +++ b/libraries/Zigbee/src/ZigbeeEP.cpp @@ -19,6 +19,8 @@ ZigbeeEP::ZigbeeEP(uint8_t endpoint) { _ep_config.endpoint = 0; _cluster_list = nullptr; _on_identify = nullptr; + _read_model = NULL; + _read_manufacturer = NULL; _time_status = 0; if (!lock) { lock = xSemaphoreCreateBinary(); @@ -33,16 +35,23 @@ void ZigbeeEP::setVersion(uint8_t version) { } bool ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { + // Allocate a new array of size length + 2 (1 for the length, 1 for null terminator) + char zb_name[ZB_MAX_NAME_LENGTH + 2]; + char zb_model[ZB_MAX_NAME_LENGTH + 2]; + // Convert manufacturer to ZCL string size_t name_length = strlen(name); size_t model_length = strlen(model); - if (name_length > 32 || model_length > 32) { + if (name_length > ZB_MAX_NAME_LENGTH || model_length > ZB_MAX_NAME_LENGTH) { log_e("Manufacturer or model name is too long"); return false; } - // Allocate a new array of size length + 2 (1 for the length, 1 for null terminator) - char *zb_name = new char[name_length + 2]; - char *zb_model = new char[model_length + 2]; + // Get and check the basic cluster + esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + if (basic_cluster == nullptr) { + log_e("Failed to get basic cluster"); + return false; + } // Store the length as the first element zb_name[0] = static_cast(name_length); // Cast size_t to char zb_model[0] = static_cast(model_length); @@ -52,9 +61,7 @@ bool ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { // Null-terminate the array zb_name[name_length + 1] = '\0'; zb_model[model_length + 1] = '\0'; - - // Get the basic cluster and update the manufacturer and model attributes - esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + // Update the manufacturer and model attributes esp_err_t ret_name = esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, (void *)zb_name); if (ret_name != ESP_OK) { log_e("Failed to set manufacturer: 0x%x: %s", ret_name, esp_err_to_name(ret_name)); @@ -63,8 +70,6 @@ bool ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { if (ret_model != ESP_OK) { log_e("Failed to set model: 0x%x: %s", ret_model, esp_err_to_name(ret_model)); } - delete[] zb_name; - delete[] zb_model; return ret_name == ESP_OK && ret_model == ESP_OK; } @@ -163,10 +168,10 @@ char *ZigbeeEP::readManufacturer(uint8_t endpoint, uint16_t short_addr, esp_zb_i read_req.attr_number = ZB_ARRAY_LENTH(attributes); read_req.attr_field = attributes; - if (_read_manufacturer != nullptr) { + if (_read_manufacturer != NULL) { free(_read_manufacturer); } - _read_manufacturer = nullptr; + _read_manufacturer = NULL; esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_read_attr_cmd_req(&read_req); @@ -201,10 +206,10 @@ char *ZigbeeEP::readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_add read_req.attr_number = ZB_ARRAY_LENTH(attributes); read_req.attr_field = attributes; - if (_read_model != nullptr) { + if (_read_model != NULL) { free(_read_model); } - _read_model = nullptr; + _read_model = NULL; esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_read_attr_cmd_req(&read_req); @@ -245,20 +250,28 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) { /* Basic cluster attributes */ if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data.value) { zbstring_t *zbstr = (zbstring_t *)attribute->data.value; - char *string = (char *)malloc(zbstr->len + 1); - memcpy(string, zbstr->data, zbstr->len); - string[zbstr->len] = '\0'; - log_i("Peer Manufacturer is \"%s\"", string); - _read_manufacturer = string; + _read_manufacturer = (char *)malloc(zbstr->len + 1); + if (_read_manufacturer == NULL) { + log_e("Failed to allocate memory for manufacturer data"); + xSemaphoreGive(lock); + return; + } + memcpy(_read_manufacturer, zbstr->data, zbstr->len); + _read_manufacturer[zbstr->len] = '\0'; + log_i("Peer Manufacturer is \"%s\"", _read_manufacturer); xSemaphoreGive(lock); } if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data.value) { zbstring_t *zbstr = (zbstring_t *)attribute->data.value; - char *string = (char *)malloc(zbstr->len + 1); - memcpy(string, zbstr->data, zbstr->len); - string[zbstr->len] = '\0'; - log_i("Peer Model is \"%s\"", string); - _read_model = string; + _read_model = (char *)malloc(zbstr->len + 1); + if (_read_model == NULL) { + log_e("Failed to allocate memory for model data"); + xSemaphoreGive(lock); + return; + } + memcpy(_read_model, zbstr->data, zbstr->len); + _read_model[zbstr->len] = '\0'; + log_i("Peer Model is \"%s\"", _read_model); xSemaphoreGive(lock); } } diff --git a/libraries/Zigbee/src/ZigbeeEP.h b/libraries/Zigbee/src/ZigbeeEP.h index bd142344929..9bdeea5abe9 100644 --- a/libraries/Zigbee/src/ZigbeeEP.h +++ b/libraries/Zigbee/src/ZigbeeEP.h @@ -41,6 +41,10 @@ typedef enum { /* Zigbee End Device Class */ class ZigbeeEP { public: + // constants and limits + static constexpr size_t ZB_MAX_NAME_LENGTH = 32; + + // constructors and destructor ZigbeeEP(uint8_t endpoint = 10); ~ZigbeeEP() {} From 0cc8eab836cbc92cada1a82a996a806a919976ba Mon Sep 17 00:00:00 2001 From: Gonzalo Brusco Date: Wed, 9 Apr 2025 05:25:06 -0300 Subject: [PATCH 25/56] Add an option to force IDF's default UART clock source (#11191) * Add an option to force IDF's default UART clock source * feat(uart): adds function to set clock source * feat(uart): add uart clock source selection method * feat(uart): add uart hall function to set the uart clock source * feat(uart): add function to set the uart clock source * feat(uart): set clock source as necessary * fix(uart): missing class qualifier declaration * fix(uart): fixing a typo and non LP UART SoC clk src setting * fix(uart): variable name, typo error * fix(uart): retores previous identation reducing diff load * feat(uart): apply CONFIG_ARDUINO_SERIAL_FORCE_IDF_DEFAULT_CLOCK_SOURCE to LP UART * feat(uart): adds option for UART_CLK_SRC_DEFAULT * feat(uart): adds option for setting default uart clock source from IDF * feat(uart): documents UART_CLK_SRC_DEFAULT as option in header file * feat(uart): documents using the IDF default uart clock source * fix(uart): type missmatch may cause error * fix(uart): type missmatch may cause error, test for -1 * feat(uart): considering both HP and LP default uart clock source * feat(uart): improve the defined value for UART_CLK_SRC_DEFAULT * fix(uart): using uart_sclk_t as hal level parameter * feat(uart): apply default LP uart clock source * fix(uart): considers that it may set the LP UART as well * feat(uart): using UART SCLK enum for uart clock source values * fix(uart): using UART_CLK_SRC_RTC now * fix(uart): documentation using UART_CLK_SRC_RTC now * fix(uart): fix old commentary that is not correct anymore * fix(uart): wrong identation in code line * fix(uart): using uart number as argument instead * fix(uart): using uart number as argument in setClockSource() * fix(uart): using uart number as parameter in uartSetClockSource() * feat(uart): update Kconfig.projbuild to reflect functionality * feat(uart): removing Kconfig.projbuild option to force default clk src * feat(uart): removes kconfig option to force uart default clk src * fix(uart): replacing #if #endif by #if #elif #endif for the same enum * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Sugar Glider Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/HardwareSerial.cpp | 18 ++++ cores/esp32/HardwareSerial.h | 34 +++++++ cores/esp32/esp32-hal-uart.c | 160 ++++++++++++++++++++++++--------- cores/esp32/esp32-hal-uart.h | 13 +++ 4 files changed, 182 insertions(+), 43 deletions(-) diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 76135691411..6d762da21fb 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -607,6 +607,24 @@ bool HardwareSerial::setMode(SerialMode mode) { return uartSetMode(_uart, mode); } +// Sets the UART Clock Source based on the compatible SoC options +// This method must be called before starting UART using begin(), otherwise it won't have any effect. +// Clock Source Options are: +// UART_CLK_SRC_DEFAULT :: any SoC - it will set whatever IDF defines as the default UART Clock Source +// UART_CLK_SRC_APB :: ESP32, ESP32-S2, ESP32-C3 and ESP32-S3 +// UART_CLK_SRC_PLL :: ESP32-C2, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2 and ESP32-P4 +// UART_CLK_SRC_XTAL :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 +// UART_CLK_SRC_RTC :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 +// UART_CLK_SRC_REF_TICK :: ESP32 and ESP32-S2 +// Note: CLK_SRC_PLL Freq depends on the SoC - ESP32-C2 has 40MHz, ESP32-H2 has 48MHz and ESP32-C5, C6, C61 and P4 has 80MHz +// Note: ESP32-C6, C61, ESP32-P4 and ESP32-C5 have LP UART that will use only RTC_FAST or XTAL/2 as Clock Source +bool HardwareSerial::setClockSource(SerialClkSrc clkSrc) { + if (_uart) { + log_e("No Clock Source change was done. This function must be called before beginning UART%d.", _uart_nr); + return false; + } + return uartSetClockSource(_uart_nr, (uart_sclk_t)clkSrc); +} // minimum total RX Buffer size is the UART FIFO space (128 bytes for most SoC) + 1. IDF imposition. // LP UART has FIFO of 16 bytes size_t HardwareSerial::setRxBufferSize(size_t new_size) { diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index b1f6df17724..e974f112701 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -96,6 +96,29 @@ typedef enum { UART_PARITY_ERROR } hardwareSerial_error_t; +typedef enum { + UART_CLK_SRC_DEFAULT = UART_SCLK_DEFAULT, +#if SOC_UART_SUPPORT_APB_CLK + UART_CLK_SRC_APB = UART_SCLK_APB, +#endif +#if SOC_UART_SUPPORT_PLL_F40M_CLK + UART_CLK_SRC_PLL = UART_SCLK_PLL_F40M, +#elif SOC_UART_SUPPORT_PLL_F80M_CLK + UART_CLK_SRC_PLL = UART_SCLK_PLL_F80M, +#elif CONFIG_IDF_TARGET_ESP32H2 + UART_CLK_SRC_PLL = UART_SCLK_PLL_F48M, +#endif +#if SOC_UART_SUPPORT_XTAL_CLK + UART_CLK_SRC_XTAL = UART_SCLK_XTAL, +#endif +#if SOC_UART_SUPPORT_RTC_CLK + UART_CLK_SRC_RTC = UART_SCLK_RTC, +#endif +#if SOC_UART_SUPPORT_REF_TICK + UART_CLK_SRC_REF_TICK = UART_SCLK_REF_TICK, +#endif +} SerialClkSrc; + #ifndef ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE #ifndef CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE #define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE 2048 @@ -344,6 +367,17 @@ class HardwareSerial : public Stream { // UART_MODE_RS485_COLLISION_DETECT = 0x03 mode: RS485 collision detection UART mode (used for test purposes) // UART_MODE_RS485_APP_CTRL = 0x04 mode: application control RS485 UART mode (used for test purposes) bool setMode(SerialMode mode); + // Used to set the UART clock source mode. It must be set before calling begin(), otherwise it won't have any effect. + // Not all clock source are available to every SoC. The compatible option are listed here: + // UART_CLK_SRC_DEFAULT :: any SoC - it will set whatever IDF defines as the default UART Clock Source + // UART_CLK_SRC_APB :: ESP32, ESP32-S2, ESP32-C3 and ESP32-S3 + // UART_CLK_SRC_PLL :: ESP32-C2, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2 and ESP32-P4 + // UART_CLK_SRC_XTAL :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 + // UART_CLK_SRC_RTC :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 + // UART_CLK_SRC_REF_TICK :: ESP32 and ESP32-S2 + // Note: CLK_SRC_PLL Freq depends on the SoC - ESP32-C2 has 40MHz, ESP32-H2 has 48MHz and ESP32-C5, C6, C61 and P4 has 80MHz + // Note: ESP32-C6, C61, ESP32-P4 and ESP32-C5 have LP UART that will use only RTC_FAST or XTAL/2 as Clock Source + bool setClockSource(SerialClkSrc clkSrc); size_t setRxBufferSize(size_t new_size); size_t setTxBufferSize(size_t new_size); diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 75e2da013ea..d2e98a2341a 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -58,6 +58,7 @@ struct uart_struct_t { uint16_t _rx_buffer_size, _tx_buffer_size; // UART RX and TX buffer sizes bool _inverted; // UART inverted signal uint8_t _rxfifo_full_thrhd; // UART RX FIFO full threshold + int8_t _uart_clock_source; // UART Clock Source used when it is started using uartBegin() }; #if CONFIG_DISABLE_HAL_LOCKS @@ -66,21 +67,21 @@ struct uart_struct_t { #define UART_MUTEX_UNLOCK() static uart_t _uart_bus_array[] = { - {0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #if SOC_UART_NUM > 1 - {1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 2 - {2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 3 - {3, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {3, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 4 - {4, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {4, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 5 - {5, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {5, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif }; @@ -95,21 +96,21 @@ static uart_t _uart_bus_array[] = { xSemaphoreGive(uart->lock) static uart_t _uart_bus_array[] = { - {NULL, 0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 0, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #if SOC_UART_NUM > 1 - {NULL, 1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 1, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 2 - {NULL, 2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 2, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 3 - {NULL, 3, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 3, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 4 - {NULL, 4, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 4, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif #if SOC_UART_NUM > 5 - {NULL, 5, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0}, + {NULL, 5, false, 0, NULL, -1, -1, -1, -1, 0, 0, 0, 0, false, 0, -1}, #endif }; @@ -664,30 +665,40 @@ uart_t *uartBegin( rxfifo_full_thrhd = uart_config.rx_flow_ctrl_thresh; // makes sure that it will be set correctly in the struct uart_config.baud_rate = baudrate; #if SOC_UART_LP_NUM >= 1 - if (uart_nr >= SOC_UART_HP_NUM) { // it is a LP UART NUM - uart_config.lp_source_clk = LP_UART_SCLK_DEFAULT; // use default LP clock - log_v("Setting UART%d to use LP clock", uart_nr); + if (uart_nr >= SOC_UART_HP_NUM) { // it is a LP UART NUM + if (uart->_uart_clock_source > 0) { + uart_config.lp_source_clk = (soc_periph_lp_uart_clk_src_t)uart->_uart_clock_source; // use user defined LP UART clock + log_v("Setting UART%d to user defined LP clock source (%d) ", uart_nr, uart->_uart_clock_source); + } else { + uart_config.lp_source_clk = LP_UART_SCLK_DEFAULT; // use default LP clock + log_v("Setting UART%d to Default LP clock source", uart_nr); + } } else -#endif +#endif // SOC_UART_LP_NUM >= 1 { - // there is an issue when returning from light sleep with the C6 and H2: the uart baud rate is not restored - // therefore, uart clock source will set to XTAL for all SoC that support it. This fix solves the C6|H2 issue. + if (uart->_uart_clock_source >= 0) { + uart_config.source_clk = (soc_module_clk_t)uart->_uart_clock_source; // use user defined HP UART clock + log_v("Setting UART%d to user defined HP clock source (%d) ", uart_nr, uart->_uart_clock_source); + } else { + // there is an issue when returning from light sleep with the C6 and H2: the uart baud rate is not restored + // therefore, uart clock source will set to XTAL for all SoC that support it. This fix solves the C6|H2 issue. #if SOC_UART_SUPPORT_XTAL_CLK - uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4 - log_v("Setting UART%d to use XTAL clock", uart_nr); + uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4 + log_v("Setting UART%d to use XTAL clock", uart_nr); #elif SOC_UART_SUPPORT_REF_TICK - if (baudrate <= REF_TICK_BAUDRATE_LIMIT) { - uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps - log_v("Setting UART%d to use REF_TICK clock", uart_nr); - } else { - uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency! - log_v("Setting UART%d to use APB clock", uart_nr); - } + if (baudrate <= REF_TICK_BAUDRATE_LIMIT) { + uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps + log_v("Setting UART%d to use REF_TICK clock", uart_nr); + } else { + uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency! + log_v("Setting UART%d to use APB clock", uart_nr); + } #else - // Default CLK Source: CLK_APB for ESP32|S2|S3|C3 -- CLK_PLL_F40M for C2 -- CLK_PLL_F48M for H2 -- CLK_PLL_F80M for C6 - uart_config.source_clk = UART_SCLK_DEFAULT; // baudrate may change with the APB Frequency! - log_v("Setting UART%d to use DEFAULT clock", uart_nr); -#endif + // Default CLK Source: CLK_APB for ESP32|S2|S3|C3 -- CLK_PLL_F40M for C2 -- CLK_PLL_F48M for H2 -- CLK_PLL_F80M for C6|P4 + uart_config.source_clk = UART_SCLK_DEFAULT; // baudrate may change with the APB Frequency! + log_v("Setting UART%d to use DEFAULT clock", uart_nr); +#endif // SOC_UART_SUPPORT_XTAL_CLK + } } UART_MUTEX_LOCK(); @@ -716,6 +727,14 @@ uart_t *uartBegin( uart->_tx_buffer_size = tx_buffer_size; uart->has_peek = false; uart->peek_byte = 0; +#if SOC_UART_LP_NUM >= 1 + if (uart_nr >= SOC_UART_HP_NUM) { + uart->_uart_clock_source = uart_config.lp_source_clk; + } else +#endif + { + uart->_uart_clock_source = uart_config.source_clk; + } } UART_MUTEX_UNLOCK(); @@ -975,22 +994,52 @@ bool uartSetBaudRate(uart_t *uart, uint32_t baud_rate) { return false; } bool retCode = true; - UART_MUTEX_LOCK(); -#if SOC_UART_SUPPORT_XTAL_CLK // ESP32-S3, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-H2 and ESP32-P4 - soc_module_clk_t newClkSrc = UART_SCLK_XTAL; + soc_module_clk_t newClkSrc = UART_SCLK_DEFAULT; + int8_t previousClkSrc = uart->_uart_clock_source; #if SOC_UART_LP_NUM >= 1 if (uart->num >= SOC_UART_HP_NUM) { // it is a LP UART NUM - newClkSrc = LP_UART_SCLK_DEFAULT; // use default LP clock + if (uart->_uart_clock_source > 0) { + newClkSrc = (soc_periph_lp_uart_clk_src_t)uart->_uart_clock_source; // use user defined LP UART clock + log_v("Setting UART%d to user defined LP clock source (%d) ", uart->num, newClkSrc); + } else { + newClkSrc = LP_UART_SCLK_DEFAULT; // use default LP clock + log_v("Setting UART%d to Default LP clock source", uart->num); + } + } else +#endif // SOC_UART_LP_NUM >= 1 + { + if (uart->_uart_clock_source >= 0) { + newClkSrc = (soc_module_clk_t)uart->_uart_clock_source; // use user defined HP UART clock + log_v("Setting UART%d to use HP clock source (%d) ", uart->num, newClkSrc); + } else { + // there is an issue when returning from light sleep with the C6 and H2: the uart baud rate is not restored + // therefore, uart clock source will set to XTAL for all SoC that support it. This fix solves the C6|H2 issue. +#if SOC_UART_SUPPORT_XTAL_CLK + newClkSrc = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4 + log_v("Setting UART%d to use XTAL clock", uart->num); +#elif SOC_UART_SUPPORT_REF_TICK + if (baud_rate <= REF_TICK_BAUDRATE_LIMIT) { + newClkSrc = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps + log_v("Setting UART%d to use REF_TICK clock", uart->num); + } else { + newClkSrc = UART_SCLK_APB; // baudrate may change with the APB Frequency! + log_v("Setting UART%d to use APB clock", uart->num); + } +#else + // Default CLK Source: CLK_APB for ESP32|S2|S3|C3 -- CLK_PLL_F40M for C2 -- CLK_PLL_F48M for H2 -- CLK_PLL_F80M for C6|P4 + // using newClkSrc = UART_SCLK_DEFAULT as defined in the variable declaration + log_v("Setting UART%d to use DEFAULT clock", uart->num); +#endif // SOC_UART_SUPPORT_XTAL_CLK + } } -#endif - // ESP32-P4 demands an atomic operation for setting the clock source - HP_UART_SRC_CLK_ATOMIC() { - uart_ll_set_sclk(UART_LL_GET_HW(uart->num), newClkSrc); + UART_MUTEX_LOCK(); + // if necessary, set the correct UART Clock Source before changing the baudrate + if (previousClkSrc < 0 || previousClkSrc != newClkSrc) { + HP_UART_SRC_CLK_ATOMIC() { + uart_ll_set_sclk(UART_LL_GET_HW(uart->num), newClkSrc); + } + uart->_uart_clock_source = newClkSrc; } -#else // ESP32, ESP32-S2 - soc_module_clk_t newClkSrc = baud_rate <= REF_TICK_BAUDRATE_LIMIT ? SOC_MOD_CLK_REF_TICK : SOC_MOD_CLK_APB; - uart_ll_set_sclk(UART_LL_GET_HW(uart->num), newClkSrc); -#endif if (uart_set_baudrate(uart->num, baud_rate) == ESP_OK) { log_v("Setting UART%d baud rate to %ld.", uart->num, baud_rate); uart->_baudrate = baud_rate; @@ -1084,6 +1133,31 @@ bool uartSetMode(uart_t *uart, uart_mode_t mode) { return retCode; } +// this function will set the uart clock source +// it must be called before uartBegin(), otherwise it won't change any thing. +bool uartSetClockSource(uint8_t uartNum, uart_sclk_t clkSrc) { + if (uartNum >= SOC_UART_NUM) { + log_e("UART%d is invalid. This device has %d UARTs, from 0 to %d.", uartNum, SOC_UART_NUM, SOC_UART_NUM - 1); + return false; + } + uart_t *uart = &_uart_bus_array[uartNum]; +#if SOC_UART_LP_NUM >= 1 + if (uart->num >= SOC_UART_HP_NUM) { + switch (clkSrc) { + case UART_SCLK_XTAL: uart->_uart_clock_source = LP_UART_SCLK_XTAL_D2; break; + case UART_SCLK_RTC: uart->_uart_clock_source = LP_UART_SCLK_LP_FAST; break; + case UART_SCLK_DEFAULT: + default: uart->_uart_clock_source = LP_UART_SCLK_DEFAULT; + } + } else +#endif + { + uart->_uart_clock_source = clkSrc; + } + //log_i("UART%d set clock source to %d", uart->num, uart->_uart_clock_source); + return true; +} + void uartSetDebug(uart_t *uart) { // LP UART is not supported for debug if (uart == NULL || uart->num >= SOC_UART_HP_NUM) { diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h index 4d686fdd23d..41b005aa151 100644 --- a/cores/esp32/esp32-hal-uart.h +++ b/cores/esp32/esp32-hal-uart.h @@ -97,6 +97,19 @@ bool uartSetHwFlowCtrlMode(uart_t *uart, uart_hw_flowcontrol_t mode, uint8_t thr // UART_MODE_RS485_APP_CTRL = 0x04 mode: application control RS485 UART mode (used for test purposes) bool uartSetMode(uart_t *uart, uart_mode_t mode); +// Used to set the UART clock source mode. It must be set before calling uartBegin(), otherwise it won't have any effect. +// Not all clock source are available to every SoC. The compatible option are listed here: +// UART_SCLK_DEFAULT :: any SoC - it will set whatever IDF defines as the default UART Clock Source +// UART_SCLK_APB :: ESP32, ESP32-S2, ESP32-C3 and ESP32-S3 +// UART_SCLK_PLL_F80M :: ESP32-C5, ESP32-C6, ESP32-C61 and ESP32-P4 +// UART_SCLK_PLL_F40M :: ESP32-C2 +// UART_SCLK_PLL_F48M :: ESP32-H2 +// UART_SCLK_XTAL :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 +// UART_SCLK_RTC :: ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-C61, ESP32-H2, ESP32-S3 and ESP32-P4 +// UART_SCLK_REF_TICK :: ESP32 and ESP32-S2 +// Note: ESP32-C6, C61, ESP32-P4 and ESP32-C5 have LP UART that will use only LP_UART_SCLK_LP_FAST (RTC_FAST) or LP_UART_SCLK_XTAL_D2 (XTAL/2) as Clock Source +bool uartSetClockSource(uint8_t uartNum, uart_sclk_t clkSrc); + void uartStartDetectBaudrate(uart_t *uart); unsigned long uartDetectBaudrate(uart_t *uart); From 7f609450186080b63225115ee7be21679c76c7e8 Mon Sep 17 00:00:00 2001 From: Jacob Williams <47766188+SaintSampo@users.noreply.github.com> Date: Wed, 9 Apr 2025 04:25:39 -0400 Subject: [PATCH 26/56] fix(board): Alfredo NoU3 pins_arduino.h uses uint8_t but it causes error with esp32-hal-gpio.h (#11206) * fix(board): Alfredo NoU3 include stdint.h * fix(hal_gpio): lets pins_arduino.h to use stdint and stdbool types * feat(pins_arduino): fixes lack of stdint in the right place * fix(pins_arduino): reverts all changes to this file * fix(pins_arduino): reverts all changes to this file * fix(pins_arduino): reverts all changes back to original pr --------- Co-authored-by: Sugar Glider --- variants/alfredo-nou3/pins_arduino.h | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/alfredo-nou3/pins_arduino.h b/variants/alfredo-nou3/pins_arduino.h index 88bdbea0bb1..8b5a7d51b9f 100644 --- a/variants/alfredo-nou3/pins_arduino.h +++ b/variants/alfredo-nou3/pins_arduino.h @@ -1,6 +1,7 @@ #ifndef Pins_Arduino_h #define Pins_Arduino_h +#include #define USB_VID 0xAFD0 #define USB_PID 0x0003 #define USB_MANUFACTURER "Alfredo" From d3509ef98b2990dd7402ebc589d751a1b58fec07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:25:58 +0200 Subject: [PATCH 27/56] feat(zigbee): Add battery voltage attribute support (#11210) * feat(zigbee): Add battery voltage attribute support * Update libraries/Zigbee/src/ZigbeeEP.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../Zigbee_Temp_Hum_Sensor_Sleepy.ino | 6 ++--- libraries/Zigbee/src/ZigbeeEP.cpp | 22 ++++++++++++++++++- libraries/Zigbee/src/ZigbeeEP.h | 7 +++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino b/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino index 3eefd973dd2..e9d08d32175 100644 --- a/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino +++ b/libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino @@ -85,9 +85,9 @@ void setup() { // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C) zbTempSensor.setTolerance(1); - // Set power source to battery and set battery percentage to measured value (now 100% for demonstration) - // The value can be also updated by calling zbTempSensor.setBatteryPercentage(percentage) anytime - zbTempSensor.setPowerSource(ZB_POWER_SOURCE_BATTERY, 100); + // Set power source to battery, battery percentage and battery voltage (now 100% and 3.5V for demonstration) + // The value can be also updated by calling zbTempSensor.setBatteryPercentage(percentage) or zbTempSensor.setBatteryVoltage(voltage) anytime after Zigbee.begin() + zbTempSensor.setPowerSource(ZB_POWER_SOURCE_BATTERY, 100, 35); // Add humidity cluster to the temperature sensor device with min, max and tolerance values zbTempSensor.addHumiditySensor(0, 100, 1); diff --git a/libraries/Zigbee/src/ZigbeeEP.cpp b/libraries/Zigbee/src/ZigbeeEP.cpp index 338a4107cf2..cf52a902983 100644 --- a/libraries/Zigbee/src/ZigbeeEP.cpp +++ b/libraries/Zigbee/src/ZigbeeEP.cpp @@ -73,7 +73,7 @@ bool ZigbeeEP::setManufacturerAndModel(const char *name, const char *model) { return ret_name == ESP_OK && ret_model == ESP_OK; } -bool ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_percentage) { +bool ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_percentage, uint8_t battery_voltage) { esp_zb_attribute_list_t *basic_cluster = esp_zb_cluster_list_get_cluster(_cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_err_t ret = esp_zb_cluster_update_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, (void *)&power_source); if (ret != ESP_OK) { @@ -93,6 +93,11 @@ bool ZigbeeEP::setPowerSource(zb_power_source_t power_source, uint8_t battery_pe log_e("Failed to add battery percentage attribute: 0x%x: %s", ret, esp_err_to_name(ret)); return false; } + ret = esp_zb_power_config_cluster_add_attr(power_config_cluster, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID, (void *)&battery_voltage); + if (ret != ESP_OK) { + log_e("Failed to add battery voltage attribute: 0x%x: %s", ret, esp_err_to_name(ret)); + return false; + } ret = esp_zb_cluster_list_add_power_config_cluster(_cluster_list, power_config_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); if (ret != ESP_OK) { log_e("Failed to add power config cluster: 0x%x: %s", ret, esp_err_to_name(ret)); @@ -125,6 +130,21 @@ bool ZigbeeEP::setBatteryPercentage(uint8_t percentage) { return true; } +bool ZigbeeEP::setBatteryVoltage(uint8_t voltage) { + esp_zb_zcl_status_t ret = ESP_ZB_ZCL_STATUS_SUCCESS; + esp_zb_lock_acquire(portMAX_DELAY); + ret = esp_zb_zcl_set_attribute_val( + _endpoint, ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID, &voltage, false + ); + esp_zb_lock_release(); + if (ret != ESP_ZB_ZCL_STATUS_SUCCESS) { + log_e("Failed to set battery voltage: 0x%x: %s", ret, esp_zb_zcl_status_to_name(ret)); + return false; + } + log_v("Battery voltage updated"); + return true; +} + bool ZigbeeEP::reportBatteryPercentage() { /* Send report attributes command */ esp_zb_zcl_report_attr_cmd_t report_attr_cmd; diff --git a/libraries/Zigbee/src/ZigbeeEP.h b/libraries/Zigbee/src/ZigbeeEP.h index 9bdeea5abe9..e13b3b59de9 100644 --- a/libraries/Zigbee/src/ZigbeeEP.h +++ b/libraries/Zigbee/src/ZigbeeEP.h @@ -81,9 +81,10 @@ class ZigbeeEP { char *readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_addr_t ieee_addr); // Set Power source and battery percentage for battery powered devices - bool setPowerSource(zb_power_source_t power_source, uint8_t percentage = 255); - bool setBatteryPercentage(uint8_t percentage); - bool reportBatteryPercentage(); + bool setPowerSource(zb_power_source_t power_source, uint8_t percentage = 0xff, uint8_t voltage = 0xff); // voltage in 100mV + bool setBatteryPercentage(uint8_t percentage); // 0-100 % + bool setBatteryVoltage(uint8_t voltage); // voltage in 100mV (example value 35 for 3.5V) + bool reportBatteryPercentage(); // battery voltage is not reportable attribute // Set time bool addTimeCluster(tm time = {}, int32_t gmt_offset = 0); // gmt offset in seconds From 8e8b1cbd31d0f27a66e84f5de6cb48366dc630b4 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:26:13 +0200 Subject: [PATCH 28/56] Use CONFIG_BT_BLUEDROID_ENABLED for enabling (#11214) Co-authored-by: Sugar Glider --- cores/esp32/esp32-hal-bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-bt.c b/cores/esp32/esp32-hal-bt.c index 5f1148bd492..1e5f73e324c 100644 --- a/cores/esp32/esp32-hal-bt.c +++ b/cores/esp32/esp32-hal-bt.c @@ -15,7 +15,7 @@ #include "esp32-hal-bt.h" #if SOC_BT_SUPPORTED -#ifdef CONFIG_BT_ENABLED +#ifdef CONFIG_BT_BLUEDROID_ENABLED #if CONFIG_IDF_TARGET_ESP32 bool btInUse() { From 2647cbbbc254a229fca5311e2f5c8f3ece811e25 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 9 Apr 2025 05:56:32 -0300 Subject: [PATCH 29/56] refactor(rmt): refactored RMT loopback example (#11221) * feat(rmt): refactored RMT loopback example * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../examples/RMT/RMTLoopback/RMTLoopback.ino | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino index 17e7af290bf..5d0406aee0e 100644 --- a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino +++ b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino @@ -1,4 +1,4 @@ -// Copyright 2023 Espressif Systems (Shanghai) PTE LTD +// Copyright 2025 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,14 +35,11 @@ rmt_data_t my_data[256]; rmt_data_t data[256]; -static EventGroupHandle_t events; - #define RMT_FREQ 10000000 // tick time is 100ns -#define RMT_NUM_EXCHANGED_DATA 30 +#define RMT_NUM_EXCHANGED_DATA 32 void setup() { Serial.begin(115200); - events = xEventGroupCreate(); if (!rmtInit(RMT_TX_PIN, RMT_TX_MODE, RMT_MEM_NUM_BLOCKS_1, RMT_FREQ)) { Serial.println("init sender failed\n"); @@ -50,25 +47,41 @@ void setup() { if (!rmtInit(RMT_RX_PIN, RMT_RX_MODE, RMT_MEM_RX, RMT_FREQ)) { Serial.println("init receiver failed\n"); } + Serial.println(); + Serial.println("RMT tick set to: 100ns"); // End of transmission shall be detected when line is idle for 2us = 20*100ns rmtSetRxMaxThreshold(RMT_RX_PIN, 20); // Disable Glitch filter rmtSetRxMinThreshold(RMT_RX_PIN, 0); - Serial.println("real tick set to: 100ns"); - Serial.printf("\nPlease connect GPIO %d to GPIO %d, now.\n", RMT_TX_PIN, RMT_RX_PIN); -} - -void loop() { - // Init data - int i; - for (i = 0; i < 255; i++) { - data[i].val = 0x80010001 + ((i % 13) << 16) + 13 - (i % 13); + // create multiple pulses with different width to be sent + for (int i = 0; i < 255; i++) { + data[i].level0 = 1; // HIGH + data[i].duration0 = 1 + 13 - (i % 13); // number of Tick on High + data[i].level1 = 0; // LOW + data[i].duration1 = 1 + (i % 13); // number of Ticks on Low my_data[i].val = 0; } data[255].val = 0; + Serial.println(); + Serial.println("===================================================================================================="); + Serial.println("Preloaded Data that will sent (time in 0.1us):"); + // Printout the received data plus the original values + for (int i = 0; i < RMT_NUM_EXCHANGED_DATA; i++) { + Serial.printf("%08lx=[%c 0x%02x|%c 0x%02x] ", data[i].val, data[i].level0 ? 'H' : 'L', data[i].duration0, data[i].level1 ? 'H' : 'L', data[i].duration1); + if (!((i + 1) % 4)) { + Serial.println(); + } + } + Serial.println("===================================================================================================="); + Serial.printf("Please connect GPIO %d to GPIO %d, now.", RMT_TX_PIN, RMT_RX_PIN); + Serial.println(); + Serial.println(); +} + +void loop() { // Start an async data read size_t rx_num_symbols = RMT_NUM_EXCHANGED_DATA; rmtReadAsync(RMT_RX_PIN, my_data, &rx_num_symbols); @@ -84,13 +97,13 @@ void loop() { Serial.printf("Got %d RMT symbols\n", rx_num_symbols); // Printout the received data plus the original values - for (i = 0; i < 60; i++) { + for (int i = 0; i < RMT_NUM_EXCHANGED_DATA; i++) { Serial.printf("%08lx=%08lx ", my_data[i].val, data[i].val); if (!((i + 1) % 4)) { - Serial.println(""); + Serial.println(); } } - Serial.println("\n"); + Serial.println(); - delay(500); + delay(2000); } From be57376b6bfae6c3bb13d92c87b1e341cb5b84bb Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 9 Apr 2025 05:56:52 -0300 Subject: [PATCH 30/56] fix(usb): uninitilized variable warning message (#11222) --- cores/esp32/USB.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cores/esp32/USB.cpp b/cores/esp32/USB.cpp index 8fdd7a3ab71..269e9a76cb3 100644 --- a/cores/esp32/USB.cpp +++ b/cores/esp32/USB.cpp @@ -100,6 +100,7 @@ static bool tinyusb_device_suspended = false; void tud_mount_cb(void) { tinyusb_device_mounted = true; arduino_usb_event_data_t p; + p.suspend.remote_wakeup_en = 0; arduino_usb_event_post(ARDUINO_USB_EVENTS, ARDUINO_USB_STARTED_EVENT, &p, sizeof(arduino_usb_event_data_t), portMAX_DELAY); } @@ -107,6 +108,7 @@ void tud_mount_cb(void) { void tud_umount_cb(void) { tinyusb_device_mounted = false; arduino_usb_event_data_t p; + p.suspend.remote_wakeup_en = 0; arduino_usb_event_post(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, &p, sizeof(arduino_usb_event_data_t), portMAX_DELAY); } @@ -123,6 +125,7 @@ void tud_suspend_cb(bool remote_wakeup_en) { void tud_resume_cb(void) { tinyusb_device_suspended = false; arduino_usb_event_data_t p; + p.suspend.remote_wakeup_en = 0; arduino_usb_event_post(ARDUINO_USB_EVENTS, ARDUINO_USB_RESUME_EVENT, &p, sizeof(arduino_usb_event_data_t), portMAX_DELAY); } From bd4b32522c09497f3005ab60a1081836b34ea6bc Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 9 Apr 2025 05:57:12 -0300 Subject: [PATCH 31/56] feat(usb): add a few more consumer control HID commands (#11227) --- libraries/USB/src/USBHIDConsumerControl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/USB/src/USBHIDConsumerControl.h b/libraries/USB/src/USBHIDConsumerControl.h index e65e529a77b..a5458df288e 100644 --- a/libraries/USB/src/USBHIDConsumerControl.h +++ b/libraries/USB/src/USBHIDConsumerControl.h @@ -38,9 +38,14 @@ // Media Control #define CONSUMER_CONTROL_PLAY_PAUSE 0x00CD +#define CONSUMER_CONTROL_RECORD 0x00B2 +#define CONSUMER_CONTROL_FAST_FORWARD 0x00B3 +#define CONSUMER_CONTROL_REWIND 0x00B4 #define CONSUMER_CONTROL_SCAN_NEXT 0x00B5 #define CONSUMER_CONTROL_SCAN_PREVIOUS 0x00B6 #define CONSUMER_CONTROL_STOP 0x00B7 +#define CONSUMER_CONTROL_EJECT 0x00B8 +#define CONSUMER_CONTROL_PLAY_PAUSE 0x00CD #define CONSUMER_CONTROL_VOLUME 0x00E0 #define CONSUMER_CONTROL_MUTE 0x00E2 #define CONSUMER_CONTROL_BASS 0x00E3 From 3fcc316d3cd9d5c565c6e9b20a56d86e77f2537c Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Mon, 14 Apr 2025 05:24:30 -0300 Subject: [PATCH 32/56] fix(usb_hid): duplicated CONSUMER_CONTROL_PLAY_PAUSE (#11242) --- libraries/USB/src/USBHIDConsumerControl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/USB/src/USBHIDConsumerControl.h b/libraries/USB/src/USBHIDConsumerControl.h index a5458df288e..7a59c70b6b1 100644 --- a/libraries/USB/src/USBHIDConsumerControl.h +++ b/libraries/USB/src/USBHIDConsumerControl.h @@ -37,7 +37,6 @@ #define CONSUMER_CONTROL_WIRELESS_RADIO_SLIDER_SWITCH 0x00C8 // Media Control -#define CONSUMER_CONTROL_PLAY_PAUSE 0x00CD #define CONSUMER_CONTROL_RECORD 0x00B2 #define CONSUMER_CONTROL_FAST_FORWARD 0x00B3 #define CONSUMER_CONTROL_REWIND 0x00B4 From 60c8206ee64ca73bcc1d6444b384f24a766b9637 Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Mon, 14 Apr 2025 11:08:33 +0200 Subject: [PATCH 33/56] feat(logging): Arduino log redirection (#11159) * feat(logging): Arduino log redirection * fix(uart): log will only use ets_printf() for uart and cdc * feat(uart_cdc): when CDC is logging, UART is silent * feat(uart_cdc): when CDC is logging, UART is silent * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Sugar Glider Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/HWCDC.cpp | 1 + cores/esp32/USBCDC.cpp | 1 + cores/esp32/esp32-hal-uart.c | 10 +--------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cores/esp32/HWCDC.cpp b/cores/esp32/HWCDC.cpp index 170e323a035..062317d9f53 100644 --- a/cores/esp32/HWCDC.cpp +++ b/cores/esp32/HWCDC.cpp @@ -603,6 +603,7 @@ void HWCDC::setDebugOutput(bool en) { } else { ets_install_putc2(NULL); } + ets_install_putc1(NULL); // closes UART log output } #if ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Hardware JTAG CDC selected diff --git a/cores/esp32/USBCDC.cpp b/cores/esp32/USBCDC.cpp index 945021a79e2..c7bb4582d4f 100644 --- a/cores/esp32/USBCDC.cpp +++ b/cores/esp32/USBCDC.cpp @@ -455,6 +455,7 @@ void USBCDC::setDebugOutput(bool en) { } else { ets_install_putc2(NULL); } + ets_install_putc1(NULL); // closes UART log output } USBCDC::operator bool() const { diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index d2e98a2341a..5311aff4f37 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -1186,7 +1186,7 @@ int log_printfv(const char *format, va_list arg) { return 0; } } -/* + /* // This causes dead locks with logging in specific cases and also with C++ constructors that may send logs #if !CONFIG_DISABLE_HAL_LOCKS if(s_uart_debug_nr != -1 && _uart_bus_array[s_uart_debug_nr].lock){ @@ -1194,16 +1194,8 @@ int log_printfv(const char *format, va_list arg) { } #endif */ -#if (ARDUINO_USB_CDC_ON_BOOT == 1 && ARDUINO_USB_MODE == 0) || CONFIG_IDF_TARGET_ESP32C3 \ - || ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4) && ARDUINO_USB_CDC_ON_BOOT == 1) vsnprintf(temp, len + 1, format, arg); ets_printf("%s", temp); -#else - int wlen = vsnprintf(temp, len + 1, format, arg); - for (int i = 0; i < wlen; i++) { - ets_write_char_uart(temp[i]); - } -#endif /* // This causes dead locks with logging and also with constructors that may send logs #if !CONFIG_DISABLE_HAL_LOCKS From 9cad83bacf7262e09ee17ee7b6a7b2eb620e2467 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:13:55 +0200 Subject: [PATCH 34/56] check for `CONFIG_BT_BLUEDROID_ENABLED` in esp32-hal-misc.c (#11234) * check for `CONFIG_BT_BLUEDROID_ENABLED` in esp32-hal-misc.c * overseen changes to `CONFIG_BT_BLUEDROID_ENABLED` --- cores/esp32/esp32-hal-misc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c index 50e2973d27a..594acd38153 100644 --- a/cores/esp32/esp32-hal-misc.c +++ b/cores/esp32/esp32-hal-misc.c @@ -25,9 +25,9 @@ #include "esp_ota_ops.h" #endif //CONFIG_APP_ROLLBACK_ENABLE #include "esp_private/startup_internal.h" -#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED +#if defined(CONFIG_BT_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED #include "esp_bt.h" -#endif //CONFIG_BT_ENABLED +#endif //CONFIG_BT_BLUEDROID_ENABLED #include #include "soc/rtc.h" #if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4) @@ -243,7 +243,7 @@ bool verifyRollbackLater() { } #endif -#ifdef CONFIG_BT_ENABLED +#ifdef CONFIG_BT_BLUEDROID_ENABLED #if CONFIG_IDF_TARGET_ESP32 //overwritten in esp32-hal-bt.c bool btInUse() __attribute__((weak)); @@ -305,7 +305,7 @@ void initArduino() { if (err) { log_e("Failed to initialize NVS! Error: %u", err); } -#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED +#if defined(CONFIG_BT_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED if (!btInUse()) { esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); } From f1223663dd122b605603c1e072a33f3a6935f451 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 14 Apr 2025 13:54:47 +0300 Subject: [PATCH 35/56] fix(wifi): Workaround bug in esp_wifi_get_protocol() (#11239) * fix(wifi): Workaround bug in esp_wifi_get_protocol() * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- libraries/WiFi/src/WiFiGeneric.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index aa994963514..3faf34fef34 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -602,9 +602,9 @@ bool WiFiGenericClass::mode(wifi_mode_t m) { #else #define WIFI_PROTOCOL_DEFAULT (WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N) #endif - uint8_t current_protocol = 0; + uint32_t current_protocol = 0; if (m & WIFI_MODE_STA) { - err = esp_wifi_get_protocol(WIFI_IF_STA, ¤t_protocol); + err = esp_wifi_get_protocol(WIFI_IF_STA, (uint8_t *)¤t_protocol); if (err == ESP_OK && current_protocol == WIFI_PROTOCOL_LR) { log_v("Disabling long range on STA"); err = esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_DEFAULT); @@ -614,7 +614,7 @@ bool WiFiGenericClass::mode(wifi_mode_t m) { } } if (m & WIFI_MODE_AP) { - err = esp_wifi_get_protocol(WIFI_IF_AP, ¤t_protocol); + err = esp_wifi_get_protocol(WIFI_IF_AP, (uint8_t *)¤t_protocol); if (err == ESP_OK && current_protocol == WIFI_PROTOCOL_LR) { log_v("Disabling long range on AP"); err = esp_wifi_set_protocol(WIFI_IF_AP, WIFI_PROTOCOL_DEFAULT); From e0d4d176ea8bcd64889f0c387203ffec45ecc47b Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 22 Apr 2025 03:16:32 -0300 Subject: [PATCH 36/56] ci(pre-commit): Lock versions to SHA and apply fixes (#11248) * ci(pre-commit): Execute codespell after formatting changes * ci(pre-commit): Lock versions to hash * fix(pre-commit): Apply pre-commit fixes --- .codespellrc | 2 +- .pre-commit-config.yaml | 34 +++++++++---------- .../USB/src/keyboardLayout/KeyboardLayout.h | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.codespellrc b/.codespellrc index 756f7e9503b..d3b9b45cb1e 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,7 @@ [codespell] # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: -ignore-words-list = ba,licence,ot,dout,als,exten +ignore-words-list = ba,licence,ot,dout,als,exten,emac skip = ./.git,./.licenses,__pycache__,.clang-format,.codespellrc,.editorconfig,.flake8,.prettierignore,.yamllint.yml,.gitignore,boards.txt,platform.txt,programmers.txt builtin = clear,informal,en-GB_to_en-US check-filenames = diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f80261422b0..0d425c46eae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v5.0.0" + rev: "cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b" # v5.0.0 hooks: # Generic checks - id: check-case-conflict @@ -39,15 +39,8 @@ repos: ^package\/.*$ ) - - repo: https://github.com/codespell-project/codespell - rev: "v2.3.0" - hooks: - # Spell checking - - id: codespell - exclude: ^.*\.(svd|SVD)$ - - repo: https://github.com/pre-commit/mirrors-clang-format - rev: "v18.1.3" + rev: "f6446549e5e97ec9665b9b03e75b87b445857f9a" # v18.1.3 hooks: # C/C++ formatting - id: clang-format @@ -55,7 +48,7 @@ repos: exclude: ^.*\/build_opt\.h$ - repo: https://github.com/psf/black-pre-commit-mirror - rev: "24.10.0" + rev: "a4920527036bb9a3f3e6055d595849d67d0da066" # 25.1.0 hooks: # Python formatting - id: black @@ -63,7 +56,7 @@ repos: args: [--line-length=120] #From the arduino code style. Add as argument rather than creating a new config file. - repo: https://github.com/PyCQA/flake8 - rev: "7.1.1" + rev: "16f5f28a384f0781bebb37a08aa45e65b9526c50" # 7.2.0 hooks: # Python linting - id: flake8 @@ -74,21 +67,28 @@ repos: - flake8-simplify - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "ffb6a759a979008c0e6dff86e39f4745a2d9eac4" # v3.1.0 hooks: # YAML formatting - id: prettier types_or: [yaml] + - repo: https://github.com/codespell-project/codespell + rev: "63c8f8312b7559622c0d82815639671ae42132ac" # v2.4.1 + hooks: + # Spell checking + - id: codespell + exclude: ^.*\.(svd|SVD)$ + - repo: https://github.com/shellcheck-py/shellcheck-py - rev: "v0.10.0.1" + rev: "a23f6b85d0fdd5bb9d564e2579e678033debbdff" # v0.10.0.1 hooks: # Bash linting - id: shellcheck types: [shell] - repo: https://github.com/openstack/bashate - rev: "2.1.1" + rev: "fbd7c2534c2701351c603ff700ddf08202430a31" # 2.1.1 hooks: # Bash formatting - id: bashate @@ -96,15 +96,15 @@ repos: args: ["-i", "E006"] # Ignore E006: Line too long - repo: https://github.com/errata-ai/vale - rev: "v3.9.1" + rev: "dc4c47923788a413fb5677de6e3370d514aecb78" # v3.11.2 hooks: # Sync vale styles and lint markdown and reStructuredText - id: vale name: vale-sync - language_version: "1.21.6" + language_version: "1.23.2" pass_filenames: false args: [sync] types_or: [markdown, rst] - id: vale - language_version: "1.21.6" + language_version: "1.23.2" types_or: [markdown, rst] diff --git a/libraries/USB/src/keyboardLayout/KeyboardLayout.h b/libraries/USB/src/keyboardLayout/KeyboardLayout.h index 0ef69dc7ab9..ee6b6b4e11e 100644 --- a/libraries/USB/src/keyboardLayout/KeyboardLayout.h +++ b/libraries/USB/src/keyboardLayout/KeyboardLayout.h @@ -5,7 +5,7 @@ only in Keyboard.cpp and the keyboard layout files. Layout files map ASCII character codes to keyboard scan codes (technically, to USB HID Usage codes), possibly altered by the SHIFT or ALT_GR modifiers. - Non-ACSII characters (anything outside the 7-bit range NUL..DEL) are + Non-ASCII characters (anything outside the 7-bit range NUL..DEL) are not supported. == Creating your own layout == From a8bead7efba4370c3860d241af910960fc4ec708 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 22 Apr 2025 03:16:46 -0300 Subject: [PATCH 37/56] fix(gpio): Fix GPIO warning message (#11268) --- cores/esp32/esp32-hal-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index c681be077b3..90ad1e7f36d 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -185,7 +185,7 @@ extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin) { #endif // RGB_BUILTIN // This work when the pin is set as GPIO and in INPUT mode. For all other pin functions, it may return inconsistent response if (perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL) { - log_w("IO %i is not set as GPIO. digitalRead() may return an inconsistent value."); + log_w("IO %i is not set as GPIO. digitalRead() may return an inconsistent value.", pin); } return gpio_get_level((gpio_num_t)pin); } From c110ca8295fbc38c6e48a404b69aed9739fdf952 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 22 Apr 2025 05:46:59 -0300 Subject: [PATCH 38/56] docs(language): Enforce English on contributions and issues (#11267) --- .github/ISSUE_TEMPLATE/Feature-request.yml | 1 + .github/ISSUE_TEMPLATE/Issue-report.yml | 1 + docs/en/contributing.rst | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/Feature-request.yml b/.github/ISSUE_TEMPLATE/Feature-request.yml index 0788288036c..8849a407a39 100644 --- a/.github/ISSUE_TEMPLATE/Feature-request.yml +++ b/.github/ISSUE_TEMPLATE/Feature-request.yml @@ -5,6 +5,7 @@ body: - type: markdown attributes: value: | + * Please note that we can only process feature requests reported in English to ensure effective communication and support. Feature requests written in other languages will be closed, with a request to rewrite them in English. * We welcome any ideas or feature requests! It is helpful if you can explain exactly why the feature would be useful. * There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/arduino-esp32/issues?q=is%3Aopen+is%3Aissue+label%3A%22Type%3A+Feature+request%22), feel free to add comments to them. * If you would like to contribute, please read the [contributions guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html). diff --git a/.github/ISSUE_TEMPLATE/Issue-report.yml b/.github/ISSUE_TEMPLATE/Issue-report.yml index 1229df2d947..9dba5e0ca8f 100644 --- a/.github/ISSUE_TEMPLATE/Issue-report.yml +++ b/.github/ISSUE_TEMPLATE/Issue-report.yml @@ -5,6 +5,7 @@ body: - type: markdown attributes: value: | + * Please note that we can only process issues reported in English to ensure effective communication and support. Issues written in other languages will be closed, with a request to rewrite them in English. * Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue) * Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html) * Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html) diff --git a/docs/en/contributing.rst b/docs/en/contributing.rst index 4093c60ec64..4ebe01cbf5b 100644 --- a/docs/en/contributing.rst +++ b/docs/en/contributing.rst @@ -15,6 +15,9 @@ Before Contributing Before sending us a Pull Request, please consider this: +* All contributions must be written in English to ensure effective communication and support. + Pull Requests written in other languages will be closed, with a request to rewrite them in English. + * Is the contribution entirely your own work, or is it already licensed under an LGPL 2.1 compatible Open Source License? If not, cannot accept it. From 51023aea79060a9b864096fc7cc2c133c24c75ee Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 23 Apr 2025 14:20:05 -0300 Subject: [PATCH 39/56] feat(ledc): clear all fields added to ledc struct in IDF 5.4 (#11276) * feat(ledc): clear all fields added to ledc struct in IDF 5.4 * feat(ledc): use memset for all ledc struct * fix(ledc): typo - missing semi collon * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/esp32-hal-ledc.c | 38 ++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c index 0a3ec5a60c7..039fa1312f1 100644 --- a/cores/esp32/esp32-hal-ledc.c +++ b/cores/esp32/esp32-hal-ledc.c @@ -126,7 +126,14 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c return false; } } else { - ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = resolution, .freq_hz = freq, .clk_cfg = clock_source}; + ledc_timer_config_t ledc_timer; + memset((void *)&ledc_timer, 0, sizeof(ledc_timer_config_t)); + ledc_timer.speed_mode = group; + ledc_timer.timer_num = timer; + ledc_timer.duty_resolution = resolution; + ledc_timer.freq_hz = freq; + ledc_timer.clk_cfg = clock_source; + if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledc setup failed!"); return false; @@ -134,9 +141,16 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c uint32_t duty = ledc_get_duty(group, (channel % 8)); - ledc_channel_config_t ledc_channel = { - .speed_mode = group, .channel = (channel % 8), .timer_sel = timer, .intr_type = LEDC_INTR_DISABLE, .gpio_num = pin, .duty = duty, .hpoint = 0 - }; + ledc_channel_config_t ledc_channel; + memset((void *)&ledc_channel, 0, sizeof(ledc_channel_config_t)); + ledc_channel.speed_mode = group; + ledc_channel.channel = (channel % 8); + ledc_channel.timer_sel = timer; + ledc_channel.intr_type = LEDC_INTR_DISABLE; + ledc_channel.gpio_num = pin; + ledc_channel.duty = duty; + ledc_channel.hpoint = 0; + ledc_channel_config(&ledc_channel); } @@ -256,7 +270,13 @@ uint32_t ledcWriteTone(uint8_t pin, uint32_t freq) { uint8_t group = (bus->channel / 8), timer = ((bus->channel / 2) % 4); - ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = 10, .freq_hz = freq, .clk_cfg = clock_source}; + ledc_timer_config_t ledc_timer; + memset((void *)&ledc_timer, 0, sizeof(ledc_timer_config_t)); + ledc_timer.speed_mode = group; + ledc_timer.timer_num = timer; + ledc_timer.duty_resolution = 10; + ledc_timer.freq_hz = freq; + ledc_timer.clk_cfg = clock_source; if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledcWriteTone configuration failed!"); @@ -307,7 +327,13 @@ uint32_t ledcChangeFrequency(uint8_t pin, uint32_t freq, uint8_t resolution) { } uint8_t group = (bus->channel / 8), timer = ((bus->channel / 2) % 4); - ledc_timer_config_t ledc_timer = {.speed_mode = group, .timer_num = timer, .duty_resolution = resolution, .freq_hz = freq, .clk_cfg = clock_source}; + ledc_timer_config_t ledc_timer; + memset((void *)&ledc_timer, 0, sizeof(ledc_timer_config_t)); + ledc_timer.speed_mode = group; + ledc_timer.timer_num = timer; + ledc_timer.duty_resolution = resolution; + ledc_timer.freq_hz = freq; + ledc_timer.clk_cfg = clock_source; if (ledc_timer_config(&ledc_timer) != ESP_OK) { log_e("ledcChangeFrequency failed!"); From 571c2f74f23532ab204bfe9c29d609911816e67d Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 23 Apr 2025 14:20:23 -0300 Subject: [PATCH 40/56] feat(uart): sets correct ESP32/S2 clock source for the example (#11286) * feat(uart): sets correct ESP32/S2 clock source for the example * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../Serial/RxTimeout_Demo/RxTimeout_Demo.ino | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libraries/ESP32/examples/Serial/RxTimeout_Demo/RxTimeout_Demo.ino b/libraries/ESP32/examples/Serial/RxTimeout_Demo/RxTimeout_Demo.ino index 64d15d3d916..35d2da5c199 100644 --- a/libraries/ESP32/examples/Serial/RxTimeout_Demo/RxTimeout_Demo.ino +++ b/libraries/ESP32/examples/Serial/RxTimeout_Demo/RxTimeout_Demo.ino @@ -21,6 +21,15 @@ If UART receives less than 120 bytes, it will wait RX Timeout to understand that the bus is IDLE and then copy the data from the FIFO to the Arduino internal buffer, making it available to the Arduino API. + There is an important detail about how HardwareSerial works using ESP32 and ESP32-S2: + If the baud rate is lower than 250,000, it will select REF_TICK as clock source in order to avoid that + the baud rate may change when the CPU Frequency is changed. Default UART clock source is APB, which changes + when CPU clock source is also changed. But when it selects REF_TICK as UART clock source, RX Timeout is limited to 1. + Therefore, in order to change the ESP32/ESP32-S2 RX Timeout it is necessary to fix the UART Clock Source to APB. + + In the case of the other SoC, such as ESP32-S3, C3, C6, H2 and P4, there is no such RX Timeout limitation. + Those will set the UART Source Clock as XTAL, which allows the baud rate to be high and it is steady, not + changing with the CPU Frequency. */ #include @@ -45,6 +54,12 @@ void setup() { // UART1 will have its RX<->TX cross connected // GPIO4 <--> GPIO5 using external wire +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 + // UART_CLK_SRC_APB will allow higher values of RX Timeout + // default for ESP32 and ESP32-S2 is REF_TICK which limits the RX Timeout to 1 + // setClockSource() must be called before begin() + Serial1.setClockSource(UART_CLK_SRC_APB); +#endif Serial1.begin(BAUD, SERIAL_8N1, RXPIN, TXPIN); // Rx = 4, Tx = 5 will work for ESP32, S2, S3 and C3 #if USE_INTERNAL_PIN_LOOPBACK uart_internal_loopback(TEST_UART, RXPIN); From 5262f5ad5ee5b9c0388a06f6061d1a571f3bca86 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:45:12 -0300 Subject: [PATCH 41/56] ci(idf): Use included IDF examples in CI (#11240) * ci(idf): Use included IDF examples in CI * fix(example): sets Matter version to be 1.3 or higher * feat(matter): sets c++ 2a as default * feat(matter): Update README.md * fix(matter): instructions about using more than one sdkconfig file --------- Co-authored-by: Sugar Glider --- .github/scripts/on-push-idf.sh | 33 +++++++ .github/scripts/sketch_utils.sh | 2 +- .github/workflows/push.yml | 20 ++-- idf_component_examples/.gitignore | 4 + .../esp_matter_light/CMakeLists.txt | 3 +- .../esp_matter_light/README.md | 21 +++- .../esp_matter_light/ci.json | 11 +++ .../esp_matter_light/main/Kconfig.projbuild | 96 ++++--------------- .../esp_matter_light/main/idf_component.yml | 4 +- ...ig.defaults.esp32c3 => sdkconfig.defaults} | 2 - .../sdkconfig.defaults.esp32c6 | 63 ------------ .../sdkconfig.defaults.esp32s3 | 64 ------------- .../hello_world/CMakeLists.txt | 2 + .../hw_cdc_hello_world/CMakeLists.txt | 1 + .../hw_cdc_hello_world/ci.json | 5 + 15 files changed, 109 insertions(+), 222 deletions(-) create mode 100644 .github/scripts/on-push-idf.sh create mode 100644 idf_component_examples/.gitignore create mode 100644 idf_component_examples/esp_matter_light/ci.json rename idf_component_examples/esp_matter_light/{sdkconfig.defaults.esp32c3 => sdkconfig.defaults} (98%) delete mode 100644 idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3 create mode 100644 idf_component_examples/hw_cdc_hello_world/ci.json diff --git a/.github/scripts/on-push-idf.sh b/.github/scripts/on-push-idf.sh new file mode 100644 index 00000000000..72e7c7f574e --- /dev/null +++ b/.github/scripts/on-push-idf.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements" + +# Export IDF environment +. ${IDF_PATH}/export.sh + +# Find all examples in ./components/arduino-esp32/idf_component_examples +idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d) + +for example in $idf_component_examples; do + if [ -f "$example"/ci.json ]; then + # If the target is listed as false, skip the sketch. Otherwise, include it. + is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example"/ci.json) + if [[ "$is_target" == "false" ]]; then + printf "\n\033[93mSkipping %s for target %s\033[0m\n\n" "$example" "$IDF_TARGET" + continue + fi + fi + + idf.py -C "$example" set-target "$IDF_TARGET" + + has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig") + if [ "$has_requirements" -eq 0 ]; then + printf "\n\033[93m%s does not meet the requirements for %s. Skipping...\033[0m\n\n" "$example" "$IDF_TARGET" + continue + fi + + printf "\n\033[95mBuilding %s\033[0m\n\n" "$example" + idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build +done diff --git a/.github/scripts/sketch_utils.sh b/.github/scripts/sketch_utils.sh index e536da50111..befea255e0b 100755 --- a/.github/scripts/sketch_utils.sh +++ b/.github/scripts/sketch_utils.sh @@ -16,7 +16,7 @@ function check_requirements { # check_requirements local requirements_or if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then - echo "ERROR: sdkconfig or ci.json not found" 1>&2 + echo "WARNING: sdkconfig or ci.json not found. Assuming requirements are met." 1>&2 # Return 1 on error to force the sketch to be built and fail. This way the # CI will fail and the user will know that the sketch has a problem. else diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d98da24fc07..c8b8ddc2127 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,6 +31,7 @@ on: - "!libraries/**.properties" - "!libraries/**.py" - "package/**" + - "idf_component_examples/**" - "tools/**.py" - "platform.txt" - "programmers.txt" @@ -45,7 +46,6 @@ on: - "!.github/scripts/tests_*" - "!.github/scripts/upload_*" - "variants/esp32/**/*" - - "variants/esp32c2/**/*" - "variants/esp32c3/**/*" - "variants/esp32c6/**/*" - "variants/esp32h2/**/*" @@ -124,7 +124,7 @@ jobs: - 'idf_component.yml' - 'Kconfig.projbuild' - 'CMakeLists.txt' - - "variants/esp32c2/**/*" + - "idf_component_examples/**" - name: Set chunks id: set-chunks @@ -267,15 +267,23 @@ jobs: submodules: recursive path: components/arduino-esp32 + - name: Setup jq + uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1 + - name: Build env: IDF_TARGET: ${{ matrix.idf_target }} shell: bash run: | - . ${IDF_PATH}/export.sh - idf.py create-project test - echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults - idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build + chmod a+x ./components/arduino-esp32/.github/scripts/* + ./components/arduino-esp32/.github/scripts/on-push-idf.sh + + - name: Upload generated sdkconfig files for debugging + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: sdkconfig-${{ matrix.idf_target }} + path: ./components/arduino-esp32/idf_component_examples/**/sdkconfig # Save artifacts to gh-pages save-master-artifacts: diff --git a/idf_component_examples/.gitignore b/idf_component_examples/.gitignore new file mode 100644 index 00000000000..6052fd4e70b --- /dev/null +++ b/idf_component_examples/.gitignore @@ -0,0 +1,4 @@ +build/ +managed_components/ +dependencies.lock +sdkconfig diff --git a/idf_component_examples/esp_matter_light/CMakeLists.txt b/idf_component_examples/esp_matter_light/CMakeLists.txt index 16a7533f2a5..1430df8ff78 100644 --- a/idf_component_examples/esp_matter_light/CMakeLists.txt +++ b/idf_component_examples/esp_matter_light/CMakeLists.txt @@ -8,6 +8,7 @@ set(PROJECT_VER_NUMBER 1) # This should be done before using the IDF_TARGET variable. include($ENV{IDF_PATH}/tools/cmake/project.cmake) +idf_build_set_property(MINIMAL_BUILD ON) project(arduino_managed_component_light) # WARNING: This is just an example for using key for decrypting the encrypted OTA image @@ -20,7 +21,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/idf_component_examples/esp_matter_light/README.md b/idf_component_examples/esp_matter_light/README.md index 06a22cdceac..b0173f6a437 100644 --- a/idf_component_examples/esp_matter_light/README.md +++ b/idf_component_examples/esp_matter_light/README.md @@ -59,15 +59,22 @@ Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1 This example has been tested with Arduino Core 3.0.4 The project will download all necessary components, including the Arduino Core. -Run `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults..idf" -p flash monitor` +Execute this sequence: + ` using linux rm command or Windows rmdir command` + `idf.py set-target ` + `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig_file1;sdkconfig_file2;sdkconfig_fileX" -p flash monitor` Example for ESP32-S3/Linux | macOS: ``` -idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3" -p /dev/ttyACM0 flash monitor +rm -rf build +idf.py set-target esp32s3 +idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p /dev/ttyACM0 flash monitor ``` Example for ESP32-C3/Windows: ``` -idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3" -p com3 flash monitor +rmdir /s/q build +idf.py set-target esp32c3 +idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p com3 flash monitor ``` It may be necessary to delete some folders and files before running `idf.py` @@ -95,11 +102,15 @@ In order to build the application that will use Thread Networking instead of Wi- Example for ESP32-C6/Linux | macOS: ``` -idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor +rm -rf build +idf.py set-target esp32c6 +idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor ``` Example for ESP32-C6/Windows: ``` -idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p com3 flash monitor +rmdir /s/q build +idf.py set-targt esp32c6 +idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p com3 flash monitor ``` It may be necessary to delete some folders and files before running `idf.py` diff --git a/idf_component_examples/esp_matter_light/ci.json b/idf_component_examples/esp_matter_light/ci.json new file mode 100644 index 00000000000..f23a085285d --- /dev/null +++ b/idf_component_examples/esp_matter_light/ci.json @@ -0,0 +1,11 @@ +{ + "targets": { + "esp32c2": false, + "esp32s2": false + }, + "requires": [ + "CONFIG_SOC_WIFI_SUPPORTED=y", + "CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y", + "CONFIG_MBEDTLS_HKDF_C=y" + ] +} diff --git a/idf_component_examples/esp_matter_light/main/Kconfig.projbuild b/idf_component_examples/esp_matter_light/main/Kconfig.projbuild index 6e6abcb7fcf..3e0a35c5e15 100644 --- a/idf_component_examples/esp_matter_light/main/Kconfig.projbuild +++ b/idf_component_examples/esp_matter_light/main/Kconfig.projbuild @@ -3,100 +3,40 @@ menu "Light Matter Accessory" config BUTTON_PIN int prompt "Button 1 GPIO" - default ENV_GPIO_BOOT_BUTTON + default 9 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 + default 0 range -1 ENV_GPIO_IN_RANGE_MAX help The GPIO pin for button that will be used to turn on/off the Matter Light. It shall be connected to a push button. It can use the BOOT button of the development board. endmenu - menu "LEDs" config WS2812_PIN int prompt "WS2812 RGB LED GPIO" - default ENV_GPIO_RGB_LED + default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 + default 48 range -1 ENV_GPIO_OUT_RANGE_MAX help The GPIO pin for the Matter Light that will be driven by RMT. It shall be connected to one single WS2812 RGB LED. endmenu - # TARGET CONFIGURATION - if IDF_TARGET_ESP32C3 - config ENV_GPIO_RANGE_MIN - int - default 0 - - config ENV_GPIO_RANGE_MAX - int - default 19 - # GPIOs 20/21 are always used by UART in examples - - config ENV_GPIO_IN_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX - - config ENV_GPIO_OUT_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX - - config ENV_GPIO_BOOT_BUTTON - int - default 9 - - config ENV_GPIO_RGB_LED - int - default 8 - endif - if IDF_TARGET_ESP32C6 - config ENV_GPIO_RANGE_MIN - int - default 0 + config ENV_GPIO_RANGE_MIN + int + default 0 - config ENV_GPIO_RANGE_MAX - int - default 30 - # GPIOs 16/17 are always used by UART in examples + config ENV_GPIO_RANGE_MAX + int + default 19 if IDF_TARGET_ESP32C3 + default 30 if IDF_TARGET_ESP32C6 + default 48 - config ENV_GPIO_IN_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX + config ENV_GPIO_IN_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX - config ENV_GPIO_OUT_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX - - config ENV_GPIO_BOOT_BUTTON - int - default 9 - - config ENV_GPIO_RGB_LED - int - default 8 - endif - if IDF_TARGET_ESP32S3 - config ENV_GPIO_RANGE_MIN - int - default 0 - - config ENV_GPIO_RANGE_MAX - int - default 48 - - config ENV_GPIO_IN_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX - - config ENV_GPIO_OUT_RANGE_MAX - int - default ENV_GPIO_RANGE_MAX - - config ENV_GPIO_BOOT_BUTTON - int - default 0 - - config ENV_GPIO_RGB_LED - int - default 48 - endif + config ENV_GPIO_OUT_RANGE_MAX + int + default ENV_GPIO_RANGE_MAX endmenu diff --git a/idf_component_examples/esp_matter_light/main/idf_component.yml b/idf_component_examples/esp_matter_light/main/idf_component.yml index 2b4ae4b34a4..e0286324591 100644 --- a/idf_component_examples/esp_matter_light/main/idf_component.yml +++ b/idf_component_examples/esp_matter_light/main/idf_component.yml @@ -1,9 +1,9 @@ dependencies: espressif/esp_matter: - version: "^1.3.0" + version: ">=1.3.0" # Adds Arduino Core from GitHub repository using main branch espressif/arduino-esp32: - version: "^3.0.5" + version: ">=3.0.5" override_path: "../../../" pre_release: true diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3 b/idf_component_examples/esp_matter_light/sdkconfig.defaults similarity index 98% rename from idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3 rename to idf_component_examples/esp_matter_light/sdkconfig.defaults index df6d6b0d585..43871661856 100644 --- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3 +++ b/idf_component_examples/esp_matter_light/sdkconfig.defaults @@ -1,5 +1,3 @@ -CONFIG_IDF_TARGET="esp32c3" - # Arduino Settings CONFIG_FREERTOS_HZ=1000 CONFIG_AUTOSTART_ARDUINO=y diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6 b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6 index f228f3158c8..9fe589613ef 100644 --- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6 +++ b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6 @@ -1,68 +1,5 @@ CONFIG_IDF_TARGET="esp32c6" -# Arduino Settings -CONFIG_FREERTOS_HZ=1000 -CONFIG_AUTOSTART_ARDUINO=y - -# Log Levels -# Boot Messages - Log level -CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y -# Arduino Log Level -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y -# IDF Log Level -CONFIG_LOG_DEFAULT_LEVEL_ERROR=y - -# Default to 921600 baud when flashing and monitoring device -CONFIG_ESPTOOLPY_BAUD_921600B=y -CONFIG_ESPTOOLPY_BAUD=921600 -CONFIG_ESPTOOLPY_COMPRESSED=y -CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y - -#enable BT -CONFIG_BT_ENABLED=y -CONFIG_BT_NIMBLE_ENABLED=y - -#disable BT connection reattempt -CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n - -#enable lwip ipv6 autoconfig -CONFIG_LWIP_IPV6_AUTOCONFIG=y - -# Use a custom partition table -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0xC000 - -# Disable chip shell -CONFIG_ENABLE_CHIP_SHELL=n - -# Enable OTA Requester -CONFIG_ENABLE_OTA_REQUESTOR=n - -#enable lwIP route hooks -CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y -CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y - -# disable softap by default -CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n -CONFIG_ENABLE_WIFI_STATION=y -CONFIG_ENABLE_WIFI_AP=n - -# Disable DS Peripheral -CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=n - -# Use compact attribute storage mode -CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y - -# Enable HKDF in mbedtls -CONFIG_MBEDTLS_HKDF_C=y - -# Increase LwIP IPv6 address number to 6 (MAX_FABRIC + 1) -# unique local addresses for fabrics(MAX_FABRIC), a link local address(1) -CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 - # libsodium CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3 b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3 deleted file mode 100644 index 9c1aa36b6c9..00000000000 --- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3 +++ /dev/null @@ -1,64 +0,0 @@ -CONFIG_IDF_TARGET="esp32s3" - -# Arduino Settings -CONFIG_FREERTOS_HZ=1000 -CONFIG_AUTOSTART_ARDUINO=y - -# Log Levels -# Boot Messages - Log level -CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y -# Arduino Log Level -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y -# IDF Log Level -CONFIG_LOG_DEFAULT_LEVEL_ERROR=y - -# Default to 921600 baud when flashing and monitoring device -CONFIG_ESPTOOLPY_BAUD_921600B=y -CONFIG_ESPTOOLPY_BAUD=921600 -CONFIG_ESPTOOLPY_COMPRESSED=y -CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y - -#enable BT -CONFIG_BT_ENABLED=y -CONFIG_BT_NIMBLE_ENABLED=y - -#disable BT connection reattempt -CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n - -#enable lwip ipv6 autoconfig -CONFIG_LWIP_IPV6_AUTOCONFIG=y - -# Use a custom partition table -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0xC000 - -# Disable chip shell -CONFIG_ENABLE_CHIP_SHELL=n - -# Enable OTA Requester -CONFIG_ENABLE_OTA_REQUESTOR=n - -#enable lwIP route hooks -CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y -CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y - -# disable softap by default -CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n -CONFIG_ENABLE_WIFI_STATION=y -CONFIG_ENABLE_WIFI_AP=n - -# Disable DS Peripheral -CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=n - -# Use compact attribute storage mode -CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y - -# Enable HKDF in mbedtls -CONFIG_MBEDTLS_HKDF_C=y - -# Increase LwIP IPv6 address number to 6 (MAX_FABRIC + 1) -# unique local addresses for fabrics(MAX_FABRIC), a link local address(1) -CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/idf_component_examples/hello_world/CMakeLists.txt b/idf_component_examples/hello_world/CMakeLists.txt index 664d45871d0..af087cf42b6 100644 --- a/idf_component_examples/hello_world/CMakeLists.txt +++ b/idf_component_examples/hello_world/CMakeLists.txt @@ -5,4 +5,6 @@ cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +idf_build_set_property(MINIMAL_BUILD ON) project(main) diff --git a/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt b/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt index 16bb1063af3..1c3971f4dbf 100644 --- a/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt +++ b/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt @@ -9,4 +9,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) list(APPEND compile_definitions "ARDUINO_USB_CDC_ON_BOOT=1") list(APPEND compile_definitions "ARDUINO_USB_MODE=1") +idf_build_set_property(MINIMAL_BUILD ON) project(hw_cdc_hello_world) diff --git a/idf_component_examples/hw_cdc_hello_world/ci.json b/idf_component_examples/hw_cdc_hello_world/ci.json new file mode 100644 index 00000000000..80669afc2cc --- /dev/null +++ b/idf_component_examples/hw_cdc_hello_world/ci.json @@ -0,0 +1,5 @@ +{ + "requires": [ + "CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y" + ] +} From 8ed97f6fa83caa19c093a4b694fc5f22662bdd39 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:45:31 -0300 Subject: [PATCH 42/56] ci(release): Add package JSON with chinese mirrors (#11288) * ci(release): Add package JSON with chinese mirrors * fix(comment): Fix comment with proper description --- .github/scripts/on-release.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/scripts/on-release.sh b/.github/scripts/on-release.sh index 242cee93d0b..dafbf3d6a1c 100755 --- a/.github/scripts/on-release.sh +++ b/.github/scripts/on-release.sh @@ -35,6 +35,8 @@ PACKAGE_JSON_MERGE="$GITHUB_WORKSPACE/.github/scripts/merge_packages.py" PACKAGE_JSON_TEMPLATE="$GITHUB_WORKSPACE/package/package_esp32_index.template.json" PACKAGE_JSON_DEV="package_esp32_dev_index.json" PACKAGE_JSON_REL="package_esp32_index.json" +PACKAGE_JSON_DEV_CN="package_esp32_dev_index_cn.json" +PACKAGE_JSON_REL_CN="package_esp32_index_cn.json" echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF" echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID" @@ -339,9 +341,13 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \ # Generate package JSONs echo "Generating $PACKAGE_JSON_DEV ..." cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV" +# On MacOS the sed command won't skip the first match. Use gsed instead. +sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN" if [ "$RELEASE_PRE" == "false" ]; then echo "Generating $PACKAGE_JSON_REL ..." cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL" + # On MacOS the sed command won't skip the first match. Use gsed instead. + sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN" fi # Figure out the last release or pre-release @@ -373,12 +379,14 @@ echo if [ -n "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then echo "Merging with JSON from $prev_any_release ..." merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV" + merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN" fi if [ "$RELEASE_PRE" == "false" ]; then if [ -n "$prev_release" ] && [ "$prev_release" != "null" ]; then echo "Merging with JSON from $prev_release ..." merge_package_json "$prev_release/$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL" + merge_package_json "$prev_release/$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN" fi fi @@ -388,6 +396,8 @@ echo "Installing arduino-cli ..." export PATH="/home/runner/bin:$PATH" source "${SCRIPTS_DIR}/install-arduino-cli.sh" +# For the Chinese mirror, we can't test the package JSONs as the Chinese mirror might not be updated yet. + echo "Testing $PACKAGE_JSON_DEV install ..." echo "Installing esp32 ..." @@ -445,11 +455,15 @@ fi echo "Uploading $PACKAGE_JSON_DEV ..." echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")" echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")" +echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")" +echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")" echo if [ "$RELEASE_PRE" == "false" ]; then echo "Uploading $PACKAGE_JSON_REL ..." echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")" echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")" + echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")" + echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")" echo fi From 5df9b6402337dd555096efa0f9eef76f669560b4 Mon Sep 17 00:00:00 2001 From: Lewis He Date: Mon, 28 Apr 2025 23:45:54 +0800 Subject: [PATCH 43/56] Update LilyGo T-Watch-S3-Ultra and T-LoRa-Pager variants (#11299) * Update LilyGo variants * Update T-Watch-S3-Ultra variants * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- boards.txt | 27 ++++++++++++++------ variants/lilygo_tlora_pager/pins_arduino.h | 28 +++++++++++---------- variants/lilygo_twatch_s3/pins_arduino.h | 2 +- variants/lilygo_twatch_ultra/pins_arduino.h | 11 ++++---- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/boards.txt b/boards.txt index f0df27762c2..7406e866b3f 100644 --- a/boards.txt +++ b/boards.txt @@ -6007,12 +6007,12 @@ twatchs3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) twatchs3.menu.UploadMode.cdc.upload.use_1200bps_touch=true twatchs3.menu.UploadMode.cdc.upload.wait_for_upload_port=true -twatchs3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) -twatchs3.menu.PartitionScheme.fatflash.build.partitions=ffat -twatchs3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 twatchs3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) twatchs3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB twatchs3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +twatchs3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +twatchs3.menu.PartitionScheme.fatflash.build.partitions=ffat +twatchs3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 twatchs3.menu.PartitionScheme.rainmaker=RainMaker twatchs3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker twatchs3.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 @@ -6076,6 +6076,10 @@ twatchs3.menu.Revision.Radio_SX1280=Radio-SX1280 twatchs3.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 twatchs3.menu.Revision.Radio_CC1101=Radio-CC1101 twatchs3.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 +twatchs3.menu.Revision.Radio_LR1121=Radio-LR1121 +twatchs3.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121 +twatchs3.menu.Revision.Radio_SI4432=Radio-SI4432 +twatchs3.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432 ############################################################## @@ -6231,13 +6235,16 @@ twatch_ultra.menu.EraseFlash.none.upload.erase_cmd= twatch_ultra.menu.EraseFlash.all=Enabled twatch_ultra.menu.EraseFlash.all.upload.erase_cmd=-e -twatch_ultra.menu.Revision.Radio_SX1280=Radio-SX1280 -twatch_ultra.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 twatch_ultra.menu.Revision.Radio_SX1262=Radio-SX1262 twatch_ultra.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262 +twatch_ultra.menu.Revision.Radio_SX1280=Radio-SX1280 +twatch_ultra.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 twatch_ultra.menu.Revision.Radio_CC1101=Radio-CC1101 twatch_ultra.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 - +twatch_ultra.menu.Revision.Radio_LR1121=Radio-LR1121 +twatch_ultra.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121 +twatch_ultra.menu.Revision.Radio_SI4432=Radio-SI4432 +twatch_ultra.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432 ############################################################## @@ -6393,12 +6400,16 @@ tlora_pager.menu.EraseFlash.all=Enabled tlora_pager.menu.EraseFlash.all.upload.erase_cmd=-e -tlora_pager.menu.Revision.Radio_SX1280=Radio-SX1280 -tlora_pager.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 tlora_pager.menu.Revision.Radio_SX1262=Radio-SX1262 tlora_pager.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262 +tlora_pager.menu.Revision.Radio_SX1280=Radio-SX1280 +tlora_pager.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280 tlora_pager.menu.Revision.Radio_CC1101=Radio-CC1101 tlora_pager.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101 +tlora_pager.menu.Revision.Radio_LR1121=Radio-LR1121 +tlora_pager.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121 +tlora_pager.menu.Revision.Radio_SI4432=Radio-SI4432 +tlora_pager.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432 ############################################################## diff --git a/variants/lilygo_tlora_pager/pins_arduino.h b/variants/lilygo_tlora_pager/pins_arduino.h index a7e03c759bd..fb57b5d493f 100644 --- a/variants/lilygo_tlora_pager/pins_arduino.h +++ b/variants/lilygo_tlora_pager/pins_arduino.h @@ -20,9 +20,9 @@ static const uint8_t TX = 43; static const uint8_t RX = 44; -//BHI260,PCF85063,BQ25896,DRV2605L,ES8311 share I2C Bus -static const uint8_t SDA = 2; -static const uint8_t SCL = 3; +// BHI260,PCF85063,BQ25896,DRV2605L,ES8311 share I2C Bus +static const uint8_t SDA = 3; +static const uint8_t SCL = 2; // Default sd cs pin static const uint8_t SS = SD_CS; @@ -75,16 +75,18 @@ static const uint8_t SCK = 35; #define DISP_BL (42) // External expansion chip IO definition -#define EXPANDS_DRV_EN (0) -#define EXPANDS_AMP_EN (1) -#define EXPANDS_KB_RST (2) -#define EXPANDS_LORA_EN (3) -#define EXPANDS_GPS_EN (4) -#define EXPANDS_NFC_EN (5) -#define EXPANDS_DISP_RST (6) -#define EXPANDS_GPS_RST (7) -#define EXPANDS_KB_EN (8) -#define EXPANDS_GPIO_EN (9) +#define EXPANDS_DRV_EN (0) +#define EXPANDS_AMP_EN (1) +#define EXPANDS_KB_RST (2) +#define EXPANDS_LORA_EN (3) +#define EXPANDS_GPS_EN (4) +#define EXPANDS_NFC_EN (5) +#define EXPANDS_GPS_RST (7) +#define EXPANDS_KB_EN (8) +#define EXPANDS_GPIO_EN (9) +#define EXPANDS_SD_DET (10) +#define EXPANDS_SD_PULLEN (11) +#define EXPANDS_SD_EN (12) // Peripheral definition exists #define USING_AUDIO_CODEC diff --git a/variants/lilygo_twatch_s3/pins_arduino.h b/variants/lilygo_twatch_s3/pins_arduino.h index b184dc9ba17..05543de27c5 100644 --- a/variants/lilygo_twatch_s3/pins_arduino.h +++ b/variants/lilygo_twatch_s3/pins_arduino.h @@ -44,7 +44,7 @@ static const uint8_t TX = 42; static const uint8_t RX = 41; -//BHI260,PCF85063,AXP2101,DRV2605L,PN532 share I2C Bus +// BMA423,PCF8563,AXP2101,DRV2605L share I2C Bus static const uint8_t SDA = 10; static const uint8_t SCL = 11; diff --git a/variants/lilygo_twatch_ultra/pins_arduino.h b/variants/lilygo_twatch_ultra/pins_arduino.h index c90c1ba584e..91797e687fa 100644 --- a/variants/lilygo_twatch_ultra/pins_arduino.h +++ b/variants/lilygo_twatch_ultra/pins_arduino.h @@ -22,6 +22,7 @@ #define DISP_D3 (45) #define DISP_SCK (40) #define DISP_CS (41) +#define DISP_RST (37) #define DISP_TE (6) // Interrupt IO port @@ -47,9 +48,9 @@ static const uint8_t TX = 43; static const uint8_t RX = 44; -//BHI260,PCF85063,AXP2101,DRV2605L,PN532 share I2C Bus -static const uint8_t SDA = 2; -static const uint8_t SCL = 3; +// BHI260,PCF85063,AXP2101,DRV2605L share I2C Bus +static const uint8_t SDA = 3; +static const uint8_t SCL = 2; // Default sd cs pin static const uint8_t SS = SD_CS; @@ -76,8 +77,8 @@ static const uint8_t SCK = 35; // External expansion chip IO definition #define EXPANDS_DRV_EN (6) #define EXPANDS_DISP_EN (7) -#define EXPANDS_TOUCH_RST (10) -#define EXPANDS_DISP_RST (11) +#define EXPANDS_TOUCH_RST (8) +#define EXPANDS_SD_DET (10) // Peripheral definition exists #define USING_XL9555_EXPANDS From 8d121e075fcd7e09787b02cfbd2929121930a428 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Mon, 28 Apr 2025 12:46:12 -0300 Subject: [PATCH 44/56] feat(rmt): fixes example to run correctly within IDF 5.x (#11292) * feat(rmt): fixes exaple to run correctly within IDF 5.x * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../RMT/RMT_LED_Blink/RMT_LED_Blink.ino | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino b/libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino index 8c2b8db3cd1..1cdd2224ea5 100644 --- a/libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino +++ b/libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino @@ -1,4 +1,4 @@ -// Copyright 2023 Espressif Systems (Shanghai) PTE LTD +// Copyright 2025 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,16 +13,16 @@ // limitations under the License. /** - * @brief This example demonstrate how to use RMT to just blink a regular LED (GPIO) - * It uses all the different RMT Writing APIs to blink the LED by hardware, not being - * necessary the regular Blink code in Arduino. - * - * The output is the Blinking LED in the GPIO and a serial output describing what is - * going on, along the execution. - * - * The circuit is just a LED and a resistor of 270 ohms connected to the GPIO - * GPIO ---> resistor 270 ohms ---> + LED - ---> GND - */ + @brief This example demonstrate how to use RMT to just blink a regular LED (GPIO) + It uses all the different RMT Writing APIs to blink the LED by hardware, not being + necessary the regular Blink code in Arduino. + + The output is the Blinking LED in the GPIO and a serial output describing what is + going on, along the execution. + + The circuit is just a LED and a resistor of 270 ohms connected to the GPIO + GPIO ---> resistor 270 ohms ---> + LED - ---> GND +*/ #define BLINK_GPIO 2 @@ -232,7 +232,7 @@ void RMT_Mixed_Write_Blink() { Serial.println("===> rmtWrite() (Blocking Mode) to Blink the LED."); Serial.println("Blinking at 500ms on + 500ms off :: 4 blinks"); for (uint8_t i = 0; i < 4; i++) { - if (!rmtWrite(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 2, RMT_WAIT_FOR_EVER)) { + if (!rmtWrite(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 1, RMT_WAIT_FOR_EVER)) { Serial.println("===> rmtWrite Blink 0.5s Error!"); } } @@ -240,7 +240,7 @@ void RMT_Mixed_Write_Blink() { Serial.println("===> rmtWriteAsync() (Non-Blocking Mode) to Blink the LED."); Serial.println("Blinking at 250ms on + 250ms off :: 5 blinks"); for (uint8_t i = 0; i < 5; i++) { - if (!rmtWriteAsync(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 2)) { + if (!rmtWriteAsync(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 1)) { Serial.println("===> rmtWrite Blink 0.25s Error!"); } // wait (blocks) until all the data is sent out @@ -267,9 +267,11 @@ void RMT_Loop_Write_Blink() { Serial.println("===> rmtWriteLooping Blink 0.25s Error!"); } delay(5000); + Serial.println("Blinking OFF for 2 seconds"); - if (!rmtWriteLooping(BLINK_GPIO, NULL, 0)) { - Serial.println("===> rmtWriteLooping Blink OFF Error!"); + rmt_data_t blink_STOP_rmt_data[] = {{0, 0, 0, 0}}; + if (!rmtWrite(BLINK_GPIO, blink_STOP_rmt_data, RMT_SYMBOLS_OF(blink_STOP_rmt_data), RMT_WAIT_FOR_EVER)) { + Serial.println("===> rmtWrite Blink STOP Error!"); } delay(2000); } @@ -278,19 +280,19 @@ void RMT_Single_Write_Blocking_Blink() { Serial.println("Using RMT Writing and its Completion to blink an LED."); Serial.println("Blinking at 1s on + 1s off :: 2 blinks"); for (uint8_t i = 0; i < 2; i++) { - if (!rmtWrite(BLINK_GPIO, blink_1s_rmt_data, RMT_SYMBOLS_OF(blink_1s_rmt_data) - 2, RMT_WAIT_FOR_EVER)) { + if (!rmtWrite(BLINK_GPIO, blink_1s_rmt_data, RMT_SYMBOLS_OF(blink_1s_rmt_data) - 1, RMT_WAIT_FOR_EVER)) { Serial.println("===> rmtWrite Blink 1s Error!"); } } Serial.println("Blinking at 500ms on + 500ms off :: 4 blinks"); for (uint8_t i = 0; i < 4; i++) { - if (!rmtWrite(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 2, RMT_WAIT_FOR_EVER)) { + if (!rmtWrite(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 1, RMT_WAIT_FOR_EVER)) { Serial.println("===> rmtWrite Blink 0.5s Error!"); } } Serial.println("Blinking at 250ms on + 250ms off :: 8 blinks"); for (uint8_t i = 0; i < 8; i++) { - if (!rmtWrite(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 2, RMT_WAIT_FOR_EVER)) { + if (!rmtWrite(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 1, RMT_WAIT_FOR_EVER)) { Serial.println("===> rmtWrite Blink 0.25s Error!"); } } @@ -302,7 +304,7 @@ void RMT_Write_Aync_Non_Blocking_Blink() { Serial.println("Using RMT Async Writing and its Completion to blink an LED."); Serial.println("Blinking at 1s on + 1s off :: 5 blinks"); for (uint8_t i = 0; i < 5; i++) { - if (!rmtWriteAsync(BLINK_GPIO, blink_1s_rmt_data, RMT_SYMBOLS_OF(blink_1s_rmt_data) - 2)) { + if (!rmtWriteAsync(BLINK_GPIO, blink_1s_rmt_data, RMT_SYMBOLS_OF(blink_1s_rmt_data) - 1)) { Serial.println("===> rmtWrite Blink 1s Error!"); } // wait (blocks) until all the data is sent out @@ -310,7 +312,7 @@ void RMT_Write_Aync_Non_Blocking_Blink() { } Serial.println("Blinking at 500ms on + 500ms off :: 5 blinks"); for (uint8_t i = 0; i < 5; i++) { - if (!rmtWriteAsync(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 2)) { + if (!rmtWriteAsync(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data) - 1)) { Serial.println("===> rmtWrite Blink 0.5s Error!"); } // wait (blocks) until all the data is sent out @@ -318,7 +320,7 @@ void RMT_Write_Aync_Non_Blocking_Blink() { } Serial.println("Blinking at 250ms on + 250ms off :: 5 blinks"); for (uint8_t i = 0; i < 5; i++) { - if (!rmtWriteAsync(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 2)) { + if (!rmtWriteAsync(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data) - 1)) { Serial.println("===> rmtWrite Blink 0.25s Error!"); } // wait (blocks) until all the data is sent out @@ -345,7 +347,6 @@ void setup() { RMT_Mixed_Write_Blink(); Serial.println("End of Mixed Calls testing"); - delay(1000); Serial.println("\n==============================="); Serial.println("Starting a Blinking sequence..."); From 9193c9db1eaca6017df293134e3ffbfbe602541d Mon Sep 17 00:00:00 2001 From: microbots Date: Mon, 28 Apr 2025 19:27:17 +0200 Subject: [PATCH 45/56] Update boards.txt with updated CodeCell board variant (#11313) * Update boards.txt * Update boards.txt * Update boards.txt * Update boards.txt --------- Co-authored-by: Carl Bugeja --- boards.txt | 132 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 123 insertions(+), 9 deletions(-) diff --git a/boards.txt b/boards.txt index 7406e866b3f..7113bf4c248 100644 --- a/boards.txt +++ b/boards.txt @@ -43277,20 +43277,22 @@ alfredo-nou3.menu.EraseFlash.all=Enabled alfredo-nou3.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## -codecell.name=CodeCell -codecell.vid.0=0x303a -codecell.pid.0=0x1002 -codecell.upload_port.0.vid=0x303a -codecell.upload_port.0.pid=0x1002 +codecell.name=CodeCell C3 codecell.bootloader.tool=esptool_py +codecell.bootloader.tool.default=esptool_py + codecell.upload.tool=esptool_py -codecell.upload.maximum_size=4194304 +codecell.upload.tool.default=esptool_py +codecell.upload.tool.network=esp_ota + +codecell.upload.maximum_size=1310720 codecell.upload.maximum_data_size=327680 +codecell.upload.flags= +codecell.upload.extra_flags= codecell.upload.use_1200bps_touch=false codecell.upload.wait_for_upload_port=false -codecell.upload.speed=921600 codecell.serial.disableDTR=false codecell.serial.disableRTS=false @@ -43299,8 +43301,9 @@ codecell.build.target=esp codecell.build.mcu=esp32c3 codecell.build.core=esp32 codecell.build.variant=codecell -codecell.build.board=ESP32C3_DEV +codecell.build.board=CODECELLC3 codecell.build.bootloader_addr=0x0 + codecell.build.cdc_on_boot=1 codecell.build.f_cpu=160000000L codecell.build.flash_size=4MB @@ -43308,13 +43311,118 @@ codecell.build.flash_freq=80m codecell.build.flash_mode=qio codecell.build.boot=qio codecell.build.partitions=default +codecell.build.defines= + + +codecell.menu.JTAGAdapter.default=Disabled +codecell.menu.JTAGAdapter.default.build.copy_jtag_files=0 +codecell.menu.JTAGAdapter.builtin=Integrated USB JTAG +codecell.menu.JTAGAdapter.builtin.build.openocdscript=esp32c3-builtin.cfg +codecell.menu.JTAGAdapter.builtin.build.copy_jtag_files=1 +codecell.menu.JTAGAdapter.external=FTDI Adapter +codecell.menu.JTAGAdapter.external.build.openocdscript=esp32c3-ftdi.cfg +codecell.menu.JTAGAdapter.external.build.copy_jtag_files=1 +codecell.menu.JTAGAdapter.bridge=ESP USB Bridge +codecell.menu.JTAGAdapter.bridge.build.openocdscript=esp32c3-bridge.cfg +codecell.menu.JTAGAdapter.bridge.build.copy_jtag_files=1 + +codecell.menu.CDCOnBoot.default=Enabled +codecell.menu.CDCOnBoot.default.build.cdc_on_boot=0 +codecell.menu.CDCOnBoot.cdc=Enabled +codecell.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 codecell.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -codecell.menu.CPUFreq.160=160MHz +codecell.menu.PartitionScheme.default.build.partitions=default +codecell.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +codecell.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +codecell.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +codecell.menu.PartitionScheme.minimal.build.partitions=minimal +codecell.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2) +codecell.menu.PartitionScheme.no_fs.build.partitions=no_fs +codecell.menu.PartitionScheme.no_fs.upload.maximum_size=2031616 +codecell.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +codecell.menu.PartitionScheme.no_ota.build.partitions=no_ota +codecell.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +codecell.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +codecell.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +codecell.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +codecell.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +codecell.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +codecell.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +codecell.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +codecell.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +codecell.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +codecell.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +codecell.menu.PartitionScheme.huge_app.build.partitions=huge_app +codecell.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +codecell.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +codecell.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +codecell.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +codecell.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +codecell.menu.PartitionScheme.fatflash.build.partitions=ffat +codecell.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +codecell.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +codecell.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +codecell.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +codecell.menu.PartitionScheme.rainmaker=RainMaker 4MB +codecell.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +codecell.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 +codecell.menu.PartitionScheme.rainmaker_4MB=RainMaker 4MB No OTA +codecell.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota +codecell.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 +codecell.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB +codecell.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB +codecell.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +codecell.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs +codecell.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr +codecell.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 +codecell.menu.PartitionScheme.zigbee_zczr_8MB=Zigbee ZCZR 8MB with spiffs +codecell.menu.PartitionScheme.zigbee_zczr_8MB.build.partitions=zigbee_zczr_8MB +codecell.menu.PartitionScheme.zigbee_zczr_8MB.upload.maximum_size=3407872 +codecell.menu.PartitionScheme.custom=Custom +codecell.menu.PartitionScheme.custom.build.partitions= +codecell.menu.PartitionScheme.custom.upload.maximum_size=16777216 + +codecell.menu.CPUFreq.160=160MHz (WiFi) +codecell.menu.CPUFreq.160.build.f_cpu=160000000L +codecell.menu.CPUFreq.80=80MHz (WiFi) +codecell.menu.CPUFreq.80.build.f_cpu=80000000L +codecell.menu.CPUFreq.40=40MHz +codecell.menu.CPUFreq.40.build.f_cpu=40000000L +codecell.menu.CPUFreq.20=20MHz +codecell.menu.CPUFreq.20.build.f_cpu=20000000L +codecell.menu.CPUFreq.10=10MHz +codecell.menu.CPUFreq.10.build.f_cpu=10000000L + codecell.menu.FlashMode.qio=QIO +codecell.menu.FlashMode.qio.build.flash_mode=dio +codecell.menu.FlashMode.qio.build.boot=qio +codecell.menu.FlashMode.dio=DIO +codecell.menu.FlashMode.dio.build.flash_mode=dio +codecell.menu.FlashMode.dio.build.boot=dio + codecell.menu.FlashFreq.80=80MHz +codecell.menu.FlashFreq.80.build.flash_freq=80m +codecell.menu.FlashFreq.40=40MHz +codecell.menu.FlashFreq.40.build.flash_freq=40m + codecell.menu.FlashSize.4M=4MB (32Mb) +codecell.menu.FlashSize.4M.build.flash_size=4MB + codecell.menu.UploadSpeed.921600=921600 +codecell.menu.UploadSpeed.921600.upload.speed=921600 +codecell.menu.UploadSpeed.115200=115200 +codecell.menu.UploadSpeed.115200.upload.speed=115200 +codecell.menu.UploadSpeed.256000.windows=256000 +codecell.menu.UploadSpeed.256000.upload.speed=256000 +codecell.menu.UploadSpeed.230400.windows.upload.speed=256000 +codecell.menu.UploadSpeed.230400=230400 +codecell.menu.UploadSpeed.230400.upload.speed=230400 +codecell.menu.UploadSpeed.460800.linux=460800 +codecell.menu.UploadSpeed.460800.macosx=460800 +codecell.menu.UploadSpeed.460800.upload.speed=460800 +codecell.menu.UploadSpeed.512000.windows=512000 +codecell.menu.UploadSpeed.512000.upload.speed=512000 codecell.menu.DebugLevel.none=None codecell.menu.DebugLevel.none.build.code_debug=0 @@ -43334,6 +43442,12 @@ codecell.menu.EraseFlash.none.upload.erase_cmd= codecell.menu.EraseFlash.all=Enabled codecell.menu.EraseFlash.all.upload.erase_cmd=-e +codecell.menu.ZigbeeMode.default=Disabled +codecell.menu.ZigbeeMode.default.build.zigbee_mode= +codecell.menu.ZigbeeMode.default.build.zigbee_libs= +codecell.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router) +codecell.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR +codecell.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote ############################################################## jczn_2432s028r.name=ESP32-2432S028R CYD From b461e01e2214f4fbae62ee5e601609e75d48feb5 Mon Sep 17 00:00:00 2001 From: UltimumControl <70729135+UltimumControl@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:45:31 -0400 Subject: [PATCH 46/56] New SPI invert hardware SS function in hall-spi and SPI library (#11297) * Add files via upload * Add files via upload * Update SPI.h * Update esp32-hal-spi.c renamed invert_out to ss_invert to be more intuitive * Update esp32-hal-spi.h Removed the out from the function name spiSSInvertout. * Update SPI.cpp Removed the out from the function name spiSSInvertout. * Update cores/esp32/esp32-hal-spi.c Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/esp32-hal-spi.c | 9 ++++++++- cores/esp32/esp32-hal-spi.h | 2 ++ libraries/SPI/src/SPI.cpp | 6 ++++++ libraries/SPI/src/SPI.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c index 80928309670..9ae10c66167 100644 --- a/cores/esp32/esp32-hal-spi.c +++ b/cores/esp32/esp32-hal-spi.c @@ -74,6 +74,7 @@ struct spi_struct_t { int8_t miso; int8_t mosi; int8_t ss; + bool ss_invert; }; #if CONFIG_IDF_TARGET_ESP32S2 @@ -365,7 +366,7 @@ bool spiAttachSS(spi_t *spi, uint8_t ss_num, int8_t ss) { return false; } pinMode(ss, OUTPUT); - pinMatrixOutAttach(ss, SPI_SS_IDX(spi->num, ss_num), false, false); + pinMatrixOutAttach(ss, SPI_SS_IDX(spi->num, ss_num), spi->ss_invert, false); spiEnableSSPins(spi, (1 << ss_num)); spi->ss = ss; if (!perimanSetPinBus(ss, ESP32_BUS_TYPE_SPI_MASTER_SS, (void *)(spi->num + 1), spi->num, -1)) { @@ -435,6 +436,12 @@ void spiSSDisable(spi_t *spi) { SPI_MUTEX_UNLOCK(); } +void spiSSInvert(spi_t *spi, bool invert) { + if (spi) { + spi->ss_invert = invert; + } +} + void spiSSSet(spi_t *spi) { if (!spi) { return; diff --git a/cores/esp32/esp32-hal-spi.h b/cores/esp32/esp32-hal-spi.h index b77abff7854..7d56f0820d3 100644 --- a/cores/esp32/esp32-hal-spi.h +++ b/cores/esp32/esp32-hal-spi.h @@ -97,6 +97,8 @@ void spiSSSet(spi_t *spi); void spiSSClear(spi_t *spi); void spiWaitReady(spi_t *spi); +//invert hardware SS +void spiSSInvert(spi_t *spi, bool invert); uint32_t spiGetClockDiv(spi_t *spi); uint8_t spiGetDataMode(spi_t *spi); diff --git a/libraries/SPI/src/SPI.cpp b/libraries/SPI/src/SPI.cpp index 35e52f43e4d..ae207a7ff3c 100644 --- a/libraries/SPI/src/SPI.cpp +++ b/libraries/SPI/src/SPI.cpp @@ -144,6 +144,12 @@ void SPIClass::setHwCs(bool use) { _use_hw_ss = use; } +void SPIClass::setSSInvert(bool invert) { + if (_spi) { + spiSSInvert(_spi, invert); + } +} + void SPIClass::setFrequency(uint32_t freq) { SPI_PARAM_LOCK(); //check if last freq changed diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index adb3d1bc11f..628c2190f50 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -65,6 +65,7 @@ class SPIClass { void end(); void setHwCs(bool use); + void setSSInvert(bool invert); //use before setHwCS for change to be used by setHwCs void setBitOrder(uint8_t bitOrder); void setDataMode(uint8_t dataMode); void setFrequency(uint32_t freq); From 16fcdeb0be467d3d2c4dabb53db8cb346933c1f1 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Tue, 29 Apr 2025 07:57:51 +0200 Subject: [PATCH 47/56] fix(arduino): restore proper pin remapping functionality (#11315) Commit 0773dd7619b1117bd59a068b69a76cdb22484f7c from PR #10841 broke pin remapping by moving its application too early in the definition process. This commit restores the original order of includes, ensuring that pin remapping is applied correctly. Signed-off-by: Luca Burelli Co-authored-by: Sugar Glider --- cores/esp32/Arduino.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index d21089cc3fe..9048249a873 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -41,7 +41,6 @@ #include "extra_attr.h" #include "pins_arduino.h" -#include "io_pin_remap.h" #include "esp32-hal.h" #define PI 3.1415926535897932384626433832795 @@ -251,4 +250,8 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0); void noTone(uint8_t _pin); #endif /* __cplusplus */ + +// must be applied last as it overrides some of the above +#include "io_pin_remap.h" + #endif /* _ESP32_CORE_ARDUINO_H_ */ From d63b876f9372cd8679971cc17300cc4e9a252c39 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 29 Apr 2025 02:58:10 -0300 Subject: [PATCH 48/56] feat(uart): simplifies UART example based on MODBUS standard (#11309) * feat(uart): simplifies UART example based on MODBUS standard * fix(uart): fixes a uart example typo * feat(uart): replaces UART0 by Serial0 in the code * ci(pre-commit): Apply automatic fixes * fix(uart): typo error message in commentary --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../onReceiveExample/onReceiveExample.ino | 131 ++++++++---------- 1 file changed, 57 insertions(+), 74 deletions(-) diff --git a/libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino b/libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino index fe66b07b875..17d800b3b39 100644 --- a/libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino +++ b/libraries/ESP32/examples/Serial/onReceiveExample/onReceiveExample.ino @@ -5,20 +5,20 @@ void HardwareSerial::onReceive(OnReceiveCb function, bool onlyOnTimeout = false) It is possible to register an UART callback function that will be called - every time that UART receives data and an associated interrupt is generated. + every time that UART receives data and an associated UART interrupt is generated. - In summary, HardwareSerial::onReceive() works like an RX Interrupt callback, that can be adjusted - using HardwareSerial::setRxFIFOFull() and HardwareSerial::setRxTimeout(). + In summary, HardwareSerial::onReceive() works like an RX Interrupt callback, that + can be adjusted using HardwareSerial::setRxFIFOFull() and HardwareSerial::setRxTimeout(). - OnReceive will be called, while receiving a stream of data, when every 120 bytes are received (default FIFO Full), - which may not help in case that the application needs to get all data at once before processing it. - Therefore, a way to make it work is by detecting the end of a stream transmission. This can be based on a protocol - or based on timeout with the UART line in idle (no data received - this is the case of this example). + In case that is not changed or it is set to , the callback function is + executed whenever any event happens first (FIFO Full or RX Timeout). + OnReceive will be called when every 120 bytes are received(default FIFO Full), + or when RX Timeout occurs after 1 UART symbol by default. - In some cases, it is necessary to wait for receiving all the data before processing it and parsing the - UART input. This example demonstrates a way to create a String with all data received from UART0 and - signaling it using a Mutex for another task to process it. This example uses a timeout of 500ms as a way to - know when the reception of data has finished. + This example demonstrates a way to create a String with all data received from UART0 only + after RX Timeout. This example uses an RX timeout of about 3.5 Symbols as a way to know + when the reception of data has finished. + In order to achieve it, the sketch sets to . The onReceive() callback is called whenever the RX ISR is triggered. It can occur because of two possible events: @@ -34,90 +34,73 @@ 2- UART RX Timeout: it happens, based on a timeout equivalent to a number of symbols at the current baud rate. If the UART line is idle for this timeout, it will raise an interrupt. - This time can be changed by HardwareSerial::setRxTimeout(uint8_t rxTimeout) + This time can be changed by HardwareSerial::setRxTimeout(uint8_t rxTimeout). + is bound to the clock source. + In order to use it properly, ESP32 and ESP32-S2 shall set the UART Clock Source to APB. When any of those two interrupts occur, IDF UART driver will copy FIFO data to its internal RingBuffer and then Arduino can read such data. At the same time, Arduino Layer will execute the callback function defined with HardwareSerial::onReceive(). - parameter (default false) can be used by the application to tell Arduino to - only execute the callback when the second event above happens (Rx Timeout). At this time all - received data will be available to be read by the Arduino application. But if the number of - received bytes is higher than the FIFO space, it will generate an error of FIFO overflow. - In order to avoid such problem, the application shall set an appropriate RX buffer size using + parameter can be used by the application to tell Arduino to only execute + the callback when Rx Timeout happens, by setting it to . + At this time all received data will be available to be read by the Arduino application. + The application shall set an appropriate RX buffer size using HardwareSerial::setRxBufferSize(size_t new_size) before executing begin() for the Serial port. -*/ -// this will make UART0 work in any case (using or not USB) -#if ARDUINO_USB_CDC_ON_BOOT -#define UART0 Serial0 -#else -#define UART0 Serial -#endif + MODBUS timeout of 3.5 symbol is based on these documents: + https://www.automation.com/en-us/articles/2012-1/introduction-to-modbus + https://minimalmodbus.readthedocs.io/en/stable/serialcommunication.html +*/ // global variable to keep the results from onReceive() String uart_buffer = ""; -// a pause of a half second in the UART transmission is considered the end of transmission. -const uint32_t communicationTimeout_ms = 500; - -// Create a mutex for the access to uart_buffer -// only one task can read/write it at a certain time -SemaphoreHandle_t uart_buffer_Mutex = NULL; - -// UART_RX_IRQ will be executed as soon as data is received by the UART -// This is a callback function executed from a high priority -// task created when onReceive() is used +// The Modbus RTU standard prescribes a silent period corresponding to 3.5 characters between each +// message, to be able to figure out where one message ends and the next one starts. +const uint32_t modbusRxTimeoutLimit = 4; +const uint32_t baudrate = 19200; + +// UART_RX_IRQ will be executed as soon as data is received by the UART and an RX Timeout occurs +// This is a callback function executed from a high priority monitor task +// All data will be buffered into RX Buffer, which may have its size set to whatever necessary void UART0_RX_CB() { - // take the mutex, waits forever until loop() finishes its processing - if (xSemaphoreTake(uart_buffer_Mutex, portMAX_DELAY)) { - uint32_t now = millis(); // tracks timeout - while ((millis() - now) < communicationTimeout_ms) { - if (UART0.available()) { - uart_buffer += (char)UART0.read(); - now = millis(); // reset the timer - } - } - // releases the mutex for data processing - xSemaphoreGive(uart_buffer_Mutex); + while (Serial0.available()) { + uart_buffer += (char)Serial0.read(); } } // setup() and loop() are functions executed by a low priority task // Therefore, there are 2 tasks running when using onReceive() void setup() { - UART0.begin(115200); - - // creates a mutex object to control access to uart_buffer - uart_buffer_Mutex = xSemaphoreCreateMutex(); - if (uart_buffer_Mutex == NULL) { - log_e("Error creating Mutex. Sketch will fail."); - while (true) { - UART0.println("Mutex error (NULL). Program halted."); - delay(2000); - } - } - - UART0.onReceive(UART0_RX_CB); // sets the callback function - UART0.println("Send data to UART0 in order to activate the RX callback"); + // Using Serial0 will work in any case (using or not USB CDC on Boot) +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 + // UART_CLK_SRC_APB will allow higher values of RX Timeout + // default for ESP32 and ESP32-S2 is REF_TICK which limits the RX Timeout to 1 + // setClockSource() must be called before begin() + Serial0.setClockSource(UART_CLK_SRC_APB); +#endif + // the amount of data received or waiting to be proessed shall not exceed this limit of 1024 bytes + Serial0.setRxBufferSize(1024); // default is 256 bytes + Serial0.begin(baudrate); // default pins and default mode 8N1 (8 bits data, no parity bit, 1 stopbit) + // set RX Timeout based on UART symbols ~ 3.5 symbols of 11 bits (MODBUS standard) ~= 2 ms at 19200 + Serial0.setRxTimeout(modbusRxTimeoutLimit); // 4 symbols at 19200 8N1 is about 2.08 ms (40 bits) + // sets the callback function that will be executed only after RX Timeout + Serial0.onReceive(UART0_RX_CB, true); + Serial0.println("Send data using Serial Monitor in order to activate the RX callback"); } uint32_t counter = 0; void loop() { + // String is filled by the UART Callback whenever data is received and RX Timeout occurs if (uart_buffer.length() > 0) { - // signals that the onReceive function shall not change uart_buffer while processing - if (xSemaphoreTake(uart_buffer_Mutex, portMAX_DELAY)) { - // process the received data from UART0 - example, just print it beside a counter - UART0.print("["); - UART0.print(counter++); - UART0.print("] ["); - UART0.print(uart_buffer.length()); - UART0.print(" bytes] "); - UART0.println(uart_buffer); - uart_buffer = ""; // reset uart_buffer for the next UART reading - // releases the mutex for more data to be received - xSemaphoreGive(uart_buffer_Mutex); - } + // process the received data from Serial - example, just print it beside a counter + Serial0.print("["); + Serial0.print(counter++); + Serial0.print("] ["); + Serial0.print(uart_buffer.length()); + Serial0.print(" bytes] "); + Serial0.println(uart_buffer); + uart_buffer = ""; // reset uart_buffer for the next UART reading } - UART0.println("Sleeping for 1 second..."); - delay(1000); + delay(1); } From de72a03ca51cad7089ba67574f8d0fbece7ea43d Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 29 Apr 2025 04:46:44 -0300 Subject: [PATCH 49/56] docs(mirror): Add Chinese mirror links (#11317) --- docs/en/installing.rst | 15 +++++++++++++++ docs/en/troubleshooting.rst | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/en/installing.rst b/docs/en/installing.rst index d5392d4b5ec..35342020864 100644 --- a/docs/en/installing.rst +++ b/docs/en/installing.rst @@ -10,6 +10,11 @@ Before Installing We recommend you install the support using your favorite IDE, but other options are available depending on your operating system. To install Arduino-ESP32 support, you can use one of the following options. +.. note:: + Users in China might have troubles with connection and download speeds using GitHub. Please use our Jihulab mirror as the repository source: + + ``https://jihulab.com/esp-mirror/espressif/arduino-esp32.git`` + Installing using Arduino IDE ---------------------------- @@ -32,6 +37,16 @@ This is the way to install Arduino-ESP32 directly from the Arduino IDE. https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json +Users in China might have troubles with connection and download speeds using the links above. Please use our Jihulab mirror: + +- Stable release link:: + + https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_index_cn.json + +- Development release link:: + + https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_dev_index_cn.json + .. note:: Starting with the Arduino IDE version 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, macOS, and Linux. diff --git a/docs/en/troubleshooting.rst b/docs/en/troubleshooting.rst index f6a241729f5..ea9a6db94d6 100644 --- a/docs/en/troubleshooting.rst +++ b/docs/en/troubleshooting.rst @@ -14,6 +14,23 @@ Installing Here are the common issues during the installation. +Slow or unstable downloads +************************** + +Users in China might have troubles with connection and download speeds using GitHub. Please use our Jihulab mirror as the repository source: + +`https://jihulab.com/esp-mirror/espressif/arduino-esp32.git `_ + +JSON files for the boards manager are available here: + +- Stable release:: + + https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_index_cn.json + +- Development release:: + + https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_dev_index_cn.json + Building -------- From 543fad2bdf24ccafe0be86d7fc7740613fc78035 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Tue, 29 Apr 2025 04:49:23 -0300 Subject: [PATCH 50/56] fix(spi): Add missing initializer for ss_invert (#11320) * fix(spi): Add missing initializer for ss_invert * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- cores/esp32/esp32-hal-spi.c | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c index 9ae10c66167..6b8e3f8c013 100644 --- a/cores/esp32/esp32-hal-spi.c +++ b/cores/esp32/esp32-hal-spi.c @@ -152,23 +152,23 @@ struct spi_struct_t { // clang-format off static spi_t _spi_bus_array[] = { #if CONFIG_IDF_TARGET_ESP32S2 - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C2 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C3 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - {(spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1} + {(spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1, false} #else - {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 1, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 2, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), 0, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 1, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 2, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1, false} #endif }; // clang-format on @@ -180,22 +180,22 @@ static spi_t _spi_bus_array[] = { static spi_t _spi_bus_array[] = { #if CONFIG_IDF_TARGET_ESP32S2 - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 0, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 1, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 2, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 0, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 1, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 2, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1}, {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 1, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1, false}, {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 1, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C2 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C3 - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1, false} #elif CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - {(spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1} + {(spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 0, -1, -1, -1, -1, false} #else - {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 1, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 2, -1, -1, -1, -1}, - {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 3, -1, -1, -1, -1} + {(volatile spi_dev_t *)(DR_REG_SPI0_BASE), NULL, 0, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI1_BASE), NULL, 1, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI2_BASE), NULL, 2, -1, -1, -1, -1, false}, + {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), NULL, 3, -1, -1, -1, -1, false} #endif }; #endif From 158c7aec42a472604c108ce56a8a2b6361cb1cef Mon Sep 17 00:00:00 2001 From: "Limor \"Ladyada\" Fried" Date: Wed, 7 May 2025 04:03:54 -0400 Subject: [PATCH 51/56] Add new board: Sparkle Motion Stick (#11330) * add new version of sparklemotion * updated change as requested * fix * fix clang complaints --- boards.txt | 134 ++++++++++++++++++ .../pins_arduino.h | 40 ++++++ 2 files changed, 174 insertions(+) create mode 100644 variants/adafruit_sparklemotionstick_esp32/pins_arduino.h diff --git a/boards.txt b/boards.txt index 7113bf4c248..9158327f5f2 100644 --- a/boards.txt +++ b/boards.txt @@ -17353,6 +17353,140 @@ sparklemotionmini.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router) sparklemotionmini.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR sparklemotionmini.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote +############################################################## +# Adafruit Sparkle Motion Stick w/ESP32 + +sparklemotionstick.name=Adafruit Sparkle Motion Stick (ESP32) + +sparklemotionstick.bootloader.tool=esptool_py +sparklemotionstick.bootloader.tool.default=esptool_py + +sparklemotionstick.upload.tool=esptool_py +sparklemotionstick.upload.tool.default=esptool_py +sparklemotionstick.upload.tool.network=esp_ota + +sparklemotionstick.upload.maximum_size=1310720 +sparklemotionstick.upload.maximum_data_size=327680 +sparklemotionstick.upload.flags= +sparklemotionstick.upload.extra_flags= + +sparklemotionstick.serial.disableDTR=true +sparklemotionstick.serial.disableRTS=true + +sparklemotionstick.build.tarch=xtensa +sparklemotionstick.build.bootloader_addr=0x1000 +sparklemotionstick.build.target=esp32 +sparklemotionstick.build.mcu=esp32 +sparklemotionstick.build.core=esp32 +sparklemotionstick.build.variant=adafruit_sparklemotionstick_esp32 +sparklemotionstick.build.board=SPARKLEMOTIONSTICK_ESP32 + +sparklemotionstick.build.f_cpu=240000000L +sparklemotionstick.build.flash_size=4MB +sparklemotionstick.build.flash_freq=80m +sparklemotionstick.build.flash_mode=dio +sparklemotionstick.build.boot=dio +sparklemotionstick.build.partitions=default +sparklemotionstick.build.defines= +sparklemotionstick.build.loop_core= +sparklemotionstick.build.event_core= + +sparklemotionstick.menu.LoopCore.1=Core 1 +sparklemotionstick.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +sparklemotionstick.menu.LoopCore.0=Core 0 +sparklemotionstick.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +sparklemotionstick.menu.EventsCore.1=Core 1 +sparklemotionstick.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +sparklemotionstick.menu.EventsCore.0=Core 0 +sparklemotionstick.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +sparklemotionstick.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +sparklemotionstick.menu.PartitionScheme.default.build.partitions=default +sparklemotionstick.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +sparklemotionstick.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +sparklemotionstick.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +sparklemotionstick.menu.PartitionScheme.minimal.build.partitions=minimal +sparklemotionstick.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +sparklemotionstick.menu.PartitionScheme.no_ota.build.partitions=no_ota +sparklemotionstick.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +sparklemotionstick.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +sparklemotionstick.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +sparklemotionstick.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +sparklemotionstick.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +sparklemotionstick.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +sparklemotionstick.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +sparklemotionstick.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +sparklemotionstick.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +sparklemotionstick.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +sparklemotionstick.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +sparklemotionstick.menu.PartitionScheme.huge_app.build.partitions=huge_app +sparklemotionstick.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +sparklemotionstick.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +sparklemotionstick.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +sparklemotionstick.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 + +sparklemotionstick.menu.CPUFreq.240=240MHz (WiFi/BT) +sparklemotionstick.menu.CPUFreq.240.build.f_cpu=240000000L +sparklemotionstick.menu.CPUFreq.160=160MHz (WiFi/BT) +sparklemotionstick.menu.CPUFreq.160.build.f_cpu=160000000L +sparklemotionstick.menu.CPUFreq.80=80MHz (WiFi/BT) +sparklemotionstick.menu.CPUFreq.80.build.f_cpu=80000000L +sparklemotionstick.menu.CPUFreq.40=40MHz +sparklemotionstick.menu.CPUFreq.40.build.f_cpu=40000000L +sparklemotionstick.menu.CPUFreq.20=20MHz +sparklemotionstick.menu.CPUFreq.20.build.f_cpu=20000000L +sparklemotionstick.menu.CPUFreq.10=10MHz +sparklemotionstick.menu.CPUFreq.10.build.f_cpu=10000000L + +sparklemotionstick.menu.FlashFreq.80=80MHz +sparklemotionstick.menu.FlashFreq.80.build.flash_freq=80m +sparklemotionstick.menu.FlashFreq.40=40MHz +sparklemotionstick.menu.FlashFreq.40.build.flash_freq=40m + +sparklemotionstick.menu.FlashSize.4M=4MB (32Mb) +sparklemotionstick.menu.FlashSize.4M.build.flash_size=4MB + +sparklemotionstick.menu.UploadSpeed.921600=921600 +sparklemotionstick.menu.UploadSpeed.921600.upload.speed=921600 +sparklemotionstick.menu.UploadSpeed.115200=115200 +sparklemotionstick.menu.UploadSpeed.115200.upload.speed=115200 +sparklemotionstick.menu.UploadSpeed.256000.windows=256000 +sparklemotionstick.menu.UploadSpeed.256000.upload.speed=256000 +sparklemotionstick.menu.UploadSpeed.230400.windows.upload.speed=256000 +sparklemotionstick.menu.UploadSpeed.230400=230400 +sparklemotionstick.menu.UploadSpeed.230400.upload.speed=230400 +sparklemotionstick.menu.UploadSpeed.460800.linux=460800 +sparklemotionstick.menu.UploadSpeed.460800.macosx=460800 +sparklemotionstick.menu.UploadSpeed.460800.upload.speed=460800 +sparklemotionstick.menu.UploadSpeed.512000.windows=512000 +sparklemotionstick.menu.UploadSpeed.512000.upload.speed=512000 + +sparklemotionstick.menu.DebugLevel.none=None +sparklemotionstick.menu.DebugLevel.none.build.code_debug=0 +sparklemotionstick.menu.DebugLevel.error=Error +sparklemotionstick.menu.DebugLevel.error.build.code_debug=1 +sparklemotionstick.menu.DebugLevel.warn=Warn +sparklemotionstick.menu.DebugLevel.warn.build.code_debug=2 +sparklemotionstick.menu.DebugLevel.info=Info +sparklemotionstick.menu.DebugLevel.info.build.code_debug=3 +sparklemotionstick.menu.DebugLevel.debug=Debug +sparklemotionstick.menu.DebugLevel.debug.build.code_debug=4 +sparklemotionstick.menu.DebugLevel.verbose=Verbose +sparklemotionstick.menu.DebugLevel.verbose.build.code_debug=5 + +sparklemotionstick.menu.EraseFlash.none=Disabled +sparklemotionstick.menu.EraseFlash.none.upload.erase_cmd= +sparklemotionstick.menu.EraseFlash.all=Enabled +sparklemotionstick.menu.EraseFlash.all.upload.erase_cmd=-e + +sparklemotionstick.menu.ZigbeeMode.default=Disabled +sparklemotionstick.menu.ZigbeeMode.default.build.zigbee_mode= +sparklemotionstick.menu.ZigbeeMode.default.build.zigbee_libs= +sparklemotionstick.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router) +sparklemotionstick.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR +sparklemotionstick.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote + ############################################################## nodemcu-32s.name=NodeMCU-32S diff --git a/variants/adafruit_sparklemotionstick_esp32/pins_arduino.h b/variants/adafruit_sparklemotionstick_esp32/pins_arduino.h new file mode 100644 index 00000000000..e0d94821736 --- /dev/null +++ b/variants/adafruit_sparklemotionstick_esp32/pins_arduino.h @@ -0,0 +1,40 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +// User LED +static const uint8_t LED_BUILTIN = 4; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN + +// Neopixel +static const uint8_t PIN_NEOPIXEL = 18; +// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking +#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT) +#define RGB_BRIGHTNESS 64 + +static const uint8_t TX = 25; // not broken out, defined to fix compilation +static const uint8_t RX = 26; // not broken out, defined to fix compilation + +#define TX1 TX +#define RX1 RX + +static const uint8_t SDA = 13; // not broken out, defined to fix compilation +static const uint8_t SCL = 15; // not broken out, defined to fix compilation + +static const uint8_t SS = 19; // not broken out, defined to fix compilation +static const uint8_t MOSI = 21; // output to drive dotstars +static const uint8_t SCK = 22; // output to drive dotstars +static const uint8_t MISO = 23; // not broken out, defined to fix compilation + +static const uint8_t A0 = 2; // not broken out, defined to fix compilation + +// internal switch +static const uint8_t BUTTON = 0; + +static const uint8_t DAC1 = 25; // not broken out, defined to fix compilation +static const uint8_t DAC2 = 26; // not broken out, defined to fix compilation + +#endif /* Pins_Arduino_h */ From 15e71a6afd21f9723a0777fa2f38d4c647279933 Mon Sep 17 00:00:00 2001 From: Stian Coward <81033623+h-2-0@users.noreply.github.com> Date: Wed, 7 May 2025 10:50:32 +0200 Subject: [PATCH 52/56] fix(esp32): Add missing vflip status in esp32-cam example (#11335) Toggle switch for V-Flip will now indicate correct status in frontend when loading the webpage --- libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp b/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp index 81d643e37ac..cc924bd5b3b 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp +++ b/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp @@ -478,6 +478,7 @@ static esp_err_t status_handler(httpd_req_t *req) { p += sprintf(p, "\"raw_gma\":%u,", s->status.raw_gma); p += sprintf(p, "\"lenc\":%u,", s->status.lenc); p += sprintf(p, "\"hmirror\":%u,", s->status.hmirror); + p += sprintf(p, "\"vflip\":%u,", s->status.vflip); p += sprintf(p, "\"dcw\":%u,", s->status.dcw); p += sprintf(p, "\"colorbar\":%u", s->status.colorbar); #if CONFIG_LED_ILLUMINATOR_ENABLED From 210edfeaa6cfa64d1a7bd51abd5c6e1ac30692a8 Mon Sep 17 00:00:00 2001 From: Unexpected Maker Date: Tue, 13 May 2025 19:46:15 +1000 Subject: [PATCH 53/56] Added new Unexpected Maker SQUiXL and EDGES3[D] boards. (#11350) * Added new Unexpected Maker SQUiXL and EDGES3[D] boards. Signed-off-by: Seon Rozenblum * Seems we are being picky about board names now ;) Signed-off-by: Seon Rozenblum * Seems I have to have SPI pins defined for SQUiXL, or compiling breaks Signed-off-by: Seon Rozenblum --------- Signed-off-by: Seon Rozenblum Signed-off-by: Seon Rozenblum --- boards.txt | 306 ++++++++++++++++++++++++++++ variants/um_edges3_d/pins_arduino.h | 46 +++++ variants/um_squixl/pins_arduino.h | 23 +++ 3 files changed, 375 insertions(+) create mode 100644 variants/um_edges3_d/pins_arduino.h create mode 100644 variants/um_squixl/pins_arduino.h diff --git a/boards.txt b/boards.txt index 9158327f5f2..1f48e0308ef 100644 --- a/boards.txt +++ b/boards.txt @@ -3643,6 +3643,155 @@ um_bling.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +um_edges3_d.name=UM EdgeS3[D] +um_edges3_d.vid.0=0x303a +um_edges3_d.pid.0=0x82DC +um_edges3_d.upload_port.0.vid=0x303a +um_edges3_d.upload_port.0.pid=0x82DC + +um_edges3_d.bootloader.tool=esptool_py +um_edges3_d.bootloader.tool.default=esptool_py + +um_edges3_d.upload.tool=esptool_py +um_edges3_d.upload.tool.default=esptool_py +um_edges3_d.upload.tool.network=esp_ota + +um_edges3_d.upload.maximum_size=1310720 +um_edges3_d.upload.maximum_data_size=327680 +um_edges3_d.upload.flags= +um_edges3_d.upload.extra_flags= +um_edges3_d.upload.use_1200bps_touch=false +um_edges3_d.upload.wait_for_upload_port=false + +um_edges3_d.serial.disableDTR=false +um_edges3_d.serial.disableRTS=false + +um_edges3_d.build.tarch=xtensa +um_edges3_d.build.bootloader_addr=0x0 +um_edges3_d.build.target=esp32s3 +um_edges3_d.build.mcu=esp32s3 +um_edges3_d.build.core=esp32 +um_edges3_d.build.variant=um_edges3_d +um_edges3_d.build.board=EDGES3D + +um_edges3_d.build.usb_mode=1 +um_edges3_d.build.cdc_on_boot=1 +um_edges3_d.build.msc_on_boot=0 +um_edges3_d.build.dfu_on_boot=0 +um_edges3_d.build.f_cpu=240000000L +um_edges3_d.build.flash_size=8MB +um_edges3_d.build.flash_freq=80m +um_edges3_d.build.flash_mode=dio +um_edges3_d.build.boot=qio +um_edges3_d.build.partitions=default +um_edges3_d.build.defines= +um_edges3_d.build.loop_core= +um_edges3_d.build.event_core= +um_edges3_d.build.flash_type=qio +um_edges3_d.build.psram_type=qspi +um_edges3_d.build.memory_type=qio_qspi + +um_edges3_d.menu.LoopCore.1=Core 1 +um_edges3_d.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +um_edges3_d.menu.LoopCore.0=Core 0 +um_edges3_d.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +um_edges3_d.menu.EventsCore.1=Core 1 +um_edges3_d.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +um_edges3_d.menu.EventsCore.0=Core 0 +um_edges3_d.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +um_edges3_d.menu.USBMode.hwcdc=Hardware CDC and JTAG +um_edges3_d.menu.USBMode.hwcdc.build.usb_mode=1 +um_edges3_d.menu.USBMode.default=USB-OTG (TinyUSB) +um_edges3_d.menu.USBMode.default.build.usb_mode=0 + +um_edges3_d.menu.CDCOnBoot.cdc=Enabled +um_edges3_d.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +um_edges3_d.menu.CDCOnBoot.default=Disabled +um_edges3_d.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +um_edges3_d.menu.MSCOnBoot.default=Disabled +um_edges3_d.menu.MSCOnBoot.default.build.msc_on_boot=0 +um_edges3_d.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +um_edges3_d.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +um_edges3_d.menu.DFUOnBoot.default=Disabled +um_edges3_d.menu.DFUOnBoot.default.build.dfu_on_boot=0 +um_edges3_d.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +um_edges3_d.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +um_edges3_d.menu.UploadMode.cdc.upload.wait_for_upload_port=true +um_edges3_d.menu.UploadMode.default=UART0 / Hardware CDC +um_edges3_d.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +um_edges3_d.menu.UploadMode.cdc.upload.use_1200bps_touch=true +um_edges3_d.menu.UploadMode.default.upload.use_1200bps_touch=false +um_edges3_d.menu.UploadMode.default.upload.wait_for_upload_port=false + +um_edges3_d.menu.PSRAM.enabled=Enabled +um_edges3_d.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +um_edges3_d.menu.PSRAM.disabled=Disabled +um_edges3_d.menu.PSRAM.disabled.build.defines= + +um_edges3_d.menu.PartitionScheme.default_8MB=Default (3MB APP/1.5MB SPIFFS) +um_edges3_d.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +um_edges3_d.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 + +um_edges3_d.menu.CPUFreq.240=240MHz (WiFi) +um_edges3_d.menu.CPUFreq.240.build.f_cpu=240000000L +um_edges3_d.menu.CPUFreq.160=160MHz (WiFi) +um_edges3_d.menu.CPUFreq.160.build.f_cpu=160000000L +um_edges3_d.menu.CPUFreq.80=80MHz (WiFi) +um_edges3_d.menu.CPUFreq.80.build.f_cpu=80000000L +um_edges3_d.menu.CPUFreq.40=40MHz +um_edges3_d.menu.CPUFreq.40.build.f_cpu=40000000L +um_edges3_d.menu.CPUFreq.20=20MHz +um_edges3_d.menu.CPUFreq.20.build.f_cpu=20000000L +um_edges3_d.menu.CPUFreq.10=10MHz +um_edges3_d.menu.CPUFreq.10.build.f_cpu=10000000L + +um_edges3_d.menu.FlashMode.qio=QIO +um_edges3_d.menu.FlashMode.qio.build.flash_mode=dio +um_edges3_d.menu.FlashMode.qio.build.boot=qio +um_edges3_d.menu.FlashMode.dio=DIO +um_edges3_d.menu.FlashMode.dio.build.flash_mode=dio +um_edges3_d.menu.FlashMode.dio.build.boot=dio + +um_edges3_d.menu.UploadSpeed.921600=921600 +um_edges3_d.menu.UploadSpeed.921600.upload.speed=921600 +um_edges3_d.menu.UploadSpeed.115200=115200 +um_edges3_d.menu.UploadSpeed.115200.upload.speed=115200 +um_edges3_d.menu.UploadSpeed.256000.windows=256000 +um_edges3_d.menu.UploadSpeed.256000.upload.speed=256000 +um_edges3_d.menu.UploadSpeed.230400.windows.upload.speed=256000 +um_edges3_d.menu.UploadSpeed.230400=230400 +um_edges3_d.menu.UploadSpeed.230400.upload.speed=230400 +um_edges3_d.menu.UploadSpeed.460800.linux=460800 +um_edges3_d.menu.UploadSpeed.460800.macosx=460800 +um_edges3_d.menu.UploadSpeed.460800.upload.speed=460800 +um_edges3_d.menu.UploadSpeed.512000.windows=512000 +um_edges3_d.menu.UploadSpeed.512000.upload.speed=512000 + +um_edges3_d.menu.DebugLevel.none=None +um_edges3_d.menu.DebugLevel.none.build.code_debug=0 +um_edges3_d.menu.DebugLevel.error=Error +um_edges3_d.menu.DebugLevel.error.build.code_debug=1 +um_edges3_d.menu.DebugLevel.warn=Warn +um_edges3_d.menu.DebugLevel.warn.build.code_debug=2 +um_edges3_d.menu.DebugLevel.info=Info +um_edges3_d.menu.DebugLevel.info.build.code_debug=3 +um_edges3_d.menu.DebugLevel.debug=Debug +um_edges3_d.menu.DebugLevel.debug.build.code_debug=4 +um_edges3_d.menu.DebugLevel.verbose=Verbose +um_edges3_d.menu.DebugLevel.verbose.build.code_debug=5 + +um_edges3_d.menu.EraseFlash.none=Disabled +um_edges3_d.menu.EraseFlash.none.upload.erase_cmd= +um_edges3_d.menu.EraseFlash.all=Enabled +um_edges3_d.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + um_feathers2.name=UM FeatherS2 um_feathers2.vid.0=0x239A um_feathers2.pid.0=0x80AB @@ -4735,6 +4884,163 @@ um_pros3.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +um_squixl.name=UM SQUIXL +um_squixl.vid.0=0x303a +um_squixl.pid.0=0x82DF +um_squixl.upload_port.0.vid=0x303a +um_squixl.upload_port.0.pid=0x82DF + +um_squixl.bootloader.tool=esptool_py +um_squixl.bootloader.tool.default=esptool_py + +um_squixl.upload.tool=esptool_py +um_squixl.upload.tool.default=esptool_py +um_squixl.upload.tool.network=esp_ota + +um_squixl.upload.maximum_size=1310720 +um_squixl.upload.maximum_data_size=327680 +um_squixl.upload.flags= +um_squixl.upload.extra_flags= +um_squixl.upload.use_1200bps_touch=false +um_squixl.upload.wait_for_upload_port=false + +um_squixl.serial.disableDTR=false +um_squixl.serial.disableRTS=false + +um_squixl.build.tarch=xtensa +um_squixl.build.bootloader_addr=0x0 +um_squixl.build.target=esp32s3 +um_squixl.build.mcu=esp32s3 +um_squixl.build.core=esp32 +um_squixl.build.variant=um_squixl +um_squixl.build.board=SQUIXL + +um_squixl.build.usb_mode=1 +um_squixl.build.cdc_on_boot=1 +um_squixl.build.msc_on_boot=0 +um_squixl.build.dfu_on_boot=0 +um_squixl.build.f_cpu=240000000L +um_squixl.build.flash_size=16MB +um_squixl.build.flash_freq=80m +um_squixl.build.flash_mode=dio +um_squixl.build.boot=qio +um_squixl.build.partitions=default +um_squixl.build.defines= +um_squixl.build.loop_core= +um_squixl.build.event_core= +um_squixl.build.flash_type=qio +um_squixl.build.psram_type=opi +um_squixl.build.memory_type=qio_opi + +um_squixl.menu.LoopCore.1=Core 1 +um_squixl.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +um_squixl.menu.LoopCore.0=Core 0 +um_squixl.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +um_squixl.menu.EventsCore.1=Core 1 +um_squixl.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +um_squixl.menu.EventsCore.0=Core 0 +um_squixl.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +um_squixl.menu.USBMode.hwcdc=Hardware CDC and JTAG +um_squixl.menu.USBMode.hwcdc.build.usb_mode=1 +um_squixl.menu.USBMode.default=USB-OTG (TinyUSB) +um_squixl.menu.USBMode.default.build.usb_mode=0 + +um_squixl.menu.CDCOnBoot.cdc=Enabled +um_squixl.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +um_squixl.menu.CDCOnBoot.default=Disabled +um_squixl.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +um_squixl.menu.MSCOnBoot.default=Disabled +um_squixl.menu.MSCOnBoot.default.build.msc_on_boot=0 +um_squixl.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +um_squixl.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +um_squixl.menu.DFUOnBoot.default=Disabled +um_squixl.menu.DFUOnBoot.default.build.dfu_on_boot=0 +um_squixl.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +um_squixl.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +um_squixl.menu.UploadMode.cdc.upload.wait_for_upload_port=true +um_squixl.menu.UploadMode.default=UART0 / Hardware CDC +um_squixl.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +um_squixl.menu.UploadMode.cdc.upload.use_1200bps_touch=true +um_squixl.menu.UploadMode.default.upload.use_1200bps_touch=false +um_squixl.menu.UploadMode.default.upload.wait_for_upload_port=false + +um_squixl.menu.PSRAM.opi=OPI PSRAM +um_squixl.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +um_squixl.menu.PSRAM.opi.build.psram_type=opi + +um_squixl.menu.PartitionScheme.default_16MB=Default (6.25MB APP/3.43MB SPIFFS) +um_squixl.menu.PartitionScheme.default_16MB.build.partitions=default_16MB +um_squixl.menu.PartitionScheme.default_16MB.upload.maximum_size=6553600 +um_squixl.menu.PartitionScheme.large_spiffs=Large SPIFFS (4.5MB APP/6.93MB SPIFFS) +um_squixl.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB +um_squixl.menu.PartitionScheme.large_spiffs.upload.maximum_size=4718592 +um_squixl.menu.PartitionScheme.app3M_fat9M_16MB=FFAT (3MB APP/9MB FATFS) +um_squixl.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +um_squixl.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +um_squixl.menu.PartitionScheme.fatflash=Large FFAT (2MB APP/12.5MB FATFS) +um_squixl.menu.PartitionScheme.fatflash.build.partitions=ffat +um_squixl.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 + +um_squixl.menu.CPUFreq.240=240MHz (WiFi) +um_squixl.menu.CPUFreq.240.build.f_cpu=240000000L +um_squixl.menu.CPUFreq.160=160MHz (WiFi) +um_squixl.menu.CPUFreq.160.build.f_cpu=160000000L +um_squixl.menu.CPUFreq.80=80MHz (WiFi) +um_squixl.menu.CPUFreq.80.build.f_cpu=80000000L +um_squixl.menu.CPUFreq.40=40MHz +um_squixl.menu.CPUFreq.40.build.f_cpu=40000000L +um_squixl.menu.CPUFreq.20=20MHz +um_squixl.menu.CPUFreq.20.build.f_cpu=20000000L +um_squixl.menu.CPUFreq.10=10MHz +um_squixl.menu.CPUFreq.10.build.f_cpu=10000000L + +um_squixl.menu.FlashMode.qio=QIO +um_squixl.menu.FlashMode.qio.build.flash_mode=dio +um_squixl.menu.FlashMode.qio.build.boot=qio +um_squixl.menu.FlashMode.dio=DIO +um_squixl.menu.FlashMode.dio.build.flash_mode=dio +um_squixl.menu.FlashMode.dio.build.boot=dio + +um_squixl.menu.UploadSpeed.921600=921600 +um_squixl.menu.UploadSpeed.921600.upload.speed=921600 +um_squixl.menu.UploadSpeed.115200=115200 +um_squixl.menu.UploadSpeed.115200.upload.speed=115200 +um_squixl.menu.UploadSpeed.256000.windows=256000 +um_squixl.menu.UploadSpeed.256000.upload.speed=256000 +um_squixl.menu.UploadSpeed.230400.windows.upload.speed=256000 +um_squixl.menu.UploadSpeed.230400=230400 +um_squixl.menu.UploadSpeed.230400.upload.speed=230400 +um_squixl.menu.UploadSpeed.460800.linux=460800 +um_squixl.menu.UploadSpeed.460800.macosx=460800 +um_squixl.menu.UploadSpeed.460800.upload.speed=460800 +um_squixl.menu.UploadSpeed.512000.windows=512000 +um_squixl.menu.UploadSpeed.512000.upload.speed=512000 + +um_squixl.menu.DebugLevel.none=None +um_squixl.menu.DebugLevel.none.build.code_debug=0 +um_squixl.menu.DebugLevel.error=Error +um_squixl.menu.DebugLevel.error.build.code_debug=1 +um_squixl.menu.DebugLevel.warn=Warn +um_squixl.menu.DebugLevel.warn.build.code_debug=2 +um_squixl.menu.DebugLevel.info=Info +um_squixl.menu.DebugLevel.info.build.code_debug=3 +um_squixl.menu.DebugLevel.debug=Debug +um_squixl.menu.DebugLevel.debug.build.code_debug=4 +um_squixl.menu.DebugLevel.verbose=Verbose +um_squixl.menu.DebugLevel.verbose.build.code_debug=5 + +um_squixl.menu.EraseFlash.none=Disabled +um_squixl.menu.EraseFlash.none.upload.erase_cmd= +um_squixl.menu.EraseFlash.all=Enabled +um_squixl.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + um_tinypico.name=UM TinyPICO um_tinypico.bootloader.tool=esptool_py diff --git a/variants/um_edges3_d/pins_arduino.h b/variants/um_edges3_d/pins_arduino.h new file mode 100644 index 00000000000..f54ceb52ea7 --- /dev/null +++ b/variants/um_edges3_d/pins_arduino.h @@ -0,0 +1,46 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303A +#define USB_PID 0x82DC +#define USB_MANUFACTURER "Unexpected Maker" +#define USB_PRODUCT "EdgeS3[D]" +#define USB_SERIAL "" + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +static const uint8_t SDA = 8; +static const uint8_t SCL = 9; + +static const uint8_t SS = 34; +static const uint8_t MOSI = 35; +static const uint8_t MISO = 37; +static const uint8_t SDO = 35; +static const uint8_t SDI = 37; +static const uint8_t SCK = 36; + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; + +#endif /* Pins_Arduino_h */ diff --git a/variants/um_squixl/pins_arduino.h b/variants/um_squixl/pins_arduino.h new file mode 100644 index 00000000000..4546cdb124a --- /dev/null +++ b/variants/um_squixl/pins_arduino.h @@ -0,0 +1,23 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303A +#define USB_PID 0x82DF +#define USB_MANUFACTURER "Unexpected Maker" +#define USB_PRODUCT "SQUiXL" +#define USB_SERIAL "" + +static const uint8_t SDA = 1; +static const uint8_t SCL = 2; + +static const uint8_t SS = 42; +static const uint8_t MOSI = 46; +static const uint8_t MISO = 41; +static const uint8_t SDO = 46; +static const uint8_t SDI = 41; +static const uint8_t SCK = 45; + +#endif /* Pins_Arduino_h */ From 6f92b604f62568eced0e519b01d17af00b80ebe4 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Tue, 13 May 2025 11:46:58 +0200 Subject: [PATCH 54/56] IDF release/v5.4 (#11212) * fix(i2c): update i2c_ll_slave_init for IDF 5.4 * IDF release/v5.4 8ad0d3d8 --- cores/esp32/esp32-hal-i2c-slave.c | 4 +- package/package_esp32_index.template.json | 128 +++++++++++----------- 2 files changed, 67 insertions(+), 65 deletions(-) diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c index 46c3a4d58c2..9d39c1c783d 100644 --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -335,10 +335,12 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t } #endif // !defined(CONFIG_IDF_TARGET_ESP32P4) - i2c_ll_slave_init(i2c->dev); #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) + i2c_ll_set_mode(i2c->dev, I2C_BUS_MODE_SLAVE); + i2c_ll_enable_pins_open_drain(i2c->dev, true); i2c_ll_enable_fifo_mode(i2c->dev, true); #else + i2c_ll_slave_init(i2c->dev); i2c_ll_slave_set_fifo_mode(i2c->dev, true); #endif i2c_ll_set_slave_addr(i2c->dev, slaveID, false); diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index 19254d11682..8d95f2a59ae 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -51,7 +51,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-2f7dcd86-v1" + "version": "idf-release_v5.4-8ad0d3d8-v1" }, { "packager": "esp32", @@ -76,7 +76,7 @@ { "packager": "esp32", "name": "openocd-esp32", - "version": "v0.12.0-esp32-20241016" + "version": "v0.12.0-esp32-20250422" }, { "packager": "esp32", @@ -104,63 +104,63 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-2f7dcd86-v1", + "version": "idf-release_v5.4-8ad0d3d8-v1", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-2f7dcd86-v1.zip", - "checksum": "SHA-256:11f1271fe5e2857155d90384690069e4d33f0f97a4c04e7474b29a7cbc7ededd", - "size": "352347498" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", + "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", + "size": "353625670" } ] }, @@ -414,56 +414,56 @@ }, { "name": "openocd-esp32", - "version": "v0.12.0-esp32-20241016", + "version": "v0.12.0-esp32-20250422", "systems": [ { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", - "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20241016.tar.gz", - "checksum": "SHA-256:e82b0f036dc99244bead5f09a86e91bb2365cbcd1122ac68261e5647942485df", - "size": "2398717" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-amd64-0.12.0-esp32-20250422.tar.gz", + "archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20250422.tar.gz", + "checksum": "SHA-256:eb1fa9b21c65b45a2200af6dcc2914e32335d37b6dbbd181778dcc0dc025e70a", + "size": "2445546" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", - "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20241016.tar.gz", - "checksum": "SHA-256:8f8daf5bd22ec5d2fa9257b0862ec33da18ee677e023fb9a9eb17f74ce208c76", - "size": "2271584" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-arm64-0.12.0-esp32-20250422.tar.gz", + "archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20250422.tar.gz", + "checksum": "SHA-256:f70334a9b12a75b4d943e09fa5db30973037c39dbb54d6fa9f1a7118228b3d1c", + "size": "2330926" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", - "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20241016.tar.gz", - "checksum": "SHA-256:bc9c020ecf20e2000f76cffa44305fd5bc44d2e688ea78cce423399d33f19767", - "size": "2414206" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-armel-0.12.0-esp32-20250422.tar.gz", + "archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20250422.tar.gz", + "checksum": "SHA-256:4ac34d6fd1af86aeda87c8318732f8d691c300c285c7fd2f5037c432c63fbbb3", + "size": "2470732" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", - "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20241016.tar.gz", - "checksum": "SHA-256:02a2dffe801a2d005fa9e614d80ff8173395b2cb0b5d3118d0229d094a9946a7", - "size": "2508089" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-0.12.0-esp32-20250422.tar.gz", + "archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20250422.tar.gz", + "checksum": "SHA-256:9186a7a06304c6d9201cbce4ee3c7099b393bf8d329cda17a68874f92308f6ce", + "size": "2548730" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", - "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20241016.tar.gz", - "checksum": "SHA-256:c382f9e884d6565cb6089bff5f200f4810994667d885f062c3d3c5625a0fa9d6", - "size": "2552569" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-arm64-0.12.0-esp32-20250422.tar.gz", + "archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20250422.tar.gz", + "checksum": "SHA-256:2cc39318d52f393233ff1f777871aebe5b97b3fbad29556a238489263401b774", + "size": "2593819" }, { "host": "i686-mingw32", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win32-0.12.0-esp32-20241016.zip", - "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20241016.zip", - "checksum": "SHA-256:3b5d615e0a72cc771a45dd469031312d5881c01d7b6bc9edb29b8b6bda8c2e90", - "size": "2946244" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win32-0.12.0-esp32-20250422.zip", + "archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20250422.zip", + "checksum": "SHA-256:ecb4f8533fa9098d10000f5f7e8b8eaa8591015b824b481078ddb2b37e7aa6f2", + "size": "2988859" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20241016/openocd-esp32-win64-0.12.0-esp32-20241016.zip", - "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20241016.zip", - "checksum": "SHA-256:5e7b2fd1947d3a8625f6a11db7a2340cf2f41ff4c61284c022c7d7c32b18780a", - "size": "2946244" + "url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win64-0.12.0-esp32-20250422.zip", + "archiveFileName": "openocd-esp32-win64-0.12.0-esp32-20250422.zip", + "checksum": "SHA-256:e9eae8e1a8d0e030cd81dcb08394a9137cb7338a6211dfabcdbdfb37b58c5a23", + "size": "2988858" } ] }, From 8d5a026c986aa6edc09a003267ee65946a7f6046 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 15 May 2025 10:56:48 +0200 Subject: [PATCH 55/56] IDF release/v5.4 (#11357) * IDF release/v5.4 8ad0d3d8 * IDF release/v5.4 fd37cd46 * IDF release/v5.4 fe753553 --- package/package_esp32_index.template.json | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index 8d95f2a59ae..ba63dd3beb5 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -51,7 +51,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-8ad0d3d8-v1" + "version": "idf-release_v5.4-fe753553-v1" }, { "packager": "esp32", @@ -104,63 +104,63 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-release_v5.4-8ad0d3d8-v1", + "version": "idf-release_v5.4-fe753553-v1", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-8ad0d3d8-v1.zip", - "checksum": "SHA-256:19b58817f57c5bcf06640b2e789144f44c298ad8c5c26ff95fd52e63a3be9cfb", - "size": "353625670" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.4/esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.4-fe753553-v1.zip", + "checksum": "SHA-256:79abe0d17524dc64eccdab97bf4407127d8249e99c9b929357c10d24fe47a703", + "size": "353685379" } ] }, From 13cd0d3c3fb6d6f719c55cdb671d6807874427b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 15 May 2025 11:14:58 +0200 Subject: [PATCH 56/56] fix(rainmaker): Fix the 8MB partition scheme (#11363) --- boards.txt | 190 ++++++++++++++--------------- tools/partitions/rainmaker_8MB.csv | 4 +- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/boards.txt b/boards.txt index 1f48e0308ef..98e6b7eef1d 100644 --- a/boards.txt +++ b/boards.txt @@ -449,7 +449,7 @@ esp32h2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 #esp32h2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 #esp32h2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB #esp32h2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -#esp32h2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +#esp32h2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32h2.menu.PartitionScheme.zigbee_2MB=Zigbee 2MB with spiffs esp32h2.menu.PartitionScheme.zigbee_2MB.build.partitions=zigbee_2MB esp32h2.menu.PartitionScheme.zigbee_2MB.upload.maximum_size=1310720 @@ -647,7 +647,7 @@ esp32c6.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32c6.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32c6.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32c6.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32c6.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32c6.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32c6.menu.PartitionScheme.zigbee_2MB=Zigbee 2MB with spiffs esp32c6.menu.PartitionScheme.zigbee_2MB.build.partitions=zigbee_2MB esp32c6.menu.PartitionScheme.zigbee_2MB.upload.maximum_size=1310720 @@ -933,7 +933,7 @@ esp32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) esp32s3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB esp32s3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -1110,7 +1110,7 @@ esp32c3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32c3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32c3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32c3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32c3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32c3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32c3.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32c3.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32c3.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -1318,7 +1318,7 @@ esp32s2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32s2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s2.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32s2.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32s2.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -1501,7 +1501,7 @@ esp32.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -1681,7 +1681,7 @@ esp32da.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota esp32da.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32da.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32da.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32da.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32da.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32da.menu.PartitionScheme.custom=Custom esp32da.menu.PartitionScheme.custom.build.partitions= esp32da.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -2144,7 +2144,7 @@ esp32s3-octal.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ esp32s3-octal.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s3-octal.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s3-octal.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s3-octal.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s3-octal.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s3-octal.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) esp32s3-octal.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB esp32s3-octal.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -2731,7 +2731,7 @@ esp32wroverkit.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB esp32wroverkit.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32wroverkit.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32wroverkit.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32wroverkit.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32wroverkit.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32wroverkit.menu.CPUFreq.240=240MHz (WiFi/BT) esp32wroverkit.menu.CPUFreq.240.build.f_cpu=240000000L @@ -2966,7 +2966,7 @@ aventen_s3_sync.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M aventen_s3_sync.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 aventen_s3_sync.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB aventen_s3_sync.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -aventen_s3_sync.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +aventen_s3_sync.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 aventen_s3_sync.menu.CPUFreq.240=240MHz (WiFi) aventen_s3_sync.menu.CPUFreq.240.build.f_cpu=240000000L @@ -5202,7 +5202,7 @@ um_tinyc6.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_o um_tinyc6.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 um_tinyc6.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB um_tinyc6.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -um_tinyc6.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +um_tinyc6.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 um_tinyc6.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs um_tinyc6.menu.PartitionScheme.zigbee.build.partitions=zigbee um_tinyc6.menu.PartitionScheme.zigbee.upload.maximum_size=1310720 @@ -5896,7 +5896,7 @@ lilygo_t_display_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmake lilygo_t_display_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 lilygo_t_display_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB lilygo_t_display_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -lilygo_t_display_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +lilygo_t_display_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 lilygo_t_display_s3.menu.DebugLevel.none=None lilygo_t_display_s3.menu.DebugLevel.none.build.code_debug=0 @@ -6018,7 +6018,7 @@ lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_ lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +lilygo_t_eth_lite.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 lilygo_t_eth_lite.menu.DebugLevel.none=None lilygo_t_eth_lite.menu.DebugLevel.none.build.code_debug=0 @@ -8374,7 +8374,7 @@ sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_4MB.build.partitions= sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +sparkfun_esp32c6_thing_plus.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 sparkfun_esp32c6_thing_plus.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs sparkfun_esp32c6_thing_plus.menu.PartitionScheme.zigbee.build.partitions=zigbee sparkfun_esp32c6_thing_plus.menu.PartitionScheme.zigbee.upload.maximum_size=1310720 @@ -8784,7 +8784,7 @@ sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_4MB.build.partitions= sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +sparkfun_esp32_iot_redboard.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 sparkfun_esp32_iot_redboard.menu.CPUFreq.240=240MHz (WiFi/BT) sparkfun_esp32_iot_redboard.menu.CPUFreq.240.build.f_cpu=240000000L @@ -8964,7 +8964,7 @@ sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_4MB.build.partition sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.zigbee.build.partitions=zigbee sparkfun_esp32c6_qwiic_pocket.menu.PartitionScheme.zigbee.upload.maximum_size=1310720 @@ -9298,7 +9298,7 @@ nina_w10.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot nina_w10.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 nina_w10.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB nina_w10.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -nina_w10.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +nina_w10.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 nina_w10.menu.CPUFreq.240=240MHz (WiFi/BT) nina_w10.menu.CPUFreq.240.build.f_cpu=240000000L @@ -9509,7 +9509,7 @@ nora_w10.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot nora_w10.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 nora_w10.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB nora_w10.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -nora_w10.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +nora_w10.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 nora_w10.menu.CPUFreq.240=240MHz (WiFi) nora_w10.menu.CPUFreq.240.build.f_cpu=240000000L @@ -10481,7 +10481,7 @@ lolin_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot lolin_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 lolin_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB lolin_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -lolin_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +lolin_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 lolin_s3.menu.CPUFreq.240=240MHz (WiFi) lolin_s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -10981,7 +10981,7 @@ lolin_s3_pro.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n lolin_s3_pro.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 lolin_s3_pro.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB lolin_s3_pro.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -lolin_s3_pro.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +lolin_s3_pro.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 lolin_s3_pro.menu.CPUFreq.240=240MHz (WiFi) lolin_s3_pro.menu.CPUFreq.240.build.f_cpu=240000000L @@ -12361,7 +12361,7 @@ dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_4MB.build.partitions=r dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +dfrobot_firebeetle2_esp32e.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 dfrobot_firebeetle2_esp32e.menu.CPUFreq.240=240MHz (WiFi/BT) dfrobot_firebeetle2_esp32e.menu.CPUFreq.240.build.f_cpu=240000000L @@ -12614,7 +12614,7 @@ dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions= dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +dfrobot_firebeetle2_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 dfrobot_firebeetle2_esp32s3.menu.CPUFreq.240=240MHz (WiFi) dfrobot_firebeetle2_esp32s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -12975,7 +12975,7 @@ dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainma dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +dfrobot_romeo_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 dfrobot_romeo_esp32s3.menu.CPUFreq.240=240MHz (WiFi) dfrobot_romeo_esp32s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -18176,7 +18176,7 @@ nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmake nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +nologo_esp32s3_pico.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 nologo_esp32s3_pico.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) nologo_esp32s3_pico.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB nologo_esp32s3_pico.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -18895,7 +18895,7 @@ esp32-poe.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_o esp32-poe.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32-poe.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32-poe.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32-poe.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32-poe.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32-poe.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32-poe.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32-poe.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -19038,7 +19038,7 @@ esp32-poe-iso.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ esp32-poe-iso.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32-poe-iso.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32-poe-iso.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32-poe-iso.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32-poe-iso.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32-poe-iso.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32-poe-iso.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32-poe-iso.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -19316,7 +19316,7 @@ esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s2-devkitlipo.menu.PartitionScheme.custom=Custom esp32s2-devkitlipo.menu.PartitionScheme.custom.build.partitions= esp32s2-devkitlipo.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -19511,7 +19511,7 @@ esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainm esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s2-devkitlipo-usb.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s2-devkitlipo-usb.menu.PartitionScheme.custom=Custom esp32s2-devkitlipo-usb.menu.PartitionScheme.custom.build.partitions= esp32s2-devkitlipo-usb.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -19766,7 +19766,7 @@ esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32s3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32s3-devkitlipo.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) esp32s3-devkitlipo.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB esp32s3-devkitlipo.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -19924,7 +19924,7 @@ esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32c3-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32c3-devkitlipo.menu.PartitionScheme.custom=Custom esp32c3-devkitlipo.menu.PartitionScheme.custom.build.partitions= esp32c3-devkitlipo.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -20097,7 +20097,7 @@ esp32c6-evb.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no esp32c6-evb.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32c6-evb.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32c6-evb.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32c6-evb.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32c6-evb.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32c6-evb.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs esp32c6-evb.menu.PartitionScheme.zigbee.build.partitions=zigbee esp32c6-evb.menu.PartitionScheme.zigbee.upload.maximum_size=1310720 @@ -20280,7 +20280,7 @@ esp32h2-devkitlipo.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=314 #esp32h2-devkitlipo.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 #esp32h2-devkitlipo.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB #esp32h2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -#esp32h2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +#esp32h2-devkitlipo.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32h2-devkitlipo.menu.PartitionScheme.zigbee=Zigbee 4MB with spiffs esp32h2-devkitlipo.menu.PartitionScheme.zigbee.build.partitions=zigbee esp32h2-devkitlipo.menu.PartitionScheme.zigbee.upload.maximum_size=1310720 @@ -20455,7 +20455,7 @@ esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +esp32-sbc-fabgl.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 esp32-sbc-fabgl.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs esp32-sbc-fabgl.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr esp32-sbc-fabgl.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -20698,7 +20698,7 @@ m5stack_core.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n m5stack_core.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_core.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_core.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_core.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_core.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_core.menu.PartitionScheme.custom=Custom m5stack_core.menu.PartitionScheme.custom.build.partitions= m5stack_core.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -20874,7 +20874,7 @@ m5stack_fire.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n m5stack_fire.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_fire.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_fire.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_fire.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_fire.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_fire.menu.PartitionScheme.custom=Custom m5stack_fire.menu.PartitionScheme.custom.build.partitions= m5stack_fire.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -21048,7 +21048,7 @@ m5stack_core2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ m5stack_core2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_core2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_core2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_core2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_core2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_core2.menu.PartitionScheme.custom=Custom m5stack_core2.menu.PartitionScheme.custom.build.partitions= m5stack_core2.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -21222,7 +21222,7 @@ m5stack_tough.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ m5stack_tough.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_tough.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_tough.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_tough.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_tough.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_tough.menu.PartitionScheme.custom=Custom m5stack_tough.menu.PartitionScheme.custom.build.partitions= m5stack_tough.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -21389,7 +21389,7 @@ m5stack_station.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M m5stack_station.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_station.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_station.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_station.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_station.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_station.menu.PartitionScheme.custom=Custom m5stack_station.menu.PartitionScheme.custom.build.partitions= m5stack_station.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -21868,7 +21868,7 @@ m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmak m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_stickc_plus2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_stickc_plus2.menu.PartitionScheme.custom=Custom m5stack_stickc_plus2.menu.PartitionScheme.custom.build.partitions= m5stack_stickc_plus2.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -22275,7 +22275,7 @@ m5stack_atoms3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB m5stack_atoms3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_atoms3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_atoms3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_atoms3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_atoms3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_atoms3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_atoms3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_atoms3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -22508,7 +22508,7 @@ m5stack_cores3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB m5stack_cores3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_cores3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_cores3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_cores3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_cores3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_cores3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_cores3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_cores3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -23050,7 +23050,7 @@ m5stack_unit_cams3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker m5stack_unit_cams3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_unit_cams3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_unit_cams3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_unit_cams3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_unit_cams3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_unit_cams3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_unit_cams3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_unit_cams3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -23347,7 +23347,7 @@ m5stack_paper.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ m5stack_paper.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_paper.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_paper.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_paper.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_paper.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_paper.menu.PartitionScheme.custom=Custom m5stack_paper.menu.PartitionScheme.custom.build.partitions= m5stack_paper.menu.PartitionScheme.custom.upload.maximum_size=16777216 @@ -24065,7 +24065,7 @@ m5stack_stamp_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4 m5stack_stamp_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_stamp_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_stamp_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_stamp_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_stamp_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_stamp_s3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_stamp_s3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_stamp_s3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -24302,7 +24302,7 @@ m5stack_capsule.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M m5stack_capsule.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_capsule.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_capsule.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_capsule.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_capsule.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_capsule.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_capsule.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_capsule.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -24542,7 +24542,7 @@ m5stack_cardputer.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_ m5stack_cardputer.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_cardputer.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_cardputer.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_cardputer.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_cardputer.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_cardputer.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_cardputer.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_cardputer.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -24779,7 +24779,7 @@ m5stack_dial.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n m5stack_dial.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_dial.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_dial.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_dial.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_dial.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_dial.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_dial.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_dial.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -25016,7 +25016,7 @@ m5stack_dinmeter.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4 m5stack_dinmeter.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 m5stack_dinmeter.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB m5stack_dinmeter.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -m5stack_dinmeter.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +m5stack_dinmeter.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 m5stack_dinmeter.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) m5stack_dinmeter.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB m5stack_dinmeter.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 @@ -28841,7 +28841,7 @@ bpi_leaf_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no bpi_leaf_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 bpi_leaf_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB bpi_leaf_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -bpi_leaf_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +bpi_leaf_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 bpi_leaf_s3.menu.CPUFreq.240=240MHz (WiFi) bpi_leaf_s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -29598,7 +29598,7 @@ fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +fri3d_2024_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 fri3d_2024_esp32s3.menu.CPUFreq.240=240MHz (WiFi) fri3d_2024_esp32s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -31365,7 +31365,7 @@ wifiduino32c3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ wifiduino32c3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 wifiduino32c3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB wifiduino32c3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -wifiduino32c3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +wifiduino32c3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 wifiduino32c3.menu.CPUFreq.160=160MHz (WiFi) wifiduino32c3.menu.CPUFreq.160.build.f_cpu=160000000L @@ -31596,7 +31596,7 @@ wifiduino32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ wifiduino32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 wifiduino32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB wifiduino32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -wifiduino32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +wifiduino32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 wifiduino32s3.menu.CPUFreq.240=240MHz (WiFi) wifiduino32s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -32809,7 +32809,7 @@ kb32.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota kb32.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 kb32.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB kb32.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -kb32.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +kb32.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 kb32.menu.CPUFreq.240=240MHz (WiFi/BT) kb32.menu.CPUFreq.240.build.f_cpu=240000000L @@ -32987,7 +32987,7 @@ deneyapkart.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no deneyapkart.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapkart.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapkart.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapkart.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapkart.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapkart.menu.CPUFreq.240=240MHz (WiFi/BT) deneyapkart.menu.CPUFreq.240.build.f_cpu=240000000L @@ -33165,7 +33165,7 @@ deneyapkart1A.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ deneyapkart1A.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapkart1A.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapkart1A.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapkart1A.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapkart1A.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapkart1A.menu.CPUFreq.240=240MHz (WiFi/BT) deneyapkart1A.menu.CPUFreq.240.build.f_cpu=240000000L @@ -33428,7 +33428,7 @@ deneyapkart1Av2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M deneyapkart1Av2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapkart1Av2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapkart1Av2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapkart1Av2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapkart1Av2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapkart1Av2.menu.CPUFreq.240=240MHz (WiFi) deneyapkart1Av2.menu.CPUFreq.240.build.f_cpu=240000000L @@ -33597,7 +33597,7 @@ deneyapmini.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no deneyapmini.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapmini.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapmini.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapmini.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapmini.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapmini.menu.CPUFreq.240=240MHz (WiFi) deneyapmini.menu.CPUFreq.240.build.f_cpu=240000000L @@ -33787,7 +33787,7 @@ deneyapminiv2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_ deneyapminiv2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapminiv2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapminiv2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapminiv2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapminiv2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapminiv2.menu.CPUFreq.240=240MHz (WiFi) deneyapminiv2.menu.CPUFreq.240.build.f_cpu=240000000L @@ -33956,7 +33956,7 @@ deneyapkartg.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n deneyapkartg.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 deneyapkartg.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB deneyapkartg.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -deneyapkartg.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +deneyapkartg.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 deneyapkartg.menu.CPUFreq.160=160MHz (WiFi) deneyapkartg.menu.CPUFreq.160.build.f_cpu=160000000L @@ -34704,7 +34704,7 @@ tamc_termod_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB tamc_termod_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 tamc_termod_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB tamc_termod_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -tamc_termod_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +tamc_termod_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 tamc_termod_s3.menu.CPUFreq.240=240MHz (WiFi) tamc_termod_s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -35402,7 +35402,7 @@ XIAO_ESP32C3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_n XIAO_ESP32C3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 XIAO_ESP32C3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB XIAO_ESP32C3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -XIAO_ESP32C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +XIAO_ESP32C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 XIAO_ESP32C3.menu.CPUFreq.160=160MHz (WiFi) XIAO_ESP32C3.menu.CPUFreq.160.build.f_cpu=160000000L @@ -37138,7 +37138,7 @@ unphone8.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot unphone8.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 unphone8.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB unphone8.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -unphone8.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +unphone8.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 unphone8.menu.PartitionScheme.max_app_8MB=Maximum APP (7.9MB APP No OTA/No FS) unphone8.menu.PartitionScheme.max_app_8MB.build.partitions=max_app_8MB @@ -37294,7 +37294,7 @@ unphone9.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot unphone9.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 unphone9.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB unphone9.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -unphone9.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +unphone9.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 unphone9.menu.PartitionScheme.max_app_8MB=Maximum APP (7.9MB APP No OTA/No FS) unphone9.menu.PartitionScheme.max_app_8MB.build.partitions=max_app_8MB @@ -38023,7 +38023,7 @@ VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rai VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +VALTRACK_V4_VTS_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 VALTRACK_V4_VTS_ESP32_C3.menu.CPUFreq.160=160MHz (WiFi) VALTRACK_V4_VTS_ESP32_C3.menu.CPUFreq.160.build.f_cpu=160000000L @@ -38174,7 +38174,7 @@ VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rai VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +VALTRACK_V4_MFW_ESP32_C3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 VALTRACK_V4_MFW_ESP32_C3.menu.CPUFreq.160=160MHz (WiFi) VALTRACK_V4_MFW_ESP32_C3.menu.CPUFreq.160.build.f_cpu=160000000L @@ -38405,7 +38405,7 @@ Edgebox-ESP-100.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4M Edgebox-ESP-100.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 Edgebox-ESP-100.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB Edgebox-ESP-100.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -Edgebox-ESP-100.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +Edgebox-ESP-100.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 Edgebox-ESP-100.menu.CPUFreq.240=240MHz (WiFi) Edgebox-ESP-100.menu.CPUFreq.240.build.f_cpu=240000000L @@ -38775,7 +38775,7 @@ nebulas3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot nebulas3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 nebulas3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB nebulas3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -nebulas3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +nebulas3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 nebulas3.menu.CPUFreq.240=240MHz (WiFi) nebulas3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -39001,7 +39001,7 @@ lionbits3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_o lionbits3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 lionbits3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB lionbits3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -lionbits3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +lionbits3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 lionbits3.menu.CPUFreq.240=240MHz (WiFi) lionbits3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -40299,7 +40299,7 @@ atd147_s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_o atd147_s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 atd147_s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB atd147_s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -atd147_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +atd147_s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 atd147_s3.menu.CPUFreq.240=240MHz (WiFi) atd147_s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -40482,7 +40482,7 @@ atd35s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota atd35s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 atd35s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB atd35s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -atd35s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +atd35s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 atd35s3.menu.CPUFreq.240=240MHz (WiFi) atd35s3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -42111,7 +42111,7 @@ waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker.build.partitions waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_169.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -42310,7 +42310,7 @@ waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker.build.partitio waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_amoled_18.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -42509,7 +42509,7 @@ waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker.build.partitions=rainm waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_lcd_169.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_lcd_169.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_lcd_169.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_lcd_169.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -43022,7 +43022,7 @@ aslcanx2.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot aslcanx2.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 aslcanx2.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB aslcanx2.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -aslcanx2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +aslcanx2.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 aslcanx2.menu.CPUFreq.240=240MHz (WiFi) aslcanx2.menu.CPUFreq.240.build.f_cpu=240000000L @@ -43812,7 +43812,7 @@ codecell.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ot codecell.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 codecell.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB codecell.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -codecell.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +codecell.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 codecell.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs codecell.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr codecell.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720 @@ -44189,7 +44189,7 @@ waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker.build.partiti waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_amoled_241.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -44394,7 +44394,7 @@ waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker.build.partitions= waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_43.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -44593,7 +44593,7 @@ waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker.build.partitions waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_43B.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -44797,7 +44797,7 @@ waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker.build.partitions=r waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_7.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -44996,7 +44996,7 @@ waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker.build.partitions=r waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_5.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -45195,7 +45195,7 @@ waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker.build.partitions= waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_5B.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -45394,7 +45394,7 @@ waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker.build.partitions=r waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_lcd_4.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -45602,7 +45602,7 @@ waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.default_8MB.build.partitio waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_touch_lcd_185.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -46179,7 +46179,7 @@ waveshare_esp32_s3_lcd_185.menu.PartitionScheme.default_8MB.build.partitions=def waveshare_esp32_s3_lcd_185.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_lcd_185.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_lcd_185.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_lcd_185.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_lcd_185.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_lcd_185.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_lcd_185.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_lcd_185.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -46416,7 +46416,7 @@ waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.default_8MB.build.partitio waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_touch_lcd_146.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -46653,7 +46653,7 @@ waveshare_esp32_s3_lcd_146.menu.PartitionScheme.default_8MB.build.partitions=def waveshare_esp32_s3_lcd_146.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_lcd_146.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_lcd_146.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_lcd_146.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_lcd_146.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_lcd_146.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_lcd_146.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_lcd_146.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -46890,7 +46890,7 @@ waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.default_8MB.build.part waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_touch_lcd_185_box.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -47123,7 +47123,7 @@ waveshare_esp32_s3_lcd_147.menu.PartitionScheme.default_8MB.build.partitions=def waveshare_esp32_s3_lcd_147.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_lcd_147.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_lcd_147.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_lcd_147.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_lcd_147.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_lcd_147.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_lcd_147.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_lcd_147.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -47360,7 +47360,7 @@ waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.default_8MB.build.partition waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_touch_lcd_21.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -47597,7 +47597,7 @@ waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.default_8MB.build.partition waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.default.build.partitions=default waveshare_esp32_s3_touch_lcd_28.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) @@ -47831,7 +47831,7 @@ waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.default_8MB.build.partitions=d waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB waveshare_esp32_s3_relay_6ch.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 @@ -48071,7 +48071,7 @@ waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker.build.partiti waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_amoled_164.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -48273,7 +48273,7 @@ waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker.build.partiti waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_amoled_143.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -48475,7 +48475,7 @@ waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker.build.partiti waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080 waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.fatflash.build.partitions=ffat waveshare_esp32_s3_touch_amoled_191.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 @@ -50083,7 +50083,7 @@ cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_ cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656 cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_8MB=RainMaker 8MB cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_8MB.build.partitions=rainmaker_8MB -cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4116480 +cyobot_v2_esp32s3.menu.PartitionScheme.rainmaker_8MB.upload.maximum_size=4096000 cyobot_v2_esp32s3.menu.PartitionScheme.app5M_fat24M_32MB=32M Flash (4.8MB APP/22MB FATFS) cyobot_v2_esp32s3.menu.PartitionScheme.app5M_fat24M_32MB.build.partitions=large_fat_32MB cyobot_v2_esp32s3.menu.PartitionScheme.app5M_fat24M_32MB.upload.maximum_size=4718592 diff --git a/tools/partitions/rainmaker_8MB.csv b/tools/partitions/rainmaker_8MB.csv index 6d65333063f..6bad399968c 100644 --- a/tools/partitions/rainmaker_8MB.csv +++ b/tools/partitions/rainmaker_8MB.csv @@ -1,7 +1,7 @@ # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, -ota_0, app, ota_0, 0x10000, 0x3ED000, -ota_1, app, ota_1, 0x3FD000, 0x3ED000, +ota_0, app, ota_0, 0x10000, 0x3EA000, +ota_1, app, ota_1, 0x400000, 0x3EA000, fctry, data, nvs, 0x7EA000, 0x6000, coredump, data, coredump,0x7F0000, 0x10000,