OTA Update with HTTPS problem.

kd.spide
Posts: 4
Joined: Thu May 03, 2018 7:39 am

OTA Update with HTTPS problem.

Postby kd.spide » Thu Jun 21, 2018 5:51 am

Hi,
I am planning to make ota update using https for esp32. So, my setup is like it connects to my secure Mqtt broker. OTA is triggering in particular topic.
I am using ESP-IDF and this example https://github.com/espressif/esp-idf/tr ... ystem/ota.
I have changed the connectivity part to https referring to https_request example https://github.com/espressif/esp-idf/tr ... ps_request.The connectivity is successful. But after that get request is having error

Code: Select all

I (20485) ota: Connected to AP
I (21685) ota: Connection established...
I (21685) ota: Connected to http server 
E (21685) ota: Send GET request to server failed 
E (21685) ota: Exiting task due to fatal error...
How can i further get data and set that data to OTA update?

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA Update with HTTPS problem.

Postby chegewara » Thu Jun 21, 2018 7:52 pm

My suggestion is to setup your esp32 to ota from local network and if it works test with curl if you can get access ota file on external address. My first OTA app issue was missing slash:
https://github.com/espressif/esp-idf/is ... -345897991

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: OTA Update with HTTPS problem.

Postby fly135 » Thu Jun 21, 2018 11:56 pm

Ima just throwing this out. When I originally tried to do https to a server (wasn't OTA) I had the same problem. Seems like I did two things and it started working. The one I remember was changing HTTP/1.0 to HTTP/1.1

The other was.. ummm not sure I did anything else. If this sounds vague and silly, well yeah. But if you change that 0 to a 1 and it works I'd like to hear about it.

Your probably wondering why I didn't try and backtrack to verify. I think I was getting tired of looking at that problem. Maybe I will. But we're in a rush to get some stuff done, so I'll probably remember the next time someone else posts this problem. But the title could be better worded because it has nothing to with OTA itself.

John A

Daniel
Posts: 28
Joined: Tue Jan 09, 2018 12:55 pm

Re: OTA Update with HTTPS problem.

Postby Daniel » Fri Jun 22, 2018 12:01 am


kd.spide
Posts: 4
Joined: Thu May 03, 2018 7:39 am

Re: OTA Update with HTTPS problem.

Postby kd.spide » Fri Jun 22, 2018 5:40 am

chegewara wrote:My suggestion is to setup your esp32 to ota from local network and if it works test with curl if you can get access ota file on external address. My first OTA app issue was missing slash:
https://github.com/espressif/esp-idf/is ... -345897991
I have tested it with http. It is working fine. so no issue in connectivity and also i have tried to access it with different machine in network.

kd.spide
Posts: 4
Joined: Thu May 03, 2018 7:39 am

Re: OTA Update with HTTPS problem.

Postby kd.spide » Fri Jun 22, 2018 10:18 am

fly135 wrote:Ima just throwing this out. When I originally tried to do https to a server (wasn't OTA) I had the same problem. Seems like I did two things and it started working. The one I remember was changing HTTP/1.0 to HTTP/1.1

The other was.. ummm not sure I did anything else. If this sounds vague and silly, well yeah. But if you change that 0 to a 1 and it works I'd like to hear about it.

Your probably wondering why I didn't try and backtrack to verify. I think I was getting tired of looking at that problem. Maybe I will. But we're in a rush to get some stuff done, so I'll probably remember the next time someone else posts this problem. But the title could be better worded because it has nothing to with OTA itself.

John A
It actually worked. 1.1 was the fix. Now OTA is working. Is it possible to add client cert and key along with CA certificate also in https?

sarapatel
Posts: 11
Joined: Mon Feb 17, 2020 6:07 am

Re: OTA Update with HTTPS problem.

Postby sarapatel » Fri May 01, 2020 7:33 am

Hi can anyone please help me with how should I test the existing OTA example via HTTPS? I tried to use the command " openssl req -x509 -newkey rsa:2048 -keyout ca_key.pem -out ca_cert.pem -days 365 -nodes" its saying 'openssl' is not recognized as an internal or external command,operable program or batch file. and when I use winpty then also the same error it shows.So can anyone guide me ?

sarapatel
Posts: 11
Joined: Mon Feb 17, 2020 6:07 am

Re: OTA Update with HTTPS problem.

Postby sarapatel » Fri May 01, 2020 11:18 am

Hi, I am getting the following error :
simple_ota_example: Starting OTA example
E (34447) esp-tls: Failed to connnect to host (errno 113)
E (34447) esp-tls: Failed to open new connection
E (34447) TRANS_SSL: Failed to open a new connection
E (34447) HTTP_CLIENT: Connection failed, sock < 0
E (34457) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (34457) esp_https_ota: Failed to establish HTTP connection
E (34467) simple_ota_example: Firmware upgrade failed

how should I move forward? please guide.

Who is online

Users browsing this forum: Bing [Bot] and 119 guests