ota via http and using ESP32 as AP instead of as STA
Posted: Mon Jan 16, 2023 1:35 pm
Hello,
I need to write a program, which is able to update the firmware of ESP32-S3 wirelessly, without having access to Internet.
I googled and found the example project about OTA:
- OTA: https://github.com/espressif/esp-idf/tr ... system/ota
But this project seems to use the ESP32 as an HTTP client, connecting to a server running on a computer, and both the ESP32 and the computer being connected to the same network created by a router acting as AP. For the firmware update, I won't have access to Internet via a router, hence I will need to set the ESP32 as AP and then connect with my PC to the ESP32-created network.
For using ESP32 as AP, I found the following example project:
- WiFI as AP: https://github.com/espressif/esp-idf/tr ... ted/softAP
and for using ESP32 as HTTP server I found the following example project:
- HTTP server: https://github.com/espressif/esp-idf/tr ... ver/simple
The idea I have to solve my task was to try to combine code from the above 3 example projects in order to use the ESP32 as AP instead of as STA, run an HTTP server on ESP32, use a computer as HTTP client to connect to the ESP32 server, and from the computer browser to upload the new firmware file to the ESP32 server, and then try to copy the new firmware from the buffer to the flash partition.
As I don't have experience with OTA at all and less experience with ESP32, I wanted to first ask if the above idea is possible at all or there exists a simpler way to accomplish the OTA. If there is no simpler method, how can I use the OTA code with ESP32 being an HTTP server instead of HTTP client ?
Thanks in advance
I need to write a program, which is able to update the firmware of ESP32-S3 wirelessly, without having access to Internet.
I googled and found the example project about OTA:
- OTA: https://github.com/espressif/esp-idf/tr ... system/ota
But this project seems to use the ESP32 as an HTTP client, connecting to a server running on a computer, and both the ESP32 and the computer being connected to the same network created by a router acting as AP. For the firmware update, I won't have access to Internet via a router, hence I will need to set the ESP32 as AP and then connect with my PC to the ESP32-created network.
For using ESP32 as AP, I found the following example project:
- WiFI as AP: https://github.com/espressif/esp-idf/tr ... ted/softAP
and for using ESP32 as HTTP server I found the following example project:
- HTTP server: https://github.com/espressif/esp-idf/tr ... ver/simple
The idea I have to solve my task was to try to combine code from the above 3 example projects in order to use the ESP32 as AP instead of as STA, run an HTTP server on ESP32, use a computer as HTTP client to connect to the ESP32 server, and from the computer browser to upload the new firmware file to the ESP32 server, and then try to copy the new firmware from the buffer to the flash partition.
As I don't have experience with OTA at all and less experience with ESP32, I wanted to first ask if the above idea is possible at all or there exists a simpler way to accomplish the OTA. If there is no simpler method, how can I use the OTA code with ESP32 being an HTTP server instead of HTTP client ?
Thanks in advance