cant accept path in ota example

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

cant accept path in ota example

Postby burkulesomesh43 » Mon Oct 29, 2018 1:35 pm

Hi,
I am trying to use ota example. in path of ota example if I give path like "example.com:2233/take/ota.bin", it cant connect to server.
please help me out for the problem.
--
Somesh Burkule

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

Re: cant accept path in ota example

Postby fly135 » Mon Oct 29, 2018 8:39 pm

"https://example.com:2233/take/ota.bin"

If you are using esp_https_ota, then you need "https" and a certificate. Or you can comment out the checks and use http.

John A

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: cant accept path in ota example

Postby burkulesomesh43 » Thu Nov 01, 2018 5:35 am

fly135 wrote:"https://example.com:2233/take/ota.bin"

If you are using esp_https_ota, then you need "https" and a certificate. Or you can comment out the checks and use http.

John A
Problem solved. I used dns_gethostbyname() api in my code and passes "example.com" to it. it returns ip address.
--
Somesh Burkule

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

Re: cant accept path in ota example

Postby fly135 » Thu Nov 01, 2018 5:05 pm

OK, so it appears that you are not using the latest esp_https_ota code in the IDF.

John A

k.ifantidis
Posts: 33
Joined: Wed Mar 28, 2018 6:58 am

Re: cant accept path in ota example

Postby k.ifantidis » Thu Nov 08, 2018 10:03 am

"https://example.com:2233/take/ota.bin"

If you are using esp_https_ota, then you need "https" and a certificate. Or you can comment out the checks and use http.

John A
Good morning I would like to know how to turn off the check of servers certifications. I'm using ESP-WROVER-KIT v3 eval board**
I've tryied to NULL .cert_pem value in cfg struct or comment out the .cert_pem line.

Code: Select all

esp_http_client_config_t config = {
        .url = CONFIG_FIRMWARE_UPGRADE_URL,
        //.cert_pem = NULL, //(char *)server_cert_pem_start,
        .event_handler = _http_event_handler,
};
But non of this worked out. I'm getting this error (attached picture).
I believe if I turn off the certification check I will be able to use the esp_https_ota command from an http connection.

The url that I'm trying to connect is: http://www.go-on.gr/scripts/updates/hello-world.bin

Regards, Kostas.
Attachments
https_cert_problem.png
https_cert_problem.png (5.15 KiB) Viewed 10936 times

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

Re: cant accept path in ota example

Postby chegewara » Thu Nov 08, 2018 10:51 am

If i remember this message means that you have turned off https in menuconfig->ESP http client.

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

Re: cant accept path in ota example

Postby fly135 » Thu Nov 08, 2018 3:54 pm

In $IDF_PATH/components/esp_https_ota/src/esp_https_ota.c, function esp_https_ota...

Code: Select all

    if (!config->cert_pem) {
        ESP_LOGE(TAG, "Server certificate not found in esp_http_client config");
        return ESP_FAIL;
    }
and for HTTP instead of HTTPS....

Code: Select all

    if (esp_http_client_get_transport_type(client) != HTTP_TRANSPORT_OVER_SSL) {
        ESP_LOGE(TAG, "Transport is not over HTTPS");
        return ESP_FAIL;
    }
Comment out the "return ESP_FAIL;"

John A

k.ifantidis
Posts: 33
Joined: Wed Mar 28, 2018 6:58 am

Re: cant accept path in ota example

Postby k.ifantidis » Fri Nov 09, 2018 8:07 am

Thank you for your answer John.

Best regards, Kostas.

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: cant accept path in ota example

Postby burkulesomesh43 » Wed Nov 14, 2018 8:42 am

fly135 wrote:
Thu Nov 01, 2018 5:05 pm
OK, so it appears that you are not using the latest esp_https_ota code in the IDF.

John A
hi,
I am using dns_gethostbyname() api to resolve IP. but it takes too much time to get ip.
what will be the problem.
--
Somesh Burkule

k.ifantidis
Posts: 33
Joined: Wed Mar 28, 2018 6:58 am

Re: cant accept path in ota example

Postby k.ifantidis » Wed Nov 14, 2018 12:16 pm

Hello burkulesomesh43.

I think there is no need to use "dns_gethostbyname() api to resolve IP" . I'm using directly the url of the path and I have success in downloading the OTA just fine. For example .url= "https://example.com/take/ota.bin"
If CA cert pem files and all other stuff are ok, I don't think that you will anticipate any problem.

Regards, Kostas.

Who is online

Users browsing this forum: No registered users and 197 guests