|
| | CORE |
| | The ecosystem engine. Provides framework initialization, Wi-Fi configuration, network profile management, and system lifecycle hooks.
|
| |
| | CORE Extension |
| | Low-level API exposing NVS storage, FreeRTOS task management, IP event handlers, and internal configuration queries for creating nodes.
|
| |
| | CORE Macros |
| | Preprocessor utilities for standardized logging, sequential error checking, and task spawning.
|
| |
| | Kconfig |
| | CORE Kconfig configuration options.
|
| |
esp_iot_framework_core v0.2.1
A meta-framework for building reliable, node-based IoT frameworks on Espressif Systems devices
esp32 • esp32s2 • esp32s3 • esp32c2 • esp32c3 • esp32c6
esp_iot_framework_core is the core component of the framework that handles low-level device infrastructure boilerplate. It ensures the device connects to the network automatically, stores data securely, and runs stably without crashing. It is designed for building network nodes rather than standalone end devices (though the latter is technically possible but not recommended).
Key Features
- Initializes Wi-Fi in STA mode, handles network events, and cycles through saved profiles to restore connection during failures.
- Provides an abstraction layer over NVS to reliably store Wi-Fi configurations, TLS certificates, and Basic Auth credentials.
- Generates ECC keys (
secp256r1 curve) and X.509 certificates with SAN extensions directly on the device, automatically saving them to NVS.
- Fully manages the mDNS subsystem lifecycle from initialization and HTTP/HTTPS service registration to resource cleanup.
- Includes a set of handy macros that simplify logging, debugging, and error handling.
- Periodically checks heap fragmentation and triggers a preventive auto-reboot if memory degradation hits a critical threshold.
- Log capture layer that hooks into the ESP-IDF logging system, buffers all runtime logs into a ring buffer, and exposes them for any Node to fetch and transmit to the outside world.
For an in-depth look, check out the documentation.
Usage for creating nodes
Configure your project's main CMakeLists.txt like this (replace <TEXT> with the desired values, without the <>s themselves):
set(COMPONENT_NAME <COMPONENT_NAME>)
idf_component_register(
SRCS <SOURCE_FILES>
INCLUDE_DIRS <PUBLIC_INCLUDE_DIRS>
PRIV_INCLUDE_DIRS <PRIVATE_INCLUDE_DIRS>
PRIV_REQUIRES <DEPENDENCIES> esp_iot_framework_core
EMBED_FILES <FILES_TO_EMBED>
)
# Required for logging macros
set(comp_target "__idf_${COMPONENT_NAME}")
target_compile_options(${comp_target} PRIVATE "-fmacro-prefix-map=${CMAKE_CURRENT_LIST_DIR}=.")
In the destination device, you will need to specify the path to the component. You can do this using one of the following methods:
- (Recommended) Add the following code to the root
CMakeLists.txt: cmake_minimum_required(VERSION 3.16)
# Necessary for correct operation
list(APPEND SDKCONFIG_DEFAULTS "<PATH_TO_FRAMEWORK>/components/esp_iot_framework_core/sdkconfig.defaults")
list(APPEND EXTRA_COMPONENT_DIRS "<PATH_TO_FRAMEWORK>/components")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(hello_world_test)
- Add the following code to
idf_component.yml or integrate it into an existing one: dependencies:
esp_iot_framework_core:
path: "<PATH_TO_FRAMEWORK>/components/esp_iot_framework_core"
- Alternatively, add the framework as a Git submodule inside your project's
components directory. This approach requires no configuration and is ideal for tightly integrated projects.