SmartThingsCommunity / st-device-sdk-c-ref

SmartThings SDK Reference for Direct Connected Devices for C
Apache License 2.0
118 stars 173 forks source link

mbedtls_x509_crt_parse returned -0x112c #150

Closed asierdanjou closed 2 months ago

asierdanjou commented 2 months ago

Hi,

I've got error -0x112c from esp-tls-mbedtls in my ota_demo example. I paste my log:

I (9433) [IoT]: _iot_net_tls_connect(418) > Loading the CA root certificate 1317@0x3fcb0a70
I (12533) [IoT]: iot_es_connect(1106) > MQTT connect success sucess/try : 1/1
I (12683) [IoT]: _check_connection_response(79) > Connection response payload {"target":"7b5ae127-1786-418b-b382-9e8e9c5ce95f","currentTime":1715015780,"event":"connect.success"}
I (12693) [IoT]: _do_iot_main_command(586) > curr_main_cmd:0, curr_main_state:5
I (12703) [IoT]: _do_state_updating(435) > current state 5, new state 6
I (12703) [IoT]: _get_device_preference(423) > Get device preference
I (12713) [IoT]: iot_cap_call_init_cb(1342) > Call init_cb for switch capability
I (12723) [IoT]: st_cap_send_attr(614) > publish event, topic : /v1/deviceEvents/7b5ae127-1786-418b-b382-9e8e9c5ce95f, payload :
{"deviceEvents":[{"component":"main","capability":"switch","attribute":"switch","value":"on","providerData":{"sequenceNumber":1,"timestamp":"1715015780710"}}]}
Sequence number return : 1
I (12753) [IoT]: iot_cap_call_init_cb(1342) > Call init_cb for voltageMeasurement capability
I (12763) [IoT]: st_cap_send_attr(614) > publish event, topic : /v1/deviceEvents/7b5ae127-1786-418b-b382-9e8e9c5ce95f, payload :
{"deviceEvents":[{"component":"main","capability":"voltageMeasurement","attribute":"voltage","value":230,"providerData":{"sequenceNumber":2,"timestamp":"1715015780748"}}]}
Sequence number return : 2
I (12793) [IoT]: iot_cap_call_init_cb(1342) > Call init_cb for firmwareUpdate capability
value is NULL
value is NULL
I (12803) [IoT]: st_cap_send_attr(614) > publish event, topic : /v1/deviceEvents/7b5ae127-1786-418b-b382-9e8e9c5ce95f, payload :
{"deviceEvents":[{"component":"main","capability":"firmwareUpdate","attribute":"currentVersion","value":"switch_asier_001","providerData":{"sequenceNumber":3,"timestamp":"1715015780789"}}]}
Sequence number return : 3
value is NULL
value is NULL
value is NULL
status: 8, stat: 2
I (12833) [IoT]: _do_state_updating(573) > Call usr status_cb with 0x208
I (12953) [IoT]: _iot_parse_noti_data(650) > payload : {"target":"7b5ae127-1786-418b-b382-9e8e9c5ce95f","values":{},"event":"device.preferences"}
I (12953) [IoT]: _iot_parse_noti_data(749) > No references
I (12963) [IoT]: iot_noti_sub_cb(829) > Ignore notification
E (32473) esp-tls-mbedtls: mbedtls_x509_crt_parse returned -0x112c
E (32473) esp-tls-mbedtls: Failed to set client configurations
E (32483) esp-tls: create_ssl_handle failed
E (32483) esp-tls: Failed to open new connection
E (32493) TRANS_SSL: Failed to open a new connection
E (32493) HTTP_CLIENT: Connection failed, sock < 0
Failed to open HTTP connection: 28674
....

What is the meaning of this error code?

Thank you, Asier.

junyoun-kim commented 2 months ago

Hello, did you create and replace certificate files?(Please refer this section). You may need to read OTA demo document before testing it.

asierdanjou commented 2 months ago

Hello @junyoun-kim, Yes, the certificate files were replaced. We fixed our problem by deleting the entire "build" folder and building our project again. Thanks for your time, Asier.