### Create Project from Example Source: https://github.com/espressif/idf-extra-components/blob/master/coremark/README.md Use this command to create a new demo project from the Coremark example. ```bash idf.py create-project-from-example "espressif/coremark:coremark_example" ``` -------------------------------- ### ESP CLI Initialization and Usage Example Source: https://github.com/espressif/idf-extra-components/blob/master/esp_cli/README.md This snippet shows the complete process of initializing the ESP CLI, including linenoise configuration, command set creation, task creation, starting, stopping, and destroying the CLI instance. It also includes example application logic running in parallel. ```c // Initialize esp_linenoise (mandatory) esp_linenoise_handle_t esp_linenoise_hdl = NULL; esp_linenoise_config_t esp_linenoise_config; esp_linenoise_config.prompt = ">"; esp_linenoise_config.max_cmd_line_length = EXAMPLE_COMMAND_MAX_LENGTH; esp_linenoise_config.history_max_length = 16; esp_linenoise_config.in_fd = STDIN_FILENO; esp_linenoise_config.out_fd = STDOUT_FILENO; esp_linenoise_config.allow_multi_line = true; esp_linenoise_config.allow_empty_line = true; esp_linenoise_config.allow_dumb_mode = false; esp_linenoise_config.completion_cb = example_completion_cb; esp_linenoise_config.hints_cb = example_hints_cb; esp_linenoise_config.free_hints_cb = example_free_hints_cb; esp_linenoise_config.read_bytes_cb = NULL; // use default read function esp_linenoise_config.write_bytes_cb = NULL; // use default write function esp_linenoise_config.history = NULL; ESP_ERROR_CHECK(esp_linenoise_create_instance(&esp_linenoise_config, &esp_linenoise_hdl)); // Initialize command set (optional) const char* cmd_set[1] = { "cmd" }; esp_cli_command_set_handle_t esp_cli_commands_cmd_set = ESP_CLI_COMMANDS_CREATE_CMD_SET(cmd_set, ESP_CLI_COMMAND_FIELD_ACCESSOR(name)); esp_cli_config_t cli_cfg = { .linenoise_handle = esp_linenoise_hdl, .command_set_handle = esp_cli_commands_cmd_set, /* optional */ .max_cmd_line_size = EXAMPLE_COMMAND_MAX_LENGTH, .history_save_path = "/spiffs/cli_history.txt", /* optional */ }; ret = esp_cli_create(&cli_cfg, &cli); if (ret != ESP_OK) { ESP_LOGE(TAG, "Failed to create esp_cli instance (%s)", esp_err_to_name(ret)); return; } // Create esp_cli instance task if (xTaskCreate(example_cli_task, "example_cli_task", 4096, cli, 5, NULL) != pdPASS) { ESP_LOGE(TAG, "Failed to create esp_cli instance task"); esp_cli_destroy(cli); return; } ESP_LOGI(TAG, "Starting esp_cli..."); ret = esp_cli_start(cli); if (ret != ESP_OK) { ESP_LOGE(TAG, "Failed to start esp_cli (%s)", esp_err_to_name(ret)); esp_cli_destroy(cli); return; } // Application logic can run in parallel while esp_cli instance runs in its own task // [...] vTaskDelay(pdMS_TO_TICKS(10000)); // Example delay // Stop esp_cli instance ret = esp_cli_stop(cli); if (ret != ESP_OK) { ESP_LOGW(TAG, "Failed to stop esp_cli (%s)", esp_err_to_name(ret)); } ESP_LOGI(TAG, "esp_cli exited"); // Destroy esp_cli instance and clean up ret = esp_cli_destroy(cli); if (ret != ESP_OK) { ESP_LOGW(TAG, "Failed to destroy esp_cli instance cleanly (%s)", esp_err_to_name(ret)); } ESP_LOGI(TAG, "esp_cli example finished"); } ``` -------------------------------- ### Create Catch2 Example Project Source: https://github.com/espressif/idf-extra-components/blob/master/catch2/README.md Use this command to quickly set up a new ESP-IDF project with the Catch2 example. This allows you to start testing immediately. ```bash idf.py create-project-from-example "espressif/catch:catch2-test" cd catch2-test idf.py set-target esp32 idf.py build flash monitor ``` -------------------------------- ### Build and Monitor Example Project Source: https://github.com/espressif/idf-extra-components/blob/master/coremark/README.md Steps to build the Coremark example project for a specific target and monitor its output. ```bash cd coremark_example idf.py set-target esp32c3 idf.py build idf.py -p PORT flash monitor ``` -------------------------------- ### Build and Flash Example Source: https://github.com/espressif/idf-extra-components/blob/master/esp_delta_ota/examples/https_delta_ota/README.md Builds and flashes the example project to the target device. Ensure the project is configured with network credentials and the firmware upgrade URL. ```bash idf.py build flash ``` -------------------------------- ### Build and Run CoreMark Example Source: https://github.com/espressif/idf-extra-components/blob/master/coremark/examples/coremark_example/README.md Commands to set the target and flash/monitor the CoreMark example on an ESP32-C3. Ensure the correct PORT is specified. ```bash idf.py set-target esp32c3 idf.py -p PORT flash monitor ``` -------------------------------- ### Example Output Log Source: https://github.com/espressif/idf-extra-components/blob/master/esp_lcd_qemu_rgb/examples/lcd_qemu_rgb_panel/README.md This log output shows the sequence of initialization and operational messages when running the QEMU RGB panel example. ```text I (55) example: Install RGB LCD panel driver I (55) example: Initialize RGB LCD panel I (55) example: Initialize LVGL library I (55) example: Allocate separate LVGL draw buffer I (55) example: Register display driver to LVGL I (55) example: Install LVGL tick timer I (55) example: Create LVGL task I (55) example: Starting LVGL task I (65) example: Display LVGL Scatter Chart I (75) main_task: Returned from app_main() ``` -------------------------------- ### Build and Monitor FreeType Example Source: https://github.com/espressif/idf-extra-components/blob/master/freetype/examples/freetype-example/README.md Commands to set the target and flash/monitor the FreeType example on an ESP32 board. ```bash idf.py set-target esp32 idf.py -p PORT flash monitor ``` -------------------------------- ### Build and Flash ESP-IDF Example Source: https://github.com/espressif/idf-extra-components/blob/master/esp_ext_part_tables/examples/basic/README.md Commands to set the target, configure, build, flash, and monitor the example project using ESP-IDF. ```bash idf.py set-target esp32s3 idf.py menuconfig idf.py build flash monitor ``` -------------------------------- ### Build, Flash, and Monitor ESP Schedule Example Source: https://github.com/espressif/idf-extra-components/blob/master/esp_schedule/examples/get_started/README.md Standard commands to build, flash, and monitor the ESP Schedule example project. Ensure the target chip is set correctly before building. ```bash idf.py set-target idf.py build idf.py -p PORT flash monitor ``` -------------------------------- ### Build and Flash Example Source: https://github.com/espressif/idf-extra-components/blob/master/eigen/examples/svd/README.md Command to build, flash, and monitor the Eigen example on an ESP-IDF development board. ```bash idf.py -p PORT flash monitor ``` -------------------------------- ### Build and Flash ESP Daylight Example Source: https://github.com/espressif/idf-extra-components/blob/master/esp_daylight/examples/get_started/README.md Commands to create, build, flash, and monitor the ESP Daylight example project using ESP-IDF. ```bash idf.py create-project-from-example "espressif/esp_daylight:get_started" cd get_started idf.py set-target esp32 idf.py build flash monitor ``` ```bash cd examples/get_started idf.py set-target esp32 idf.py build flash monitor ``` -------------------------------- ### LED Strip RMT WS2812 Example Output Source: https://github.com/espressif/idf-extra-components/blob/master/led_strip/examples/led_strip_rmt_ws2812/README.md This output shows the initialization messages and confirmation that the LED strip blinking has started. It indicates successful creation of the LED strip object and the RMT backend. ```text I (299) gpio: GPIO[8]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (309) example: Created LED strip object with RMT backend I (309) example: Start blinking LED strip ``` -------------------------------- ### Example Output Source: https://github.com/espressif/idf-extra-components/blob/master/iqmath/examples/get_started/README.md This is the expected output when the IQMath example runs successfully, indicating that the IQMath test has passed. ```text I (308) main_task: Started on CPU0 I (308) main_task: Calling app_main() I (308) example: IQMath test passed I (318) main_task: Returned from app_main() ``` -------------------------------- ### Build and Run SPI NAND Flash Debug Example Source: https://github.com/espressif/idf-extra-components/blob/master/spi_nand_flash_fatfs/examples/nand_flash_debug_app/README.md Use this CMake command to build and flash the NAND flash debug example to your device. The command also starts a serial monitor to view the output. ```cmake # CMake idf.py -p PORT flash monitor ``` -------------------------------- ### Example Output Log Source: https://github.com/espressif/idf-extra-components/blob/master/touch_element/examples/touch_matrix/README.md This log shows the output from the Touch Matrix Example, indicating touch events like presses, releases, and long presses on the matrix axes. ```text I (331) Touch Matrix Example: Touch element library installed I (331) Touch Matrix Example: Touch matrix installed I (341) Touch Matrix Example: Touch matrix created I (341) Touch Matrix Example: Touch element library start I (1951) Touch Matrix Example: Matrix Press, axis: (0, 0) index: 0 I (2131) Touch Matrix Example: Matrix Release, axis: (0, 0) index: 0 I (3121) Touch Matrix Example: Matrix Press, axis: (1, 1) index: 4 I (3281) Touch Matrix Example: Matrix Release, axis: (1, 1) index: 4 I (4621) Touch Matrix Example: Matrix Press, axis: (2, 0) index: 6 I (4801) Touch Matrix Example: Matrix Release, axis: (2, 0) index: 6 I (5381) Touch Matrix Example: Matrix Press, axis: (2, 2) index: 8 I (5571) Touch Matrix Example: Matrix Release, axis: (2, 2) index: 8 I (6221) Touch Matrix Example: Matrix Press, axis: (0, 2) index: 2 I (6441) Touch Matrix Example: Matrix Release, axis: (0, 2) index: 2 I (7551) Touch Matrix Example: Matrix Press, axis: (1, 1) index: 4 I (8551) Touch Matrix Example: Matrix LongPress, axis: (1, 1) index: 4 I (9551) Touch Matrix Example: Matrix LongPress, axis: (1, 1) index: 4 I (10551) Touch Matrix Example: Matrix LongPress, axis: (1, 1) index: 4 I (11031) Touch Matrix Example: Matrix Release, axis: (1, 1) index: 4 ``` -------------------------------- ### Example Provisioning Output Log Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md This log shows the initial output during the provisioning process, including the service name of the Bluetooth LE device. ```log I (445) app: Starting provisioning I (1035) app: Provisioning started I (1045) network_prov_mgr: Provisioning started with service name : PROV_F72E6B ``` -------------------------------- ### Example Output Log Source: https://github.com/espressif/idf-extra-components/blob/master/touch_element/examples/touch_button/README.md This is a sample of the serial output you can expect when running the touch button example. It shows button press, release, and long press events. ```log I (331) Touch Button Example: Touch element library installed I (331) Touch Button Example: Touch button installed I (341) Touch Button Example: Touch buttons created I (341) Touch Button Example: Touch element library start I (1481) Touch Button Example: Button[1] Press I (1701) Touch Button Example: Button[1] Release I (2731) Touch Button Example: Button[2] Press I (2921) Touch Button Example: Button[2] Release I (3581) Touch Button Example: Button[5] Press I (3781) Touch Button Example: Button[5] Release I (3931) Touch Button Example: Button[4] Press I (4121) Touch Button Example: Button[4] Release I (4271) Touch Button Example: Button[3] Press I (4491) Touch Button Example: Button[3] Release I (4671) Touch Button Example: Button[6] Press I (4891) Touch Button Example: Button[6] Release I (5091) Touch Button Example: Button[7] Press I (5311) Touch Button Example: Button[7] Release I (5491) Touch Button Example: Button[8] Press I (5741) Touch Button Example: Button[8] Release I (5991) Touch Button Example: Button[9] Press I (7991) Touch Button Example: Button[9] LongPress I (9991) Touch Button Example: Button[9] LongPress I (11991) Touch Button Example: Button[9] LongPress I (12881) Touch Button Example: Button[9] Release ``` -------------------------------- ### Build and Monitor for Linux Host Source: https://github.com/espressif/idf-extra-components/blob/master/catch2/examples/catch2-test/README.md Build and monitor the example project on a Linux host using idf.py with the --preview option. ```bash idf.py --preview set-target linux idf.py build monitor ``` -------------------------------- ### Install Dependencies for ESP-IDF v6.0+ Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/tool/esp_prov/README.md Installs necessary Python libraries for esp_prov on ESP-IDF v6.0 or later. ```bash bash install.sh --enable-ci ``` -------------------------------- ### LED Strip SPI WS2812 Example Output Source: https://github.com/espressif/idf-extra-components/blob/master/led_strip/examples/led_strip_spi_ws2812/README.md Example output logs from the LED strip SPI WS2812 demonstration. Shows GPIO initialization and LED strip object creation. ```text I (299) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (309) example: Created LED strip object with SPI backend I (309) example: Start blinking LED strip ``` -------------------------------- ### Example Output Log Source: https://github.com/espressif/idf-extra-components/blob/master/touch_element/examples/touch_slider/README.md This is a sample of the serial output from the Touch Slider Example, showing touch events and calculated slider positions. ```text I (331) Touch Slider Example: Touch element library installed I (331) Touch Slider Example: Touch slider installed I (341) Touch Slider Example: Touch slider created I (341) Touch Slider Example: Touch element library start I (1911) Touch Slider Example: Slider Press, position: 0 I (1921) Touch Slider Example: Slider Calculate, position: 0 I (1931) Touch Slider Example: Slider Calculate, position: 0 I (1941) Touch Slider Example: Slider Calculate, position: 0 I (1951) Touch Slider Example: Slider Calculate, position: 0 I (1961) Touch Slider Example: Slider Calculate, position: 0 I (1971) Touch Slider Example: Slider Calculate, position: 0 I (1981) Touch Slider Example: Slider Calculate, position: 0 I (1991) Touch Slider Example: Slider Calculate, position: 0 I (2001) Touch Slider Example: Slider Calculate, position: 0 I (2011) Touch Slider Example: Slider Calculate, position: 1 I (2021) Touch Slider Example: Slider Calculate, position: 1 I (2031) Touch Slider Example: Slider Calculate, position: 2 I (2041) Touch Slider Example: Slider Calculate, position: 2 I (2051) Touch Slider Example: Slider Calculate, position: 4 I (2061) Touch Slider Example: Slider Calculate, position: 5 I (2071) Touch Slider Example: Slider Calculate, position: 6 I (2081) Touch Slider Example: Slider Calculate, position: 8 I (2091) Touch Slider Example: Slider Calculate, position: 10 I (2101) Touch Slider Example: Slider Calculate, position: 12 I (2111) Touch Slider Example: Slider Calculate, position: 15 I (2121) Touch Slider Example: Slider Calculate, position: 17 I (2131) Touch Slider Example: Slider Calculate, position: 19 I (2141) Touch Slider Example: Slider Calculate, position: 22 I (2151) Touch Slider Example: Slider Calculate, position: 24 I (2161) Touch Slider Example: Slider Calculate, position: 26 I (2171) Touch Slider Example: Slider Calculate, position: 29 I (2181) Touch Slider Example: Slider Calculate, position: 31 I (2191) Touch Slider Example: Slider Calculate, position: 33 I (2201) Touch Slider Example: Slider Calculate, position: 35 I (2211) Touch Slider Example: Slider Calculate, position: 37 I (2221) Touch Slider Example: Slider Calculate, position: 40 I (2231) Touch Slider Example: Slider Calculate, position: 42 I (2241) Touch Slider Example: Slider Calculate, position: 44 I (2251) Touch Slider Example: Slider Calculate, position: 46 I (2261) Touch Slider Example: Slider Calculate, position: 48 I (2271) Touch Slider Example: Slider Calculate, position: 50 I (2281) Touch Slider Example: Slider Calculate, position: 52 I (2291) Touch Slider Example: Slider Calculate, position: 54 I (2301) Touch Slider Example: Slider Calculate, position: 56 I (2311) Touch Slider Example: Slider Calculate, position: 57 I (2321) Touch Slider Example: Slider Calculate, position: 59 I (2331) Touch Slider Example: Slider Calculate, position: 60 I (2341) Touch Slider Example: Slider Calculate, position: 61 I (2351) Touch Slider Example: Slider Release, position: 61 ``` -------------------------------- ### Configure hello_jpeg Example Build Source: https://github.com/espressif/idf-extra-components/blob/master/libjpeg-turbo/examples/hello_jpeg/main/CMakeLists.txt This snippet shows the CMakeLists.txt configuration for the hello_jpeg example. It registers the component, specifies source files, include directories, embeds JPEG image files, and declares a dependency on the esp_timer component. ```cmake idf_component_register(SRCS "main.c" "decode_image.c" INCLUDE_DIRS "." EMBED_FILES image32x32.jpg image.jpg REQUIRES esp_timer) ``` -------------------------------- ### Start Python HTTPS Server for OTA Source: https://github.com/espressif/idf-extra-components/blob/master/esp_encrypted_img/examples/pre_encrypted_ota/README.md Start a local Python HTTPS server to host the encrypted OTA image. The server requires the build directory, a port number, and optionally a directory containing server certificates. ```bash python pytest_pre_encrypted_ota.py build 8070 server_certs ``` -------------------------------- ### Troubleshooting Provisioning Failure Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md Example log output indicating a provisioning failure due to an incorrect Thread dataset or connection issues. It suggests resetting to factory defaults. ```text E (367015) app: Provisioning failed! Reason : Thread network not found Please reset to factory and retry provisioning ``` -------------------------------- ### CoreMark Example CMakeLists.txt Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/coremark/examples/coremark_example/CMakeLists.txt This snippet shows the basic CMake configuration for the coremark example project. It sets the minimum required CMake version, defines the components to be built, includes the IDF project CMake script, and sets the project name. ```cmake cmake_minimum_required(VERSION 3.5) set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(coremark_example) ``` -------------------------------- ### Basic CMakeLists.txt for Lua Example Source: https://github.com/espressif/idf-extra-components/blob/master/lua/examples/lua_example/CMakeLists.txt This snippet sets up the basic build environment for a Lua example project using ESP-IDF. It ensures the correct CMake version and includes the necessary IDF build system scripts. ```cmake cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(lua_example) ``` -------------------------------- ### Download Example Font Source: https://github.com/espressif/idf-extra-components/blob/master/freetype/examples/freetype-example/main/CMakeLists.txt Sets variables for the font URL and filename, creates a directory for the font, and downloads the font file. ```cmake set(URL "https://github.com/espressif/esp-docs/raw/f036a337d8bee5d1a93b2264ecd29255baec4260/src/esp_docs/fonts/DejaVuSans.ttf") set(FILE "DejaVuSans.ttf") set(SPIFFS_DIR "${CMAKE_BINARY_DIR}/spiffs") file(MAKE_DIRECTORY ${SPIFFS_DIR}) file(DOWNLOAD ${URL} ${SPIFFS_DIR}/${FILE} SHOW_PROGRESS) ``` -------------------------------- ### Project Setup with CMake Source: https://github.com/espressif/idf-extra-components/blob/master/esp_jpeg/test_apps/CMakeLists.txt Sets the minimum CMake version, includes the IDF project CMake module, defines the main component, and sets the project name. ```cmake cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(COMPONENTS main) project(esp_jpeg_test) ``` -------------------------------- ### Project Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/esp_daylight/examples/get_started/CMakeLists.txt Sets up the CMake build environment for the esp_daylight example. Includes the IDF project script and defines the main component and project name. ```cmake cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(COMPONENTS main) project(esp_daylight_example) ``` -------------------------------- ### FreeType Example Project Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/freetype/examples/freetype-example/CMakeLists.txt Configures the CMake build system for the FreeType example project. It sets the minimum required CMake version, includes the IDF project script, and defines the project name. ```cmake cmake_minimum_required(VERSION 3.17) set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(freetype-example) ``` -------------------------------- ### Create, Get Line, and Delete esp_linenoise Instance Source: https://github.com/espressif/idf-extra-components/blob/master/esp_linenoise/README.md Demonstrates the basic lifecycle of an esp_linenoise instance: creating it with default configuration, retrieving a line of input, and then deleting the instance. ```c esp_linenoise_config_t config; esp_linenoise_get_instance_config_default(&config); esp_linenoise_handle_t handle; const esp_err_t ret = esp_linenoise_create_instance(&config, &handle); const size_t buffer_size = 128; char buffer[128]; const char *line = esp_linenoise_get_line(&handle, buffer, buffer_size); const esp_err_t ret_val = esp_linenoise_delete_instance(&handle); ``` -------------------------------- ### ESP-CLI Command Registration and Example Function Source: https://github.com/espressif/idf-extra-components/blob/master/esp_cli/README.md Defines an example command 'cmd' with its help string, execution function, hint, and glossary. This snippet shows the core structure for registering custom commands within the ESP-CLI framework. ```c #include #include #include "driver/uart_vfs.h" #include "driver/uart.h" #include "esp_log.h" #include "esp_cli.h" #include "esp_cli_commands.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #define EXAMPLE_COMMAND_MAX_LENGTH 128 static const char *TAG = "repl_example"; static int example_cmd_func(void *context, esp_cli_commands_exec_arg_t *cmd_args, int argc, char **argv) { (void)context; /* this is NULL and useless for the help command */ (void)argc; (void)argv; const char example_cmd_msg[] = "example command output\n"; cmd_args->write_func(cmd_args->out_fd, example_cmd_msg, strlen(example_cmd_msg)); return 0; } static const char *example_cmd_hint(void *context) { (void)context; return "example cmd hint"; } static const char *example_cmd_glossary(void *context) { (void)context; return "example command glossary"; } static const char example_cmd_help_str[] = "example command help"; ESP_CLI_COMMAND_REGISTER(cmd, cmd, example_cmd_help_str, example_cmd_func, NULL, example_cmd_hint, example_cmd_glossary); ``` -------------------------------- ### Security Version 2 Salt and Verifier Credentials Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md Example output showing the generated salt and verifier arrays for security scheme 2, which are used for device-side configuration. ```c static const char sec2_salt[] = { 0x1f, 0xff, 0x29, 0xf5, 0xc7, 0x7e, 0x07, 0x48, 0x02, 0xe9, 0x93, 0x3e, 0xa3, 0xa2, 0x26, 0x73 }; static const char sec2_verifier[] = { 0xa7, 0x29, 0xe6, 0xa5, 0x4d, 0x20, 0x57, 0x71, 0x7c, 0x9d, 0x78, 0x2d, 0x0a, 0xb0, 0x9f, 0xec, 0x7e, 0x8b, 0xab, 0xf5, 0xe6, 0xc3, 0x36, 0x41, 0x93, 0xfd, 0xb9, 0x49, 0x67, 0xe7, 0x7f, 0x79, 0x66, 0x25, 0x2e, 0xac, 0x89, 0x19, 0xb2, 0xb3, 0x14, 0xb1, 0x16, 0xb0, 0xb0, 0xe4, 0x34, 0xd4, 0x99, 0x40, 0x85, 0xa4, 0x99, 0x2b, 0x84, 0x21, 0xa1, 0xfb, 0x15, 0x48, 0x04, 0x91, 0xf5, 0x74, . . . 0x80, 0x86, 0xf4, 0xd5, 0x08, 0xbc, 0xb0, 0xdd, 0x6b, 0x50, 0xfa, 0xdd, 0x16, 0x10, 0x23, 0x4b }; ``` -------------------------------- ### ESP-CLI Application Main Function Source: https://github.com/espressif/idf-extra-components/blob/master/esp_cli/README.md The main entry point for the ESP-CLI example application. It initializes the I/O and prepares for the CLI task. ```c void app_main(void) { esp_err_t ret; esp_cli_handle_t cli = NULL; /* configure the IO used by the esp_cli */ example_init_io(); ``` -------------------------------- ### Create Catch2 Console Example Project Source: https://github.com/espressif/idf-extra-components/blob/master/catch2/README.md Command to create an ESP-IDF project that integrates Catch2 with the console component. This enables interactive test execution via serial commands. ```bash idf.py create-project-from-example "espressif/catch:catch2-console" cd catch2-console idf.py set-target esp32 idf.py build flash monitor ``` -------------------------------- ### Configure Relative Schedule Source: https://github.com/espressif/idf-extra-components/blob/master/esp_schedule/examples/get_started/README.md Modify the trigger time for a 'Relative' schedule. This example sets the schedule to trigger 30 seconds after program start. ```c .trigger.relative_seconds = 30, ``` -------------------------------- ### SPI NAND Flash Erase Alignment Validation Source: https://github.com/espressif/idf-extra-components/blob/master/spi_nand_flash/layered_architecture.md Example showing alignment checks for erase operations in SPI NAND flash. Verifies that the start address and erase length are aligned to the page size. ```c // Example: Erase alignment check if ((start_addr % page_size) != 0) { ESP_LOGE(TAG, "Start address not aligned to page size"); return ESP_ERR_INVALID_ARG; } if ((erase_len % page_size) != 0) { ESP_LOGE(TAG, "Erase length not aligned to page size"); return ESP_ERR_INVALID_ARG; } ``` -------------------------------- ### Configure Project Source: https://github.com/espressif/idf-extra-components/blob/master/sh2lib/examples/http2_request/README.md Open the project configuration menu to set up Wi-Fi or Ethernet connections. Refer to the main README for detailed network configuration instructions. ```bash idf.py menuconfig ``` -------------------------------- ### Disable fmt Installation Source: https://github.com/espressif/idf-extra-components/blob/master/fmt/CMakeLists.txt Disables the installation of the fmt component. ```cmake set(FMT_INSTALL OFF) ``` -------------------------------- ### Install Dependencies for ESP-IDF v5.1 Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/tool/esp_prov/README.md Installs necessary Python libraries for esp_prov on ESP-IDF v5.1. ```bash bash install.sh --enable-ttfw ``` -------------------------------- ### Install detools Source: https://github.com/espressif/idf-extra-components/blob/master/esp_delta_ota/README.md Install the detools package, required for binary delta encoding, using pip. ```bash pip install -r examples/https_delta_ota/tools/requirements.txt ``` -------------------------------- ### Touch Element Instance Startup Source: https://github.com/espressif/idf-extra-components/blob/master/touch_element/docs/src/index.md Demonstrates the creation of touch element instances like buttons, sliders, or matrices by selecting a channel and providing a sensitivity value. ```c touch_button_create(channel, sensitivity_value); touch_slider_create(channel, sensitivity_value); touch_matrix_create(channel, sensitivity_value); ``` -------------------------------- ### Touch Element Library Initialization and Event Handling Source: https://github.com/espressif/idf-extra-components/blob/master/touch_element/docs/src/index.md Demonstrates the typical initialization flow for the Touch Element library and setting up a button element with callback-based event handling. ```c static touch_button_handle_t element_handle; //Declare a touch element handle //Define the subscribed event handler void event_handler(touch_button_handle_t out_handle, touch_button_message_t out_message, void *arg) { //Event handler logic } void app_main() { //Using the default initializer to config Touch Element library touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); touch_element_install(&global_config); //Using the default initializer to config Touch elements touch_slider_global_config_t elem_global_config = TOUCH_SLIDER_GLOBAL_DEFAULT_CONFIG(); touch_slider_install(&elem_global_config); //Create a new instance touch_slider_config_t element_config = { ... ... }; touch_button_create(&element_config, &element_handle); //Subscribe the specified events by using the event mask touch_button_subscribe_event(element_handle, TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE, NULL); //Choose CALLBACK as the dispatch method touch_button_set_dispatch_method(element_handle, TOUCH_ELEM_DISP_CALLBACK); //Register the callback routine touch_button_set_callback(element_handle, event_handler); //Start Touch Element library processing touch_element_start(); } ``` -------------------------------- ### Install Dependencies for ESP-IDF v5.2 to v5.5 Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/tool/esp_prov/README.md Installs necessary Python libraries for esp_prov on ESP-IDF v5.2 to v5.5. ```bash bash install.sh --enable-pytest ``` -------------------------------- ### Expected Output of Catch2 Example Source: https://github.com/espressif/idf-extra-components/blob/master/catch2/examples/catch2-test/README.md This is the expected output when the Catch2 example runs successfully, indicating all tests have passed. ```text Randomness seeded to: 3499211612 =============================================================================== All tests passed (1 assertion in 1 test case) Test passed. ``` -------------------------------- ### Build, Flash, and Monitor Project Source: https://github.com/espressif/idf-extra-components/blob/master/esp_jpeg/examples/get_started/README.md Use this command to build, flash, and monitor the project. Ensure you have the ESP-IDF environment set up correctly. ```bash idf.py -p PORT flash monitor ``` -------------------------------- ### Register FreeType Example Component Source: https://github.com/espressif/idf-extra-components/blob/master/freetype/examples/freetype-example/main/CMakeLists.txt Registers the FreeType example component, specifying source files, include directories, and private requirements. ```cmake idf_component_register(SRCS "freetype-example.c" INCLUDE_DIRS "." PRIV_REQUIRES spiffs) ``` -------------------------------- ### Build and Flash Project Source: https://github.com/espressif/idf-extra-components/blob/master/coap/examples/coap_client/README.md Build the project using 'idf.py build' and flash it to the board with 'idf.py -p PORT flash'. Monitor the serial output using 'idf.py monitor'. ```bash idf.py build idf.py -p PORT flash monitor ``` -------------------------------- ### ESP SDIO Slave Initialization Steps Source: https://github.com/espressif/idf-extra-components/blob/master/esp_serial_slave_link/docs/src/sdio_slave_protocol.md Illustrates the sequence of SDIO commands for initializing an ESP SDIO slave device. Follows standard SDIO initialization procedures. ```text 1. SDIO reset > CMD52 (Write 0x6 = 0x8) 2. SD reset > CMD0 3. Check whether IO card (optional) > CMD8 4. Send SDIO op cond and wait for card ready > CMD5 arg = 0x00000000 > > CMD5 arg = 0x00ff8000 (according to the response above, poll until ready) > > **Example:** > > > Arg of R4 after first CMD5 (arg = 0x00000000) is 0xXXFFFF00. > > > > Keep sending CMD5 with arg = 0x00FFFF00 until the R4 shows card ready (arg bit 31 = 1). 5. Set address > CMD3 6. Select card > CMD7 (arg address according to CMD3 response) > > **Example:** > > > Arg of R6 after CMD3 is 0x0001xxxx. > > > Arg of CMD7 should be 0x00010000. 7. Select 4-bit mode (optional) > CMD52 (Write 0x07 = 0x02) 8. Enable func1 > CMD52 (Write 0x02 = 0x02) 9. Enable SDIO interrupt (required if interrupt line (DAT1) is used) > CMD52 (Write 0x04 = 0x03) 10. Set Func0 block size (optional, default value is 512 (0x200)) > CMD52/53 (Read 0x10 ~ 0x11) > > CMD52/53 (Write 0x10 = 0x00) > > CMD52/53 (Write 0x11 = 0x02) > > CMD52/53 (Read 0x10 ~ 0x11, read to check the final value) 11. Set Func1 block size (optional, default value is 512 (0x200)) > CMD52/53 (Read 0x110 ~ 0x111) > > CMD52/53 (Write 0x110 = 0x00) > > CMD52/53 (Write 0x111 = 0x02) > > CMD52/53 (Read 0x110 ~ 0x111, read to check the final value) ``` -------------------------------- ### Install Patch Generation Requirements Source: https://github.com/espressif/idf-extra-components/blob/master/esp_delta_ota/examples/https_delta_ota/README.md Installs the Python packages required for the delta OTA patch generation tool. This is a prerequisite for creating patch files. ```bash pip install -r tools/requirements.txt ``` -------------------------------- ### CMakeLists.txt Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/esp_linenoise/examples/completion/CMakeLists.txt Sets up the CMake build system for the completion example project. It defines the minimum required CMake version, includes the ESP-IDF build system, and specifies the project name and components. ```cmake cmake_minimum_required(VERSION 3.22) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(COMPONENTS main) project(completion) ``` -------------------------------- ### ESP Daylight Example Output Source: https://github.com/espressif/idf-extra-components/blob/master/esp_daylight/examples/get_started/README.md Sample output from the ESP Daylight component example, showing sunrise, sunset, and daylight duration for various cities. ```text ESP Daylight Component Example ============================ === Basic Sunrise/Sunset Calculation === Calculating sunrise/sunset for 2025-08-29: New York, USA : Sunrise 10:12:34 UTC, Sunset 23:45:12 UTC (Daylight: 13:32) London, UK : Sunrise 05:23:45 UTC, Sunset 19:34:56 UTC (Daylight: 14:11) Pune, India : Sunrise 01:15:23 UTC, Sunset 13:02:45 UTC (Daylight: 11:47) ... ``` -------------------------------- ### Interactive BLE Thread Provisioning Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md Demonstrates the interactive process of provisioning a Thread network over BLE. User input is required for device selection and network credentials. ```bash python esp_prov.py --transport ble --sec_ver 2 ``` -------------------------------- ### Example CoAP Server Output Logs Source: https://github.com/espressif/idf-extra-components/blob/master/coap/examples/coap_server/README.md Example serial output logs during CoAP server startup, showing Wi-Fi connection and IP address assignment. ```text ... I (332) wifi: mode : sta (30:ae:a4:04:1b:7c) I (1672) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1 I (1672) wifi: state: init -> auth (b0) I (1682) wifi: state: auth -> assoc (0) I (1692) wifi: state: assoc -> run (10) I (1692) wifi: connected with huawei_cw, channel 11 I (1692) wifi: pm start, type: 1 I (2622) event: sta ip: 192.168.3.84, mask: 255.255.255.0, gw: 192.168.3.1 I (2622) CoAP_server: Connected to AP ... ``` -------------------------------- ### CBOR Example Output Source: https://github.com/espressif/idf-extra-components/blob/master/cbor/examples/cbor/README.md This snippet shows the expected output from the CBOR example, including encoded buffer size, JSON conversion, and manual CBOR decoding. ```bash I (320) example: encoded buffer size 67 I (320) example: convert CBOR to JSON [{"chip":"esp32","unicore":false,"ip":[192,168,1,100]},3.1400001049041748,"simple(99)","2019-07-10 09:00:00+0000","undefined"] I (340) example: decode CBOR manually Array[ Map{ chip esp32 unicore false ip Array[ 192 168 1 100 ] } 3.14 simple(99) 2019-07-10 09:00:00+0000 undefined ] ``` -------------------------------- ### Basic CMakeLists.txt Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/ccomp_timer/test_apps/CMakeLists.txt This snippet sets up the minimum required CMake version, includes the IDF project setup script, defines the components to be built, and names the project. It's essential for any ESP-IDF project using CMake. ```cmake cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(COMPONENTS main) project(ccomp_timer_test) ``` -------------------------------- ### Sending Custom Data During Provisioning Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md Demonstrates how to send custom data to the device during provisioning using the esp_prov tool with the `--custom_data` option. ```bash ==== Sending Custom data to esp32 ==== CustomData response: SUCCESS ``` -------------------------------- ### Build Unit Test App with Specific Components Source: https://github.com/espressif/idf-extra-components/blob/master/unit-test-app/examples/unit-test-app/README.md Use this command to build the unit test app including tests for specified components. Replace `` with the actual component names. ```bash idf.py -T -T ... build ``` -------------------------------- ### WiFi Provisioning Console Mode Log Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/wifi_prov/README.md This log illustrates the step-by-step interaction during WiFi provisioning when the system falls back to console mode. It shows user inputs and device responses for connecting, verifying, and configuring the device. ```log ==== Esp_Prov Version: v1.0 ==== BLE client is running in console mode This could be due to your platform not being supported or dependencies not being met Please ensure all pre-requisites are met to run the full fledged client BLECLI >> Please connect to BLE device `PROV_01B1E8` manually using your tool of choice BLECLI >> Was the device connected successfully? [y/n] y BLECLI >> List available attributes of the connected device BLECLI >> Is the service UUID '0000ffff-0000-1000-8000-00805f9b34fb' listed among available attributes? [y/n] y BLECLI >> Is the characteristic UUID '0000ff53-0000-1000-8000-00805f9b34fb' listed among available attributes? [y/n] y BLECLI >> Is the characteristic UUID '0000ff51-0000-1000-8000-00805f9b34fb' listed among available attributes? [y/n] y BLECLI >> Is the characteristic UUID '0000ff52-0000-1000-8000-00805f9b34fb' listed among available attributes? [y/n] y ==== Verifying protocol version ==== BLECLI >> Write following data to characteristic with UUID '0000ff53-0000-1000-8000-00805f9b34fb' : >> 56302e31 BLECLI >> Enter data read from characteristic (in hex) : << 53554343455355 ==== Verified protocol version successfully ==== ==== Starting Session ==== BLECLI >> Write following data to characteristic with UUID '0000ff51-0000-1000-8000-00805f9b34fb' : >> 10015a25a201220a20ae6d9d5d1029f8c366892252d2d5a0ffa7ce1ee5829312545dd5f2aba057294d BLECLI >> Enter data read from characteristic (in hex) : << 10015a390801aa0134122048008bfc365fad4753dc75912e0c764d60749cb26dd609595b6fbc72e12614031a1089733af233c7448e7d7fb7963682c6d8 BLECLI >> Write following data to characteristic with UUID '0000ff51-0000-1000-8000-00805f9b34fb' : >> 10015a270802b2012212204051088dc294fe4621fac934a8ea22e948fcc3e8ac458aac088ce705c65dbfb9 BLECLI >> Enter data read from characteristic (in hex) : << 10015a270803ba01221a20c8d38059d5206a3d92642973ac6ba8ac2f6ecf2b7a3632964eb35a0f20133adb ==== Session Established ==== ==== Sending Wifi credential to esp32 ==== BLECLI >> Write following data to characteristic with UUID '0000ff52-0000-1000-8000-00805f9b34fb' : >> 98471ac4019a46765c28d87df8c8ae71c1ae6cfe0bc9c615bc6d2c BLECLI >> Enter data read from characteristic (in hex) : << 3271f39a ==== Wifi Credentials sent successfully ==== ==== Applying config to esp32 ==== BLECLI >> Write following data to characteristic with UUID '0000ff52-0000-1000-8000-00805f9b34fb' : >> 5355 BLECLI >> Enter data read from characteristic (in hex) : << 1664db24 ==== Apply config sent successfully ==== ==== Wifi connection state ==== BLECLI >> Write following data to characteristic with UUID '0000ff52-0000-1000-8000-00805f9b34fb' : >> 290d BLECLI >> Enter data read from characteristic (in hex) : << 505f72a9f8521025c1964d7789c4d7edc56aedebd144e1b667bc7c0975757b80cc091aa9f3e95b06eaefbc30290fa1 ++++ WiFi state: connected ++++ ==== Provisioning was successful ==== ``` -------------------------------- ### Install ESP-IDF ISO-TP Component Source: https://github.com/espressif/idf-extra-components/blob/master/esp_isotp/README.md Add the ISO-TP component to your ESP-IDF project using the idf.py command. ```bash idf.py add-dependency espressif/esp_isotp ``` -------------------------------- ### Get Today's Sunset UTC Source: https://github.com/espressif/idf-extra-components/blob/master/esp_daylight/README.md Retrieves the sunset time for the current date at a specified location. ```c bool esp_daylight_get_sunset_today(const esp_daylight_location_t *location, time_t *sunset_utc); ``` -------------------------------- ### Example Output: MBR Parsing and Generation Source: https://github.com/espressif/idf-extra-components/blob/master/esp_ext_part_tables/examples/basic/README.md Log output showing the results of parsing an existing MBR and generating a new MBR from a partition list. The output will vary based on the SD card's configuration. ```log I (275) esp_ext_part_tables_example_basic: Example started I (275) esp_ext_part_tables_example_basic: Starting MBR parsing example task I (335) esp_ext_part_tables_example_basic: MBR loaded successfully I (335) esp_ext_part_tables_example_basic: MBR parsed successfully Partition 0: LBA start sector: 2048, address: 1048576, sector count: 59392000, size: 30408704000, type: FAT32 Partition 1: LBA start sector: 59394048, address: 30409752576, sector count: 62746624, size: 32126271488, type: FAT32 I (365) esp_ext_part_tables_example_basic: Starting MBR generation example task I (365) esp_ext_part_tables_example_basic: MBR generated successfully Partition 0: LBA start sector: 2048, address: 1048576, sector count: 7953, size: 4071936, type: FAT12 Partition 1: LBA start sector: 10240, address: 5242880, sector count: 10240, size: 5242880, type: FAT12 I (395) esp_ext_part_tables_example_basic: Example ended ``` -------------------------------- ### Get Today's Sunrise UTC Source: https://github.com/espressif/idf-extra-components/blob/master/esp_daylight/README.md Retrieves the sunrise time for the current date at a specified location. ```c bool esp_daylight_get_sunrise_today(const esp_daylight_location_t *location, time_t *sunrise_utc); ``` -------------------------------- ### ESP-CLI Completion and Hint Callbacks Source: https://github.com/espressif/idf-extra-components/blob/master/esp_cli/README.md Sets up callback functions for command completion and hints. These are essential for providing user assistance during command input. ```c static void example_completion_cb(const char *str, void *cb_ctx, esp_linenoise_completion_cb_t cb) { esp_cli_commands_get_completion(NULL, str, cb_ctx, cb); } static char *example_hints_cb(const char *str, int *color, int *bold) { /* return the hint of a given command */ return NULL; } static void example_free_hints_cb(void *ptr) { /* free the hint pointed at by the pointer in parameter */ } ``` -------------------------------- ### CMakeLists.txt Configuration Source: https://github.com/espressif/idf-extra-components/blob/master/onewire_bus/test_apps/CMakeLists.txt Standard CMake configuration for an ESP-IDF project. Includes project setup and component definition. ```cmake cmake_minimum_required(VERSION 3.16) include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(COMPONENTS main) project(onewire_bus_test) ``` -------------------------------- ### Provisioning with Bluetooth LE (Security Version 1) Source: https://github.com/espressif/idf-extra-components/blob/master/network_provisioning/examples/thread_prov/README.md This command is for provisioning a device over Bluetooth LE using security version 1 with proof-of-possession authentication. ```bash python esp_prov.py --transport ble --service_name PROV_F72E6B --sec_ver 1 --pop abcd1234 --dataset_tlvs ```