Anyone using the TLSTCPCLIENT example2 code for AWS IoT?


#1

Hello fellow thingmakers -

Per the topic, is anyone using this library for AWS IoT?

The example2.ino code is specifically using this initialization and URL:

// setup Root CA pem, cert key, client private key.
client.init(awsRootCApem, sizeof(awsRootCApem),
_ awsCertKeypem, sizeof(awsCertKeypem),_
_ awsPrivateKeypem, sizeof(awsPrivateKeypem));_

// connect AWS IoT server.
client.connect(“test.iot.us-east-1.amazonaws.com”, 8883);

I’ve got my unique thing RSA key and Cert implanted in my sample code, and I’m hitting my specific URL, but still no joy.

[myendpointid].iot.us-west-2.amazonaws.com

Has anyone a cite or example they could share that’s operational?
Likewise any other things you might suggest in diagnostic pursuits would be welcome…


#2

Hello @jimini I want to do the same thing. However I get stuck a bit before this even. I could not find any example of how to embed the key and cert file in my source code. Can you perhaps already inform me of how to do this?

In your example, it might be that the only problem is the name of the IoT service. It should look something like “b4po6n4hpn2bbc.iot.eu-central-1.amazonaws.com” where the endpoint is in fact your accountid.


#3

Your client cert and private key directly replace the example key and cert. I am using my IoT service URL and I chose to emit that specific endpoint for a public post.

There’s no pub/sub that I could see, but I’ve yet to scour through the library… Hoping that somebody in here will share their experience if they’ve made this operable. The Photon is attractive from a price and footprint standpoint, but I’m wheel spinning when I should be focused on our application specifics.

There are other platforms that work out of the box (the Adafruit Feather comes to mind) and it may be opportune to jump ship.