OTA Example Not Working On ESP32 - ESP-IDF
Posted: Thu Sep 23, 2021 4:47 pm
Hello, I was running through this example (simple_ota_example) and I am having some issues:
https://github.com/espressif/esp-idf/tr ... system/ota
I followed the steps exactly as it states. I can see my local IP address is 192.168.1.8, so I used that for the "Common Name" when creating the certificate. I copy the certificate over to the "server_certs" directory, I update the "firmware upgrade url endpoint" to "https://192.168.1.8:8070/blink.bin". While in the blink build directory, I start the server with the command "openssl s_server -WWW -key ca_key.pem -cert ca_cert.pem -port 8070".
I build and flash the firmware to an ESP32, and this is the error message I get:
I'm guessing its trying multiple times which is why it tries it 4 times?
I tested the server by typing this into Internet Explorer: "https://localhost:8070/blink.bin", this works and I can download the file (it says its not secure, but I ignore this).
However, if I type in the IP Address instead of localhost, it does not work, I get an error saying "Can't reach this page". I also tried 127.0.0.1 which is typically the same as "localhost" and this also did not work.
I am assuming this is where the problem lies? I don't know. I followed the example exactly as described though.
I tried typing "netstat -a -n" in a command prompt, and I see this in the list:
And this goes away as soon as I close the server, so I think that part is working.
Any ideas what the problem might be? Thanks and any help or advice is greatly appreciated!
https://github.com/espressif/esp-idf/tr ... system/ota
I followed the steps exactly as it states. I can see my local IP address is 192.168.1.8, so I used that for the "Common Name" when creating the certificate. I copy the certificate over to the "server_certs" directory, I update the "firmware upgrade url endpoint" to "https://192.168.1.8:8070/blink.bin". While in the blink build directory, I start the server with the command "openssl s_server -WWW -key ca_key.pem -cert ca_cert.pem -port 8070".
I build and flash the firmware to an ESP32, and this is the error message I get:
Code: Select all
I (4696) simple_ota_example: Starting OTA example
W (4806) wifi:<ba-add>idx:1 (ifx:0, 9c:c9:eb:f5:fe:e3), tid:0, ssn:0, winSize:64
I (5176) esp-tls-mbedtls: Failed to verify peer certificate!
I (5176) esp-tls-mbedtls: verification info: ! The certificate is not correctly signed by the trusted CA
E (5186) esp-tls: Failed to open new connection
E (5196) TRANS_SSL: Failed to open a new connection
E (5206) HTTP_CLIENT: Connection failed, sock < 0
E (5206) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (5216) esp_https_ota: Failed to establish HTTP connection
E (5216) simple_ota_example: Firmware upgrade failed
** SKIP SOME LINES **
I (6174) simple_ota_example: Starting OTA example
W (6304) wifi:<ba-add>idx:1 (ifx:0, 9c:c9:eb:f5:fe:e3), tid:0, ssn:0, winSize:64
W (6364) wifi:<ba-add>idx:2 (ifx:0, 9c:c9:eb:f5:fe:e3), tid:1, ssn:0, winSize:64
E (6674) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (6674) esp-tls-mbedtls: Failed to verify peer certificate!
I (6674) esp-tls-mbedtls: verification info: ! The certificate is not correctly signed by the trusted CA
E (6684) esp-tls: Failed to open new connection
E (6694) TRANS_SSL: Failed to open a new connection
E (6704) HTTP_CLIENT: Connection failed, sock < 0
E (6704) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (6714) esp_https_ota: Failed to establish HTTP connection
E (6714) simple_ota_example: Firmware upgrade failed
** SKIP SOME LINES **
I (5682) simple_ota_example: Starting OTA example
W (5762) wifi:<ba-add>idx:1 (ifx:0, 9c:c9:eb:f5:fe:e3), tid:0, ssn:0, winSize:64
E (23932) esp-tls: Failed to connnect to host (errno 113)
E (23932) esp-tls: Failed to open new connection
E (23932) TRANS_SSL: Failed to open a new connection
E (23932) HTTP_CLIENT: Connection failed, sock < 0
E (23942) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (23952) esp_https_ota: Failed to establish HTTP connection
E (23952) simple_ota_example: Firmware upgrade failed
** SKIP SOME LINES **
I (6172) simple_ota_example: Starting OTA example
E (24432) esp-tls: Failed to connnect to host (errno 113)
E (24432) esp-tls: Failed to open new connection
E (24432) TRANS_SSL: Failed to open a new connection
E (24432) HTTP_CLIENT: Connection failed, sock < 0
E (24442) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (24452) esp_https_ota: Failed to establish HTTP connection
E (24452) simple_ota_example: Firmware upgrade failed
I tested the server by typing this into Internet Explorer: "https://localhost:8070/blink.bin", this works and I can download the file (it says its not secure, but I ignore this).
However, if I type in the IP Address instead of localhost, it does not work, I get an error saying "Can't reach this page". I also tried 127.0.0.1 which is typically the same as "localhost" and this also did not work.
I am assuming this is where the problem lies? I don't know. I followed the example exactly as described though.
I tried typing "netstat -a -n" in a command prompt, and I see this in the list:
Code: Select all
TCP [::]:8070 [::]:0 LISTENING
Any ideas what the problem might be? Thanks and any help or advice is greatly appreciated!