0

I am trying to establish a connection from Amazon Web Service IoT (Internet of Things) to my Arduino Yun. I followed a tutorial about sending and receiving messages using "BasicPubSub" Arduino example, but it would say:

Failed to Connect!
-13

And this means "CONNECT_CREDENTIAL_NOT_FOUND". I have the correct credentials and information in the header file and also have the correct files, which are: xxx-certificate.pem.crt, xxx-private.pem.key, and root_certificate.pem in a directory, "/root/certs/", when I SSH into the Arduino Yun. The following is my header file:

#ifndef config_usr_h
#define config_usr_h

// Copy and paste your configuration into this file
//===============================================================
#define AWS_IOT_MQTT_HOST "xxx.iot.us-east-1.amazonaws.com" // endpoint
#define AWS_IOT_MQTT_PORT 8883
#define AWS_IOT_CLIENT_ID "client_id"   // client ID
#define AWS_IOT_MY_THING_NAME "thing_name"  // thing name
#define AWS_IOT_ROOT_CA_FILENAME "root_certificate.pem" // root-CA filename
#define AWS_IOT_CERTIFICATE_FILENAME "xxx-certificate.pem.crt"                 // your certificate filename
#define AWS_IOT_PRIVATE_KEY_FILENAME "xxx-private.pem.key" // private key
//===============================================================
// SDK config, DO NOT modify it
#define AWS_IOT_PATH_PREFIX "../certs/"
#define AWS_IOT_ROOT_CA_PATH AWS_IOT_PATH_PREFIX AWS_IOT_ROOT_CA_FILENAME           // use this in config call
#define AWS_IOT_CERTIFICATE_PATH AWS_IOT_PATH_PREFIX AWS_IOT_CERTIFICATE_FILENAME   // use this in config call
#define AWS_IOT_PRIVATE_KEY_PATH AWS_IOT_PATH_PREFIX AWS_IOT_PRIVATE_KEY_FILENAME   // use this in config call

#endif

So my problem is that the Arduino Yun is not recognizing the files in the directory "/root/certs/" where the credentials are to connect to AWS IoT. Please help me on this issue. Thank you in advance.

Jay
  • 11
  • 3
  • error code -13 is CONNECT_CREDENTIAL_NOT_FOUND. Maybe you place the certs in a wrong place or the names are not matching the above codes? – leonard Apr 20 '16 at 22:47

1 Answers1

0

For anybody else that hits this, I just encountered this when running a previously working bit of code based on the ThingSample. With the newest api (2.1.0), from what I can work out it seems that the place to put the certs folder has changed. The folder should be in /root/AWS-IoT-Python-Runtime/runtime/certs. The setup script did NOT put the certs in that folder unfortunately.

Philip Nelson
  • 985
  • 6
  • 20