An esp8266/esp32 websocket OTA library.
Warning: This project is not yet ready for production, API and document are subject to change without notice.
Support device
corsacOTA works with esp-idf.
Just add src/corsacOTA.c to your project:
co_handle_t handle;
co_config_t config = {
.thread_name = "corsacOTA",
.stack_size = 4096,
.thread_prio = 8,
.listen_port = 3241,
.max_listen_num = 4,
.wait_timeout_sec = 60,
.wait_timeout_usec = 0,
};
corsacOTA_init(&handle, &config);
Related examples of use can be found here: examples
corsacOTA provides a default frontend for performing online OTA, and you can also implement it yourself. See: corsacOTA API on postman
Currently supported OTA partition table modes: Factory app, two OTA definitions.
Ease of use, minimal dependencies, and fine-grained OTA management were the starting points for this project.
Why do we use websockets in our projects?
In the world of browser, the use of websockets is somewhere between pure sockets and HTTP. Considering that most of the usage scenarios are in the browser, we have chosen websocket.
However, WebSocket is not always a good idea because operations such as handshake and mask add a certain level of complexity. If the network is good, then other solutions should achieve the same results.
Nevertheless, it has some advantages in complex network conditions with frequent packet loss, where you can achieve easy flow control and more precise progress control in the browser.
Overall, our solution is a compromise between ease of use, compatibility and speed.
For the main part of the project, there are no dependencies on third-party libraries other than esp-idf.
For frontend:
Credits to the following project, people and organizations: