The Core2 for AWS has a pre-provisioned secure element that has a private key and paired public key to be used for registering the device to AWS and establishing a secure TLS connection. This not only prevents anyone from accidentally leaking the private key, but also enables a more systematic registration procedure. The provided script extracts the public key and signs it and sends it to AWS IoT. Ajb2k3's instructions won't apply here.
Using US West 2 when you're in Europe won't charge you any additional fees either. The only effect you should see is additional latency, but within the thresholds of what's allowed before triggering a timeout. We selected us-west-2 for this reason and tested in multiple countries.
The error code meanings from mbedtls' SSL APIs can be viewed here. So mbedtls_ssl_read returning a -0x7880 means /**< The peer notified us that the connection is going to be closed. */
. So AWS is closing the connection.
Few things to check:
- Did the registration script say it successfully registered the thing? If you re-run it, you should get an error at the end that says it couldn't register because the thing already exists.
- Are you 100% sure you copied the endpoint address correctly? We've seen a few users either miss a character or add the quotation marks.
- When you go to your AWS Console to view your things at https://us-west-2.console.aws.amazon.com/iot/home?region=us-west-2#/thinghub, do you see the device there? If you do and you click the thing name (e.g. 01xxxxxxx), then the certificates tab, you should see a long ID for the certificate that belongs to the device. If you click that certificate ID, then the Policies tab, you should see a policy that's attached to that certificate called
Default
.
If all of that checks out, the device should definitely connect. We know that the device is connected to WiFi because it won't try to connect to AWS IoT over MQTT otherwise. If the port was being blocked by the firewall, you should see a different error code. Let me know what happens there.
Sorry for the delayed response. We usually expect people going through the program assets to use the support links and post in the GitHub discussions.