### Copy Hello World Example Project (Windows) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/windows-start-project This command copies the 'hello_world' example project from the ESP-IDF installation directory to a user-defined location in Windows. It assumes the ESP-IDF path is set and creates a new directory for the project. ```batch cd %userprofile%\esp xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world ``` -------------------------------- ### Copy hello_world Project Example (Shell) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-start-project This command copies the 'hello_world' example project from the ESP-IDF installation directory to the user's home directory. It assumes the IDF_PATH environment variable is set correctly. This is a prerequisite for building and flashing the example. ```shell cd ~/esp cp -r $IDF_PATH/examples/get-started/hello_world . ``` -------------------------------- ### Copy ESP-IDF Example Project (Bash) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup This command copies the 'hello_world' example project from the ESP-IDF installation directory to the ~/esp directory. This is a preparatory step before building and flashing your first ESP32 project. Note that spaces in paths are not supported by the ESP-IDF build system. ```shell cd ~/esp cp -r $IDF_PATH/examples/get-started/hello_world . ``` -------------------------------- ### Configure, Install, and Start TWAI Driver Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/peripherals/twai Demonstrates the basic setup of the TWAI driver, including its installation and startup. It uses macro initializers for configuration structures and the `twai_driver_install()` and `twai_start()` functions. This is suitable for a single TWAI instance. ```c #include "driver/gpio.h" #include "driver/twai.h" void app_main() { // Initialize configuration structures using macro initializers twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_21, GPIO_NUM_22, TWAI_MODE_NORMAL); twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS(); twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); // Install TWAI driver if (twai_driver_install(&g_config, &t_config, &f_config) == ESP_OK) { printf("Driver installed\n"); } else { printf("Failed to install driver\n"); return; } // Start TWAI driver if (twai_start() == ESP_OK) { printf("Driver started\n"); } else { printf("Failed to start driver\n"); return; } ... } ``` -------------------------------- ### Navigate to NimBLE_Beacon Example Directory Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-guides/ble/get-started/ble-device-discovery This command allows you to navigate to the NimBLE_Beacon example directory within your local ESP-IDF installation. Replace '' with the actual path to your ESP-IDF folder. ```bash cd /examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon ``` -------------------------------- ### Install Prerequisites for Ubuntu/Debian Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs necessary packages for ESP-IDF development on Ubuntu and Debian-based Linux distributions. This includes tools like git, wget, python3, cmake, ninja-build, and development libraries. ```bash sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 ``` -------------------------------- ### Install Prerequisites for Arch Linux Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs essential packages for ESP-IDF development on Arch Linux. This command ensures that gcc, git, make, python, cmake, ninja, and other build tools are installed or updated. ```bash sudo pacman -S --needed gcc git make flex bison gperf python cmake ninja ccache dfu-util libusb ``` -------------------------------- ### Install ESP-IDF Tools for All Targets (Bash) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs ESP-IDF tools for all supported chip targets using the 'install.sh' script. This command should be run from the ESP-IDF directory. ```shell cd ~\/esp\/esp-idf ./install.sh all ``` -------------------------------- ### Application Example Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/system/log A practical example demonstrating the usage of the logging library in an ESP-IDF application. ```APIDOC ## Application Example This section presents a concrete example showcasing the implementation and usage of the ESP-IDF Logging library within a sample application. ### Description Illustrates logging library usage with a code example. ### Endpoint N/A (Documentation Section) ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Full OpenOCD Build Script for ESP32 Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-guides/jtag-debugging/building-openocd-windows This comprehensive script combines all the necessary steps for building OpenOCD for ESP32, including package installation (pacman), source cloning, dependency downloading and extraction, environment variable setup, configuration, compilation, and copying of DLLs. It also includes commented-out commands for optional installation. ```bash pacman -S --noconfirm --needed autoconf automake git make mingw-w64-i686-gcc mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-pkg-config mingw-w64-cross-winpthreads-git p7zip cd ~/ esp git clone --recursive https://github.com/espressif/openocd-esp32.git wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z 7z x -olibusb ./libusb-1.0.22.7z export CPPFLAGS="$CPPFLAGS -I${PWD}/libusb/include/libusb-1.0"; export LDFLAGS="$LDFLAGS -L${PWD}/libusb/MinGW32/.libs/dll" export CPPFLAGS="$CPPFLAGS -D__USE_MINGW_ANSI_STDIO=1 -Wno-error"; export CFLAGS="$CFLAGS -Wno-error" cd ~/ esp/openocd-esp32 ./bootstrap ./configure --disable-doxygen-pdf --enable-ftdi --enable-jlink --enable-ulink --build=i686-w64-mingw32 --host=i686-w64-mingw32 make cp ../libusb/MinGW32/dll/libusb-1.0.dll ./src cp /opt/i686-w64-mingw32/bin/libwinpthread-1.dll ./src # # optional # export DESTDIR="$PWD" # make install # cp ./src/libusb-1.0.dll $DESTDIR/mingw32/bin # cp ./src/libwinpthread-1.dll $DESTDIR/mingw32/bin ``` -------------------------------- ### Install Python 3.8 with MacPorts Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs Python 3.8 using the MacPorts package manager. This is an alternative method for installing Python on macOS. ```shell sudo port install python38 ``` -------------------------------- ### Install QEMU Binaries with IDF Tools Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-guides/tools/qemu Installs pre-built QEMU binaries for Xtensa and RISC-V architectures using the `idf_tools.py` script. This command simplifies the QEMU setup process. ```shell python $IDF_PATH/tools/idf_tools.py install qemu-xtensa qemu-riscv32 ``` -------------------------------- ### Install Python 3 with HomeBrew Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs Python 3 using the HomeBrew package manager. This is a common method for installing software on macOS. ```shell brew install python3 ``` -------------------------------- ### Navigate to ESP-IDF Example Project Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-guides/ble/get-started/ble-connection This command navigates the user to the local directory of the NimBLE_Connection example within the ESP-IDF framework. It requires the user to replace '' with their actual ESP-IDF installation path. No specific inputs or outputs are generated by this command, it's purely for directory navigation. ```shell cd /examples/bluetooth/ble_get_started/nimble/NimBLE_Connection ``` -------------------------------- ### Check Python 3 Installation Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Verifies if Python 3 is installed on the system. An error indicates that Python 3 is not present and needs to be installed. ```shell python3 --version ``` -------------------------------- ### Application Examples Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/protocols/esp_crt_bundle Links to example projects demonstrating the use of the certificate bundle. ```APIDOC ## Application Examples * [protocols/https_x509_bundle](https://github.com/espressif/esp-idf/tree/v5.4.1/examples/protocols/https_x509_bundle) demonstrates how to use ESP-TLS to establish a secure socket connection using the certificate bundle with two custom certificates added for verification. * [protocols/https_request](https://github.com/espressif/esp-idf/tree/v5.4.1/examples/protocols/https_request) demonstrates an HTTPS example that uses ESP-TLS and the default bundle. * [protocols/https_mbedtls](https://github.com/espressif/esp-idf/tree/v5.4.1/examples/protocols/https_mbedtls) demonstrates an HTTPS example that uses Mbed TLS and the default bundle. ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs the necessary Xcode command line tools on macOS, which are often required for development tasks including ESP-IDF setup. This command resolves 'xcrun: error: invalid active developer path' issues. ```bash xcode-select --install ``` -------------------------------- ### Application Examples Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/peripherals/ledc Links to application examples demonstrating the usage of the LEDC peripheral. ```APIDOC ## Application Examples * **`peripherals/ledc/ledc_basic`**: Demonstrates how to use the LEDC to generate a PWM signal in LOW SPEED mode. * Link: [https://github.com/espressif/esp-idf/tree/v5.4.1/examples/peripherals/ledc/ledc_basic](https://github.com/espressif/esp-idf/tree/v5.4.1/examples/peripherals/ledc/ledc_basic) * **`peripherals/ledc/ledc_fade`**: Demonstrates how to control the intensity of LEDs using the LEDC fade functionality. * Link: [https://github.com/espressif/esp-idf/tree/v5.4.1/examples/peripherals/ledc/ledc_fade](https://github.com/espressif/esp-idf/tree/v5.4.1/examples/peripherals/ledc/ledc_fade) ``` -------------------------------- ### Build All ESP-IDF Documentation Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/contribute/documenting-code Navigate to the 'docs' folder and execute this command to build the entire ESP-IDF documentation. This process requires the `esp-docs` package to be installed. ```bash build-docs build ``` -------------------------------- ### Install Prerequisites for CentOS 7 & 8 Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs required software packages for ESP-IDF development on CentOS 7 and 8. This command updates the system and installs tools such as git, wget, python3, cmake, and ninja-build. ```bash sudo yum -y update && sudo yum install git wget flex bison gperf python3 cmake ninja-build ccache dfu-util libusbx ``` -------------------------------- ### Navigate to NimBLE GATT Server Example Directory Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-guides/ble/get-started/ble-introduction Navigate to the directory of the NimBLE GATT Server example for ESP-IDF. This command assumes you have the ESP-IDF path set up correctly. ```bash cd /examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server ``` -------------------------------- ### Configure ESP32 Project with idf.py Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-start-project These commands are used to navigate to the project directory, set the target ESP32 chip, and launch the project configuration utility. Ensure ESP-IDF is sourced correctly before running these commands. The `set-target` command initializes or resets the project configuration for the specified chip. ```shell cd ~/esp/hello_world idf.py set-target esp32 idf.py menuconfig ``` -------------------------------- ### Check Python Version Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Checks the currently installed default Python version. This helps determine if Python 2.7 is the default and if Python 3 needs to be installed. ```shell python --version ``` -------------------------------- ### Initialize and Start MQTT Client with Broker URI - C Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/protocols/mqtt Initializes and starts an MQTT client using a specified broker URI. This configuration relies on the esp_mqtt_client_config_t structure and assumes the use of the event loop library for handling MQTT events. The snippet demonstrates basic client setup and event registration. ```c const esp_mqtt_client_config_t mqtt_cfg = { .broker.address.uri = "mqtt://mqtt.eclipseprojects.io", }; esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg); esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client); esp_mqtt_client_start(client); ``` -------------------------------- ### Install ESP-IDF with CI and Pytest Requirements Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/contribute/esp-idf-tests-with-pytest Command to install ESP-IDF along with additional Python requirements for Continuous Integration (CI) and pytest. This setup is necessary for running tests locally and for CI pipelines. ```bash $ cd $IDF_PATH $ bash install.sh --enable-ci --enable-pytest $ . ./export.sh ``` -------------------------------- ### ESP AVRC CT Cover Art Get Image Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/bluetooth/esp_avrc Starts the process to get an image from the Cover Art server. This API is available only when the AVRC Cover Art feature is enabled. ```APIDOC ## esp_avrc_ct_cover_art_get_image ### Description Starts the process to get image from Cover Art server. This API can be used only when AVRC Cover Art feature is enabled. ### Method POST ### Endpoint /api/esp-idf/v5.4.1/esp32/avrc/cover-art/image ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **image_handle** (string) - Required - Pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes. - **image_descriptor** (string) - Required - Pointer to image descriptor. - **image_descriptor_len** (integer) - Required - The length of the image descriptor. ### Request Example ```json { "image_handle": "string", "image_descriptor": "string", "image_descriptor_len": 1024 } ``` ### Response #### Success Response (200) - **esp_err_t** (integer) - ESP_OK on success #### Response Example ```json { "status": "success", "result": 0 } ``` #### Error Responses - **ESP_ERR_INVALID_STATE** (integer) - Bluetooth stack not enabled or AVRC CT not initialized. - **ESP_ERR_NOT_SUPPORTED** (integer) - Peer device does not support Cover Art function. ``` -------------------------------- ### Install ESP-IDF Tools (Bash) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs the necessary ESP-IDF tools (compiler, debugger, etc.) for the ESP32 target using the 'install.sh' script. This command should be run from the ESP-IDF directory. ```shell cd ~\/esp\/esp-idf ./install.sh esp32 ``` -------------------------------- ### Start Provisioning Service with C Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/provisioning/wifi_provisioning Initiates the provisioning service. This function requires specifying the security scheme, a proof of possession (pop), the service name, and the service key. Security scheme 1 uses encrypted communication, while security scheme 0 uses plain text. It utilizes the protocomm library internally. ```c const char *service_name = "my_device"; const char *service_key = "password"; wifi_prov_security_t security = WIFI_PROV_SECURITY_1; const char *pop = "abcd1234"; ESP_ERROR_CHECK( wifi_prov_mgr_start_provisioning(security, pop, service_name, service_key) ); ``` -------------------------------- ### MQTT Client Start Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/protocols/mqtt Starts the MQTT client, initiating connection to the broker using the configured settings. ```APIDOC ## esp_mqtt_client_start ### Description Starts the MQTT client with an already created client handle. This function establishes the connection to the MQTT broker. ### Method `esp_mqtt_client_start` ### Parameters #### Path Parameters - **client** (esp_mqtt_client_handle_t) - MQTT client handle. ### Return Value - `ESP_OK` - on success. - `ESP_ERR_INVALID_ARG` - on wrong initialization. - `ESP_FAIL` - on other errors. ``` -------------------------------- ### Install ESP-IDF Tools for All Targets (Fish Shell) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs ESP-IDF tools for all supported chip targets using the 'install.fish' script for the Fish shell. This command should be run from the ESP-IDF directory. ```shell cd ~\/esp\/esp-idf ./install.fish all ``` -------------------------------- ### Configure and Start Protocomm Instance with HTTP Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/provisioning/protocomm This function initializes and starts a protocomm instance over HTTP. It configures the HTTP server, sets up security parameters using protocomm_security1, and adds an echo request endpoint with associated private data. The function returns a pointer to the created protocomm instance. ```c /* The example function for launching a protocomm instance over HTTP. */ protocomm_t *start_pc(const char *pop_string) { protocomm_t *pc = protocomm_new(); /* Config for protocomm_httpd_start(). */ protocomm_httpd_config_t pc_config = { .data = { .config = PROTOCOMM_HTTPD_DEFAULT_CONFIG() } }; /* Start the protocomm server on top of HTTP. */ protocomm_httpd_start(pc, &pc_config); /* Create security1 params object from pop_string. It must be valid throughout the scope of protocomm endpoint. This need not be static, i.e., could be dynamically allocated and freed at the time of endpoint removal. */ const static protocomm_security1_params_t sec1_params = { .data = (const uint8_t *) strdup(pop_string), .len = strlen(pop_string) }; /* Set security for communication at the application level. Just like for request handlers, setting security creates an endpoint and registers the handler provided by protocomm_security1. One can similarly use protocomm_security0. Only one type of security can be set for a protocomm instance at a time. */ protocomm_set_security(pc, "security_endpoint", &protocomm_security1, &sec1_params); /* Private data passed to the endpoint must be valid throughout the scope of protocomm endpoint. This need not be static, i.e., could be dynamically allocated and freed at the time of endpoint removal. */ static uint32_t priv_data = 1234; /* Add a new endpoint for the protocomm instance identified by a unique name, and register a handler function along with the private data to be passed at the time of handler execution. Multiple endpoints can be added as long as they are identified by unique names. */ protocomm_add_endpoint(pc, "echo_req_endpoint", echo_req_handler, (void *) &priv_data); return pc; } ``` -------------------------------- ### Install ESP-IDF Tools for Multiple Targets (Bash) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs ESP-IDF tools for multiple chip targets, such as ESP32 and ESP32-S2, using the 'install.sh' script. This command should be run from the ESP-IDF directory. ```shell cd ~\/esp\/esp-idf ./install.sh esp32,esp32s2 ``` -------------------------------- ### Start Provisioning Service Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/provisioning/wifi_provisioning Starts the provisioning service using the configured scheme. Supports various security protocols (WIFI_PROV_SECURITY_0, WIFI_PROV_SECURITY_1, WIFI_PROV_SECURITY_2). Emits WIFI_PROV_START upon successful start. ```APIDOC ## POST /wifi_prov_mgr_start_provisioning ### Description Starts the provisioning service according to the scheme configured at the time of initialization. For scheme wifi_prov_scheme_ble, this starts protocomm_ble. For scheme wifi_prov_scheme_softap, this activates SoftAP mode and starts protocomm_httpd. The event WIFI_PROV_START is emitted right after provisioning starts without failure. This API will start provisioning service even if the device is found to be already provisioned. ### Method POST ### Endpoint /wifi_prov_mgr_start_provisioning ### Parameters #### Request Body - **security** (wifi_prov_security_t) - Required - Specifies the protocomm security scheme to use (WIFI_PROV_SECURITY_0, WIFI_PROV_SECURITY_1, or WIFI_PROV_SECURITY_2). - **wifi_prov_sec_params** (const void *) - Optional - Pointer to security parameters (NULL if not needed). Structure type depends on the 'security' parameter. - **service_name** (const char *) - Required - Unique name of the service (Wi-Fi SSID for SoftAP, Device name for BLE). - **service_key** (const char *) - Optional - Key required by the client to access the service (Wi-Fi password for SoftAP, ignored for BLE). ### Request Example ```json { "security": "WIFI_PROV_SECURITY_1", "wifi_prov_sec_params": { "preshared_key": "mysecretkey" }, "service_name": "MyESPDevice", "service_key": "mypassword" } ``` ### Response #### Success Response (200) - **esp_err_t** - ESP_OK: Provisioning service started successfully. #### Error Response - **esp_err_t** - Other values indicate specific errors during startup (e.g., invalid arguments, transport issues). #### Response Example ```json { "status": "ESP_OK" } ``` ``` -------------------------------- ### Install ccache on macOS via MacPorts Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs the ccache compiler cache utility on macOS using MacPorts. ccache is recommended for faster build times by caching compilation results. ```bash sudo port install ccache ``` -------------------------------- ### Install ccache on macOS via HomeBrew Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs the ccache compiler cache utility on macOS using HomeBrew. ccache significantly speeds up recompilation by caching previously compiled objects. ```bash brew install ccache ``` -------------------------------- ### ESP AVRC CT Cover Art Get Linked Thumbnail Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/bluetooth/esp_avrc Starts the process to get a linked thumbnail from the Cover Art server. This API is available only when the AVRC Cover Art feature is enabled. ```APIDOC ## esp_avrc_ct_cover_art_get_linked_thumbnail ### Description Starts the process to get linked thumbnail from Cover Art server. This API can be used only when AVRC Cover Art feature is enabled. ### Method POST ### Endpoint /api/esp-idf/v5.4.1/esp32/avrc/cover-art/linked-thumbnail ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "image_handle": "string" } ``` ### Response #### Success Response (200) - **esp_err_t** (integer) - ESP_OK on success #### Response Example ```json { "status": "success", "result": 0 } ``` #### Error Responses - **ESP_ERR_INVALID_STATE** (integer) - Bluetooth stack not enabled or AVRC CT not initialized. - **ESP_ERR_NOT_SUPPORTED** (integer) - Peer device does not support Cover Art function. ``` -------------------------------- ### Provisioning Tools Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/provisioning/wifi_provisioning Provides links to provisioning applications for Android, iOS, and a command-line tool for desktop platforms. Includes source code repositories. ```APIDOC ## Provisioning Tools Provisioning applications are available for various platforms, along with source code: * **Android:** * Bluetooth LE Provisioning app on Play Store: [https://play.google.com/store/apps/details?id=com.espressif.provble](https://play.google.com/store/apps/details?id=com.espressif.provble) * SoftAP Provisioning app on Play Store: [https://play.google.com/store/apps/details?id=com.espressif.provsoftap](https://play.google.com/store/apps/details?id=com.espressif.provsoftap) * Source code on GitHub: [esp-idf-provisioning-android](https://github.com/espressif/esp-idf-provisioning-android) * **iOS:** * Bluetooth LE Provisioning app on App Store: [https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141](https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141) * SoftAP Provisioning app on App Store: [https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630](https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630) * Source code on GitHub: [esp-idf-provisioning-ios](https://github.com/espressif/esp-idf-provisioning-ios) * **Linux/MacOS/Windows:** * Command-line tool: [tools/esp_prov](https://github.com/espressif/esp-idf/tree/v5.4.1/tools/esp_prov) The phone applications offer a simple UI and are thus more user-centric, while the command-line application is useful as a debugging tool for developers. ``` -------------------------------- ### ESP AVRC CT Cover Art Get Image Properties Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/bluetooth/esp_avrc Starts the process to get image properties from the Cover Art server. This API is available only when the AVRC Cover Art feature is enabled. ```APIDOC ## esp_avrc_ct_cover_art_get_image_properties ### Description Starts the process to get image properties from the Cover Art server. This API can be used only when AVRC Cover Art feature is enabled. ### Method POST ### Endpoint /api/esp-idf/v5.4.1/esp32/avrc/cover-art/image-properties ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "image_handle": "string" } ``` ### Response #### Success Response (200) - **esp_err_t** (integer) - ESP_OK on success #### Response Example ```json { "status": "success", "result": 0 } ``` #### Error Responses - **ESP_ERR_INVALID_STATE** (integer) - Bluetooth stack not enabled or AVRC CT not initialized. - **ESP_ERR_NOT_SUPPORTED** (integer) - Peer device does not support Cover Art function. ``` -------------------------------- ### Initialize LwIP, Wi-Fi, and Register Event Handlers - C Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/network/esp-wifi-mesh This snippet demonstrates the essential prerequisite steps for setting up an ESP-WIFI-MESH application. It includes initializing the LwIP network interface, creating a default event loop, initializing Wi-Fi with default configuration, registering a handler for IP events (specifically when the station gets an IP address), setting Wi-Fi storage to flash, and starting the Wi-Fi driver. This setup is crucial before ESP-WIFI-MESH itself can be initialized. ```c ESP_ERROR_CHECK(esp_netif_init()); /* event initialization */ ESP_ERROR_CHECK(esp_event_loop_create_default()); /* Wi-Fi initialization */ wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&config)); /* register IP events handler */ ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &ip_event_handler, NULL)); ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_FLASH)); ESP_ERROR_CHECK(esp_wifi_start()); ``` -------------------------------- ### TWAI Driver Installation Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/peripherals/twai Functions for installing and initializing the TWAI driver. ```APIDOC ## POST /twai/install ### Description Installs the TWAI driver with general, timing, and filter configurations. Allocates memory and stops the driver. ### Method POST ### Endpoint /twai/install ### Parameters #### Request Body - **g_config** (twai_general_config_t) - Required - General configuration structure. - **t_config** (twai_timing_config_t) - Required - Timing configuration structure. - **f_config** (twai_filter_config_t) - Required - Filter configuration structure. ### Request Example ```json { "g_config": { "mode": "TWAI_MODE_NORMAL", "direction": "TWAI_DIR_MODE_INPUT_OUTPUT", "clk_speed": 1000000, "tx_io": 5, "rx_io": 4, "sda_io": -1, "scl_io": -1, "intr_alloc_flags": 0, "gpio_pullup_en": false, "gpio_pullup_en_scl": false, "clkout_divider": 0, "flags": 0 }, "t_config": { "tseg1": 3, "tseg2": 0, "bitrate": 1000000, "brp": 1, "sync_jump_width": 0 }, "f_config": { "sdev_qty": 0, "list_qty": 0, "f_mode": "TWAI_FILTER_MODE_ACCEPT_ALL", "elems": [] } } ``` ### Response #### Success Response (200) - **esp_err** (esp_err_t) - ESP_OK on successful installation. #### Response Example ```json { "esp_err": 0 } ``` #### Error Responses - **ESP_ERR_INVALID_ARG**: Invalid arguments provided. - **ESP_ERR_NO_MEM**: Insufficient memory available. - **ESP_ERR_INVALID_STATE**: Driver is already installed. ``` ```APIDOC ## POST /twai/install_v2 ### Description Installs the TWAI driver and returns a handle, allowing for multiple TWAI driver instances. ### Method POST ### Endpoint /twai/install_v2 ### Parameters #### Request Body - **g_config** (twai_general_config_t) - Required - General configuration structure. Ensure `controller_id` is set correctly. - **t_config** (twai_timing_config_t) - Required - Timing configuration structure. - **f_config** (twai_filter_config_t) - Required - Filter configuration structure. ### Request Example ```json { "g_config": { "mode": "TWAI_MODE_NORMAL", "direction": "TWAI_DIR_MODE_INPUT_OUTPUT", "clk_speed": 1000000, "tx_io": 5, "rx_io": 4, "sda_io": -1, "scl_io": -1, "intr_alloc_flags": 0, "gpio_pullup_en": false, "gpio_pullup_en_scl": false, "clkout_divider": 0, "flags": 0, "controller_id": 0 }, "t_config": { "tseg1": 3, "tseg2": 0, "bitrate": 1000000, "brp": 1, "sync_jump_width": 0 }, "f_config": { "sdev_qty": 0, "list_qty": 0, "f_mode": "TWAI_FILTER_MODE_ACCEPT_ALL", "elems": [] } } ``` ### Response #### Success Response (200) - **esp_err** (esp_err_t) - ESP_OK on successful installation. - **twai_handle** (twai_handle_t) - A handle to the newly created TWAI driver instance. #### Response Example ```json { "esp_err": 0, "twai_handle": "0x12345678" } ``` #### Error Responses - **ESP_ERR_INVALID_ARG**: Invalid arguments provided (e.g., invalid controller ID). - **ESP_ERR_NO_MEM**: Insufficient memory available. - **ESP_ERR_INVALID_STATE**: Driver is already installed. ``` -------------------------------- ### Install CMake, Ninja, and dfu-util on macOS via MacPorts Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup Installs CMake, Ninja build system, and dfu-util on macOS using the MacPorts package manager. These are necessary components for ESP-IDF development. ```bash sudo port install cmake ninja dfu-util ``` -------------------------------- ### TWAI Driver Start Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/api-reference/peripherals/twai Starts the TWAI driver, enabling communication. ```APIDOC ## POST /twai/start ### Description Starts the TWAI driver, enabling it to send and receive messages. ### Method POST ### Endpoint /twai/start ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **esp_err** (esp_err_t) - ESP_OK on successful start. #### Response Example ```json { "esp_err": 0 } ``` #### Error Responses - **ESP_ERR_INVALID_STATE**: Driver is not installed or not in a state to be started. ``` -------------------------------- ### Enable Documentation Build in install.sh Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/contribute/documenting-code This command enables the installation of the `esp-docs` Python package, which is a wrapper around Sphinx and is required for building ESP-IDF documentation. Ensure you have Doxygen installed and your build tools are set up. ```bash ./install.sh --enable-docs ``` -------------------------------- ### Customize ESP-IDF Tools Installation Path (Bash) Source: https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32/get-started/linux-macos-setup This snippet demonstrates how to change the default installation directory for ESP-IDF compilation tools. It involves exporting the IDF_TOOLS_PATH environment variable before running the installation and export scripts. Ensure the chosen path has read/write permissions for the user. ```shell export IDF_TOOLS_PATH="$HOME/required_idf_tools_path" ./install.sh . ./export.sh ```