This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220SF-LAUNCHXL: I try for connect with aws-iot seem failed?!

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

hello

The sample code is "shadow_sample_console_echo_CC3220SF_LAUNCHXL_tirtos_ccs" that

I try it for connect with AWS iot-core. I am not sure, the connection seems to fail or succeed?! 

The  message as below:

===========================

startSNTP: Current time: Fri Mar 22 02:54:35 2019


CC32XX has connected to AP and acquired an IP address.

IP Address: 192.168.0.101

Flashing certificate file ...
Successfully wrote file ca.pem to flash

Flashing certificate file ...
Successfully wrote file cert.pem to flash

Flashing certificate file ...
Successfully wrote file key.pem to flash

Shadow Init


Shadow Connect


ERROR: runAWSClient L#83
Shadow Connection Error (-13)

===========================

aws_iot_config.h  just as below:

#define AWS_IOT_MQTT_HOST "a2qx4wxzlluw6m-ats.iot.ap-northeast-1.amazonaws.com"
#define AWS_IOT_MQTT_PORT 8883 ///< default port for MQTT/S

#define AWS_IOT_MQTT_CLIENT_ID "20190318_iot" ///< MQTT client ID should be unique for every device
#define AWS_IOT_MY_THING_NAME "20190318_iot" ///< Thing Name of the Shadow this device is associated with

#define AWS_IOT_ROOT_CA_FILENAME "/cert/ca.pem" ///< Root CA file name
#define AWS_IOT_CERTIFICATE_FILENAME "/cert/cert.pem" ///< device signed certificate file name
#define AWS_IOT_PRIVATE_KEY_FILENAME "/cert/key.pem" ///< Device private key filename

 

certs.h just as below:

this root_ca_pem is RSA 2048 bit key: Amazon Root CA 1

root_ca_pem[] ="-----BEGIN CERTIFICATE-----\
MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\
ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\
b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\
MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\
b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\
ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\
9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\
IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\
VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\
93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\
jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\
AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\
A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\
U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\
N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\
o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\
rqXRfboQnoZsG4q5WTP468SQvvG5\
-----END CERTIFICATE-----"

After creation "thing" , I get the client_cert_pem and the client_private_key_pem from AWS-iot .

I am sure the cretificate is active.

The policy  as below

 

The "thing" picture  just as below:


The monitor seems to be connected successfully.

I don't have any idea ,can someone help me for this please?

  • Hi,

    For your certificate files, please be sure that you include a newline character at the end of each line.

    Also, for the root CA cert you will need the Starfield Class 2 Certificate Authority cert. Looking at the Amazon Root CA certs provided by your endpoint server during the TLS handshake, it seems like those certs are not self-signed, but instead specify a chain of Starfield certs ending in the Starfield Class 2 Certificate Authority. Thus, that is the certificate you must flash to the CC3220 and specify as the root CA when connecting to your AWS server. Please use that Starfield cert and try connecting again.

    Regards,

    Michael

  • Hi,

    I assume that you have resolved your issue since I have not heard back from you. If not, feel free to post a response to this thread, or open a new thread regarding this issue.

    Regards,
    Michael
  • open a new thread regarding this issue.