ESP32 OTA Example pem file.

gyaneshsingh77
Posts: 1
Joined: Tue Sep 25, 2018 1:51 pm

ESP32 OTA Example pem file.

Postby gyaneshsingh77 » Sat Sep 29, 2018 6:45 am

Hello All,
I am new to TLS topic. I am trying to integrate OTA example given in esp-idf (https://github.com/espressif/esp-idf/tr ... system/ota). I found following variable names declared as Extern.

extern const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start");
extern const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end");

on compilation I am getting error undeclared / undefined variable which is obvious.
I guess that these variables are declared in some other file or generated by script using .pem file as input. But the flow of generation I am not able to understand.

I have also generated ca_cert.pem and ce_key.pem file successfully as directed in the readme section.
It would be helpful if someone can help me to resolve the issue.

Thanks in advance
Gyanesh

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

Re: ESP32 OTA Example pem file.

Postby chegewara » Sun Sep 30, 2018 5:18 am


francescofcf
Posts: 10
Joined: Wed Sep 05, 2018 8:02 am

Re: ESP32 OTA Example pem file.

Postby francescofcf » Mon Oct 01, 2018 6:44 am

Generate self-signed certificate and key:
openssl req -x509 -newkey rsa:2048 -keyout ca_key.pem -out ca_cert.pem -days 365

when ask you the Common Name type your host-name
after Copy the generate certificate to server_certs directory inside OTA example directory.
read the workflow.

GyaneshSingh
Posts: 1
Joined: Wed Dec 06, 2017 11:54 am

Re: ESP32 OTA Example pem file.

Postby GyaneshSingh » Wed Oct 24, 2018 8:16 am

Thanks to All,

The problem is resolved now. Problem was that I was trying to integrate pem file with esp-idf version 2.x which is not updated to take care of pem file binary integration. I cloned updated idf and its compiled successfully.

Thanks again.
Gyanesh

Fiskelin
Posts: 10
Joined: Wed Oct 03, 2018 7:09 am

Re: ESP32 OTA Example pem file.

Postby Fiskelin » Thu Oct 25, 2018 11:34 am

I am using esp-idf-v3.1 but still get this error. Please help

Fiskelin
Posts: 10
Joined: Wed Oct 03, 2018 7:09 am

Re: ESP32 OTA Example pem file.

Postby Fiskelin » Thu Oct 25, 2018 11:56 am

I integrate the OTA function to my firmware and following error occur during compilation. Please help
media/sf_ESP32/esp/simple_wifi/build/main/libmain.a(simple_wifi.o):(.literal.UserOTA+0xc): undefined reference to `_binary_ca_cert_pem_start'

LudoDr
Posts: 2
Joined: Fri Feb 09, 2018 8:14 am

Re: ESP32 OTA Example pem file.

Postby LudoDr » Tue Jan 08, 2019 12:39 pm

I had the same problem, solved it by adding the following line in component.mk
COMPONENT_EMBED_TXTFILES := ${PROJECT_PATH}/server_certs/ca_cert.pem

om3gaki113r
Posts: 2
Joined: Thu Feb 20, 2020 10:43 am

Re: ESP32 OTA Example pem file.

Postby om3gaki113r » Thu Feb 20, 2020 10:45 am

i had to add below line to the CMakeLists file as well

set(COMPONENT_EMBED_TXTFILES ${PROJECT_PATH}/server_certs/ca_cert.pem)

Who is online

Users browsing this forum: No registered users and 327 guests