|
esp_iot_framework
v0.1.0-alpha
© 2026 AmakeSasha, distributed under a license Apache-2.0
|
Device REST API documentation.
The esp_iot_framework_device provides a comprehensive REST API and static files for device management and monitoring. All API endpoints are prefixed with /_/ and support JSON format for requests and responses.
When Kconfig option CONFIG_EIF_ENABLE_BASIC_AUTH is enabled, all administrative endpoints (all endpoints listed in MAP URIs) require HTTP Basic Authentication.
To authenticate, include the following HTTP header in each of your requests:
<base64_encoded_credentials> above with your Base64-encoded admin:<your_password>. <your_password> set via web interface or API (default: empty string). Example of use:
/_/files - only if the Kconfig option CONFIG_EIF_ENABLE_WEB_ADMIN_GUI is enabled/index.html - Main interface container/network.html - Network management page/system.html - System management page/style.css - Stylesheet/api.js - JavaScript API library/json2.js - JSON utility library/license.txt - License information/wifi/list.json - List Wi-Fi profiles/update.do - Update Wi-Fi profile/clear.do - Clear Wi-Fi profile/check.do - Wi-Fi network availability test/result.json - Get the results of the Wi-Fi test/tls - only if the Kconfig option CONFIG_EIF_ENABLE_TLS is enabled/recreate.do - Regenerate TLS keys and certificate/sys/info.json - Get system information/reboot.do - Reboot system/ota/info.json - Get firmware information/update.do - Upload firmware/confirm.do - Confirm successful update/rollback.do - Rollback firmware/apass - only if the Kconfig option CONFIG_EIF_ENABLE_BASIC_AUTH is enabled/update.do - Update administrator password200 OK - Successful GET request202 Accepted - Action accepted and processing204 No Content - Successful POST400 Bad Request - Invalid request parameters401 Unauthorized - Authentication required/failed404 Not Found - Resource not found409 Conflict - Resource conflict (e.g., OTA already in progress)500 Internal Server Error - Server errorList Wi-Fi profiles
Returns all configured Wi-Fi profiles and current connection status.
Request body: No body
Response body:
Fields:
current_profile_index: Currently active profile (0 - X, is set using eif_set_wifi_profiles_count(), otherwise it is EIF_WIFI_PROFILES_DEFAULT_COUNT)rssi_now_profile: RSSI of current connection in dBmprofiles: Array of Wi-Fi profilesssid: Network SSID (empty if not configured)password: Password (only for profile 0)Update Wi-Fi profile
Update the values of the existing profile
Request body:
Fields:
profile_index: Profile number (1 - X, is set using eif_set_wifi_profiles_count(), otherwise it is EIF_WIFI_PROFILES_DEFAULT_COUNT, profile 0 cannot be changed)ssid: Network SSID (EIF_WIFI_SSID_MIN_LEN - EIF_WIFI_SSID_MAX_LEN - 1 characters)password: Network password (EIF_WIFI_PASS_MIN_LEN - EIF_WIFI_PASS_MAX_LEN - 1 characters)Response: HTTP 204 No Content
Clear Wi-Fi profile
Clear profile fields with empty values
Request Body:
Fields:
profile_index: Profile number (Profile number (1 - X, is set using eif_set_wifi_profiles_count(), otherwise it is EIF_WIFI_PROFILES_DEFAULT_COUNT), profile #0 cannot be changed)Response: HTTP 204 No Content
Wi-Fi network availability test
Checking the availability of a Wi-Fi network using profile
Request Body:
Fields:
profile_index: Profile number (0 - X, is set using eif_set_wifi_profiles_count(), otherwise it is EIF_WIFI_PROFILES_DEFAULT_COUNT)Response: HTTP 202 Accepted
Get the results of the Wi-Fi test
POST is due to the fact that Internet Explorer 8 does not support sending a GET request with a body. Get the results of the Wi-Fi network availability test
Request Body:
Fields:
profile_index: Profile number (0 - X, is set using eif_set_wifi_profiles_count(), otherwise it is EIF_WIFI_PROFILES_DEFAULT_COUNT)Response body:
Fields:
result: true if a connection was established and an IP address was obtained, false otherwiserssi: Signal strength in dBmCONFIG_EIF_ENABLE_TLS is enabled. Regenerate TLS keys and certificate
Generates a new self-signed TLS certificate and keys
Request Body: No body
Response: HTTP 202 Accepted
Get system information
Returns detailed system information.
Request body: No body
Response body:
Fields:
features: Object containing supported hardware featureshas_wifi: true if Wi-Fi (802.11 b/g/n) is supportedhas_bluetooth: true if Bluetooth Classic is supportedhas_ble: true if Bluetooth Low Energy (BLE) is supportedheap_free: Current free heap in bytesheap_min: Minimum free heap since bootlargest_block: Largest contiguous free memory block in heapuptime: System uptime in secondscores: Number of CPU coreschip_rev: Chip revisionflash_size: Flash size in MBcpu_freq: CPU frequency in MHzchip_model: ESP chip modelreset_reason: Last reset reason codemac: Device MAC addressReboot System
Gracefully reboot the device.
Request body: No body
Response: HTTP 202 Accepted
Get firmware information
Returns current firmware information.
Request body: No body
Response body:
Fields:
project: Project nameversion: Firmware versionbuild_id: SHA256 of ELF filebuild_date: Build datebuild_time: Build timeidf_version: ESP-IDF versioncompiler: Compiler versiontarget: Target chippartition: Current running partitionota_status: OTA status. Possible values: | Status | Description |
|---|---|
new | Firmware uploaded, not booted yet. |
pending_verify | First boot. Waiting for confirm.do. |
valid | Firmware confirmed and stable. |
invalid | Firmware failed checks. |
aborted | Update interrupted. |
factory | Running factory partition. |
Upload firmware
Uploads a new firmware binary to the device. Once the upload is complete and verified, the device will automatically reboot to apply the update.
Request:
Content-Type: application/octet-stream.bin file)Response: HTTP 202 Accepted
Confirm successful update
Marks the current firmware as valid to prevent automatic rollback on the next boot.
Request body: No body
Response: HTTP 202 Accepted
Rollback firmware
Rolls back to the previous firmware version. The device will automatically reboot.
Request body: No body
Response: HTTP 202 Accepted
CONFIG_EIF_ENABLE_BASIC_AUTH is enabled. Update administrator password
Changes the administrator password used for Basic Authentication.
Request body:
Fields:
password: New password (EIF_BASIC_AUTH_PASS_MIN_LEN - EIF_BASIC_AUTH_PASS_MAX_LEN - 1 characters)Response: HTTP 204 No Content