esp_iot_framework  v0.1.0-alpha
© 2026 AmakeSasha, distributed under a license Apache-2.0
Core Entry

Base initialization and framework-wide settings. More...

Functions

esp_err_t eif_core_initialize (void)
 Initializes the CORE of the framework. More...
 
esp_err_t eif_nvs_initialize (void)
 Initialize Non-Volatile Storage (NVS) and framework data. More...
 

Detailed Description

This module contains functions that must be called at the very beginning of the application to prepare internal data structures and system tasks.

Function Documentation

◆ eif_core_initialize()

esp_err_t eif_core_initialize ( void  )

Sets up the internal configuration, prepares the web server settings, and launches essential system services.

Note
This function must be called before any other eif_* functions (like URI registration or Wi-Fi connectivity). This function is mandatory for the framework to work.
Warning
Calling this function overwrites any parameters previously set via eif_* API with default values.
Returns
  • ESP_OK: CORE initialization was successful.
  • ESP_ERR_NO_MEM: This error cannot be returned, because the system automatically restarts due to the lack of a heap, even when the memory scanner is running.

Example of use:

#include <esp_err.h>
#include <esp_iot_framework_core.h>
void app_main(void) {
ESP_ERROR_CHECK(eif_core_initialize());
// Further code...
}
esp_err_t eif_core_initialize(void)
Initializes the CORE of the framework.

◆ eif_nvs_initialize()

esp_err_t eif_nvs_initialize ( void  )

This function performs the following essential steps:

  • Initializes the NVS flash partition (with automatic repair/erase if corrupted).
  • Prepares or loads Wi-Fi profiles based on the configured count.
  • Manages TLS credentials and authentication data (if enabled).
Note
This function must be called after eif_core_initialize() but before eif_wifi_initialize(). This function is mandatory for the framework to work. If you use eif_set_wifi_profiles_count(), it must be called before calling eif_nvs_initialize(). Otherwise, the default number of profiles **(2)** will be loaded into NVS.
Warning
If the NVS partition is corrupted or has a new version, this function will automatically erase it and re-initialize, which results in the loss of previously stored data.
Returns
  • ESP_OK: NVS and all framework fields initialized successfully.
  • ESP_ERR_*: Various NVS-related errors if hardware initialization fails. Look at the logs to understand the cause of the errors.

Example of use:

#include <esp_err.h>
#include <esp_iot_framework_core.h>
void app_main(void) {
ESP_ERROR_CHECK(eif_core_initialize());
ESP_ERROR_CHECK(eif_nvs_initialize());
// Further code...
}
esp_err_t eif_nvs_initialize(void)
Initialize Non-Volatile Storage (NVS) and framework data.