6 years, 4 months ago.

Project Mbed-to-AWS-IoT on DISCO_L475VG_IOT01A

Hi I am trying Mbed-to-AWS-IoT project which is imported from https://os.mbed.com/users/coisme/notebook/aws-iot-from-mbed-os-device/

on the board DISCO_L475VG_IOT01A, I am using AWS IoT Cloud

Opening network interface...

[EasyConnect] IPv4 mode [EasyConnect] Using WiFi (ISM43362) [EasyConnect] Connecting to WiFi "xxxxxxxxxxxxx" [EasyConnect] Security NONE [EasyConnect] Connected to Network successfully [EasyConnect] MAC address C4:7F:51:8C:67:2C [EasyConnect] IP address 255.255.248.0 Network interface opened successfully.

Connecting to host XXXXXXXXXXXXXXX.iot.ap-south-1.amazonaws.com:8883 ...

ERROR: rc from TCP connect is -16

Can some one help me please,

1 Answer

6 years, 4 months ago.

If you change the value of mbed-trace.enable to 1 and tls-socket.debug-level to 1 in mbed_app.json, you'll get detail message. Could you try it and check messages?

Accepted Answer

Thanks for the info, I will try and let you know. I wanted to one thing Why it is printing netmask as Ip address.

posted by raghavan p 05 Jul 2018

Details of the log as below *********** HelloMQTT: version is 0.80

Opening network interface...

[EasyConnect] IPv4 mode [EasyConnect] Using WiFi (ISM43362) [EasyConnect] Connecting to WiFi xxxxxxxxxxxxxxxx [EasyConnect] Security NONE [EasyConnect] Connected to Network successfully [EasyConnect] MAC address C4:7F:51:8C:67:2D [EasyConnect] IP address 255.255.248.0 Network interface opened successfully.

Connecting to host xxxxxxxxxxxx.iot.ap-south-1.amazonaws.com:8883 ...

[INFO][TLSx]: Connecting to xxxxxxxxxxxxxx.iot.ap-south-1.amazonaws.com:8883

[INFO][TLSx]: Connected.

[INFO][TLSx]: Starting the TLS handshake...

[DBG ][TLSx]: Verifying certificate at depth 2:

[DBG ][TLSx]: cert. version : 3 serial number : 06:6C:9F:CF:99:BF:8C:0A:39:E2:F0:78:8A:43:E6:96:36:5B:CA issuer name : C=US, O=Amazon, CN=Amazon Root CA 1 subject name : C=US, O=Amazon, CN=Amazon Root CA 1 issued on : 2015-05-26 00:00:00 expires on : 2038-01-17 00:00:00 signed using : RSA with SHA-256 RSA key size : 2048 bits basic constraints : CA=true key usage : Digital Signature, Key Cert Sign, CRL Sign

[INFO][TLSx]: No verification issue for this certificate

[DBG ][TLSx]: Verifying certificate at depth 1:

[DBG ][TLSx]: cert. version : 3 serial number : 06:7F:94:57:85:87:E8:AC:77:DE:B2:53:32:5B:BC:99:8B:56:0D issuer name : C=US, O=Amazon, CN=Amazon Root CA 1 subject name : C=US, O=Amazon, OU=Server CA 1B, CN=Amazon issued on : 2015-10-22 00:00:00 expires on : 2025-10-19 00:00:00 signed using : RSA with SHA-256 RSA key size : 2048 bits basic constraints : CA=true, max_pathlen=0 key usage : Digital Signature, Key Cert Sign, CRL Sign

[INFO][TLSx]: No verification issue for this certificate

[DBG ][TLSx]: Verifying certificate at depth 0:

[DBG ][TLSx]: cert. version : 3 serial number : 03:EE:79:46:5A:12:ED:E7:06:CE:AF:6D:07:88:C7:6B issuer name : C=US, O=Amazon, OU=Server CA 1B, CN=Amazon subject name : CN=*.iot.ap-south-1.amazonaws.com issued on : 2018-04-11 00:00:00 expires on : 2019-04-11 12:00:00 signed using : RSA with SHA-256 RSA key size : 2048 bits basic constraints : CA=false subject alt name : iot.ap-south-1.amazonaws.com, *.iot.ap-south-1.amazonaws.com key usage : Digital Signature, Key Encipherment ext key usage : TLS Web Server Authentication, TLS Web Client Authentication

[INFO][TLSx]: No verification issue for this certificate

[DBG ][TLSx]: ssl_cli.c:2893: |1| mbedtls_ecdh_make_public() returned -16 (-0x0010)

[ERR ][TLSx]: mbedtls_ssl_handshake() failed: -0x0010 (-16): BIG ERROR: rc from TCP connect is -16

posted by raghavan p 05 Jul 2018

I'm trying on the same board and got the same error.
[DBG ][TLSx]: ssl_cli.c:3240: |1| mbedtls_pk_sign() returned -17168 (-0x4310)
It may run out of memory according to this issue
https://github.com/espressif/esp-idf/issues/1750 When I tried building this project offline with GCC compiler, the application didn't launch because of no memory.

posted by Osamu Koizumi 05 Jul 2018

Sorry, I checked your error message. It seems that your error is different from mine. I succeeded to connect to AWS using DISCO_L475VG_IOT01A. What I did is change stack size get more memory area. I changed stack size from 8092 to 4096 by modifying the parameter main-stack-size in mbed_app.json.

Your error may relate to memory.

https://github.com/espressif/esp-idf/issues/1695

https://github.com/espressif/esp-idf/issues/346

posted by Osamu Koizumi 05 Jul 2018