Page 1 of 2
cant accept path in ota example
Posted: Mon Oct 29, 2018 1:35 pm
by burkulesomesh43
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.
Re: cant accept path in ota example
Posted: Mon Oct 29, 2018 8:39 pm
by fly135
"
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
Re: cant accept path in ota example
Posted: Thu Nov 01, 2018 5:35 am
by burkulesomesh43
Problem solved. I used dns_gethostbyname() api in my code and passes "example.com" to it. it returns ip address.
Re: cant accept path in ota example
Posted: Thu Nov 01, 2018 5:05 pm
by fly135
OK, so it appears that you are not using the latest esp_https_ota code in the IDF.
John A
Re: cant accept path in ota example
Posted: Thu Nov 08, 2018 10:03 am
by k.ifantidis
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.
Re: cant accept path in ota example
Posted: Thu Nov 08, 2018 10:51 am
by chegewara
If i remember this message means that you have turned off https in menuconfig->ESP http client.
Re: cant accept path in ota example
Posted: Thu Nov 08, 2018 3:54 pm
by fly135
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
Re: cant accept path in ota example
Posted: Fri Nov 09, 2018 8:07 am
by k.ifantidis
Thank you for your answer John.
Best regards, Kostas.
Re: cant accept path in ota example
Posted: Wed Nov 14, 2018 8:42 am
by burkulesomesh43
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.
Re: cant accept path in ota example
Posted: Wed Nov 14, 2018 12:16 pm
by k.ifantidis
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.