ok-home 52ce8d5710 .
2023-10-06 18:45:51 +07:00
2023-10-05 20:13:29 +07:00
2023-09-26 19:48:52 +07:00
2023-09-26 13:44:12 +07:00
2023-10-05 20:13:29 +07:00
...
2023-10-04 23:17:00 +07:00
.
2023-10-06 18:45:51 +07:00
2023-10-03 21:19:46 +07:00
2023-10-03 21:19:46 +07:00
2023-09-28 08:34:13 +07:00
2023-09-28 08:34:13 +07:00

Ru

| Supported Targets |

ESP32 ESP32S3 ESP32C3

ESP32 OTA update via websocket with a simple WEB interface

  • Connects as a component to your program
  • Uses websocket protocol
  • Connects to any web server on esp32 that uses the websocket protocol, for example (esp-idf examples/protocols/http_server/ws_echo_server)
  • Example - example_ota_ws
  • Web interface
    • Select firmware file
    • Upload firmware to esp32
    • Firmware download control
    • After updating the firmware - confirm the update or roll back to the previous version
  • Select OTA page URI in menuconfig
  • The update is downloaded in fragments, the size of the download fragment is in menuconfig
  • Connection example
#include "ota_ws_update.h" // handler definition

// start webserver from esp-idf "examples/protocols/http_server/ws_echo_server"
static httpd_handle_t start_webserver(void)
{
    httpd_handle_t server = NULL;
    httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    // Start the httpd server
    ESP_LOGI(TAG, "Starting server on port: '%d'", config.server_port);
    if (httpd_start(&server, &config) == ESP_OK) {
        ESP_LOGI(TAG, "Registering URI handlers");
    /****************** Registering the ws handler ****************/
        ota_ws_register_uri_handler(server);
        // end register ota_ws handler
        return server;
    }
    ESP_LOGI(TAG, "Error starting server!");
    return NULL;
}
  • Example partitions.csv
# Name,   Type, SubType,  Offset,   Size,  Flags
nvs,      data, nvs,      0x9000,  0x4000
otadata,  data, ota,      ,  0x2000
phy_init, data, phy,      ,  0x1000
ota_0,    app,  ota_0,    ,  1M
ota_1,    app,  ota_1,    ,  1M
  • menuconfig options
    • CONFIG_PARTITION_TABLE_CUSTOM=y
    • CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
    • CONFIG_HTTPD_WS_SUPPORT=y
    • CONFIG_APP_ROLLBACK_ENABLE=y
Description
ESP32 OTA update via WebSocket with a simple WEB interface. Optional PreEncrypted mode.
Readme 188 KiB
Languages
C 63%
HTML 30.1%
Python 3.5%
CMake 3.4%