Hi everyone,
I'm very happy to tell you that I can update the program through Amazon S3, but I know it is imperfect, so I share it and let everyone to make it better. It updates the program through OTA .This is a program linkhttps://github.com/DanielXie00/https-ota-esp32-aws. I hope anyone can provide some advices . It works very well .
Thank you.
Best Wishes.
Daniel.
There is the source code which update code by Amazon S3(OTA).
Re: There is the source code which update code by Amazon S3(OTA).
Cool! I modified the same example app using SSL functions. I'm not really sure how this all works exactly. Do you need to use a certificate? Or is that just an additional level of security? Maybe I should be using TLS instead of SSL.
John A
John A
Re: There is the source code which update code by Amazon S3(OTA).
Yes ,it needs a certificate.Here is the certificate. https://github.com/DanielXie00/https-ot ... t_cert.pem You should replace the certificate with your own.fly135 wrote:Cool! I modified the same example app using SSL functions. I'm not really sure how this all works exactly. Do you need to use a certificate? Or is that just an additional level of security? Maybe I should be using TLS instead of SSL.
John A
Actually , first,it saves the file to the buff by using mbedtls_ssl_read(&ssl, (unsigned char *)buf, TEXT_BUFFSIZE); ,and then copy to ota_write_data, finnally, check it and reboot .
Code: Select all
memset(buf, 0, TEXT_BUFFSIZE);
memset(ota_write_data, 0, BUFFSIZE);
len = sizeof(buf) - 1;
bzero(buf, sizeof(buf));
ret = mbedtls_ssl_read(&ssl, (unsigned char *)buf, TEXT_BUFFSIZE);
if(ret>0)
{
if(!resp_body_start)
{
memcpy(ota_write_data, buf, ret);
resp_body_start = read_past_http_header(buf, ret, update_handle);
ESP_LOGI(TAG, "read_past_http_header");
}
else
{
memcpy(ota_write_data, buf,ret);
err = esp_ota_write( update_handle, (unsigned char *)ota_write_data, ret);
ESP_LOGI(TAG, "ota_write_data");
}
continue;
}
Best wishes. Daniel
Re: There is the source code which update code by Amazon S3(OTA).
Hi,
Thanks for the code and its working well for me. But just before OTA updation is shows
W (230766) example: Failed to verify peer certificate!
W (230766) example: verification info: ! The certificate is not correctly signed by the trusted CA
I have changed the certificate , does this mean there is some problem with it ??
Thanks for the code and its working well for me. But just before OTA updation is shows
W (230766) example: Failed to verify peer certificate!
W (230766) example: verification info: ! The certificate is not correctly signed by the trusted CA
I have changed the certificate , does this mean there is some problem with it ??
Who is online
Users browsing this forum: No registered users and 114 guests