Dhananjay Sutariya
Dhananjay Sutariya

Reputation: 109

How can i ota my application via internet on esp32?

I'm trying to run the demo code of esp 32 for native ota update which works just fine for local server ota update,i want to know which internet servers are providing free platform for ota update.

I've tried native sample code which works fine.

Upvotes: 0

Views: 1662

Answers (1)

EGibson
EGibson

Reputation: 477

When performing an OTA update on the ESP32, all you're really doing is sending a GET request to whatever server that you're pointing the OTA client config struct to. In the simple_ota_example from the IDF examples directory, you have:

 esp_http_client_config_t config = {
    .url = CONFIG_FIRMWARE_UPGRADE_URL,
    .cert_pem = (char *)server_cert_pem_start,
    .event_handler = _http_event_handler,
};

The example value they give for CONFIG_GIRMWARE_UPGRADE_URL here is https://192.168.0.3:8070/hello-world.bin.

You could, for example, use Amazon Web Services to host your firmware files, like I do. Then you just change 192.168.0.3 to the IP address (or host name) of the AWS Server you're using. Change 8070 to the port that the server is setup to use. Then change hello-world.bin to /path/to/your/firmware.bin. You'll also need to change the embedded CA Root Cert in the firmware to use Amazon's (or that of whatever hosting service that you're using).

A lot of hosting services have free tiers, which if you're only testing OTA updates or using them infrequently may work you. I believe Amazon has a free tier, possibly Google as well.

If you're planning on using this for a production device that customers are using, you're going to have to pay for hosting most likely. You'll have to take many more aspects such as security and scaleability into account.

Upvotes: 3

Related Questions