[Solved] Is there a way to perform OTA sourcing github url?

aaronw83
Posts: 3
Joined: Fri Jun 24, 2022 12:17 am

[Solved] Is there a way to perform OTA sourcing github url?

Postby aaronw83 » Fri Jun 24, 2022 1:02 am

Really struggling to figure out how to modify the existing espressif OTA examples to point the url to a github repo for direct download of a binary for firmware update.

What I'm trying to do is trigger the esp32 (over ble) to download a firmware binary file from github over wifi for OTA update.
I don't have any issue sending ble commands or connecting to wifi. My issue is I'm not able to successfully connect to github and download the binary file.

I'm trying to start from the advanced_https_ota_example project (I've also tried to modify from the simple version) provided by espressif and modify the url to github --> https://raw.githubusercontent.com/<user ... _world.bin

Here is the error I'm getting:
I (5632) advanced_https_ota_example: Starting Advanced OTA example
E (5732) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (5732) esp-tls-mbedtls: Failed to verify peer certificate!
E (5742) esp-tls: Failed to open new connection
E (5742) TRANSPORT_BASE: Failed to open a new connection
E (5752) HTTP_CLIENT: Connection failed, sock < 0
E (5752) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (5762) esp_https_ota: Failed to establish HTTP connection
E (5772) advanced_https_ota_example: ESP HTTPS OTA Begin failed
I've also updating menuconfig to check "allow potentially insecure options" under ESP-TLS but this doesn't help...

Striking out left and right searching for an answer on this one. Seems it would be incredibly useful for many folks on deployed / public projects to have as a reference.

I'm sure I'm missing something stupid simple here but I'm not experience in CA's. Let me know if anyone has an ideas. Thanks!

ESP_Mahavir
Posts: 188
Joined: Wed Jan 24, 2018 6:51 am

Re: Is there a way to perform OTA sourcing github url?

Postby ESP_Mahavir » Fri Jun 24, 2022 5:58 am

Hello,

1. If you use our latest simple_ota_example from https://github.com/espressif/esp-idf/bl ... _example.c then just replacing URL to GH one should work. This example uses our certificate bundle feature and hence no additional certificates should be required. We have already tested this example with different URLs like GitHub, AWS S3, GDrive etc.

2. Alternatively you may find instructions at https://github.com/espressif/esp-idf/tr ... tps-server helpful in retrieving correct certificate that needs to be embedded in the example.

3. Please refer to detailed blog post at https://blog.espressif.com/ota-updates- ... 5438e30c12. This blog also has an example repository which uses GH URL for OTA updates.

Hope this helps!

aaronw83
Posts: 3
Joined: Fri Jun 24, 2022 12:17 am

Re: Is there a way to perform OTA sourcing github url?

Postby aaronw83 » Sat Jun 25, 2022 12:34 am

Very helpful! Thank you my problem is now resolved!

Who is online

Users browsing this forum: Bing [Bot], HighVoltage, icyTwist and 122 guests