I've been trying to connect my device to AWS IoT for a week, but I'm getting the same error "no matter what" I do (ERROR: mqtt_connect -45), which seemingly is an authorization issue of some kind?
Here are the exact steps I'm doing to connect my device:
This process gives the following output:
LTE Link Connecting ...
LTE Link Connected!
IPv4 Address 0x68e7dd12
ERROR: mqtt_connect -45
Please help me resolve this as I can't identify which step(s) I'm missing.
Thank you in advance.
CLOUD_CLIENT_PRIVATE_KEY is the private key, CLOUD_CLIENT_PUBLIC_CERTIFICATE is the public key
The private key should be CLOUD_CLIENT_PRIVATE_KEY, that's correct. As for the NRF_CLOUD_CLIENT_PUBLIC_CERTIFICATE, both of the remaining certificates (not CA) should be included here. It's important that you separate them with a "-----BEGIN CERTIFICATE-----\n" and "-----END CERTIFICATE-----\n". Also, I'm not sure what this does
I uncheck Use provisioned certificates
but you need to provision certificates, which can be done by adding the config option CONFIG_NRF_CLOUD_PROVISION_CERTIFICATES=y.
Thank you for the answer, as suggested by sigvartmh I used the provided certificate instead of the public key and the error disappeared. Now, however, I'm getting two new error codes "MQTT connect failed -61" and "ERROR: mqtt_connect -12". Do you have any suggestions on what these error codes mean?
Both you and sigvartmh have been referencing the CONFIG_NRF_CLOUD_PROVISION_CERTIFICATES option, but this is not to be found in the sample. I am, however, seeing the CONFIG_USE_PROVISIONED_CERTIFICATES option, is this the same as the CONFIG_NRF_CLOUD_PROVISION_CERTIFICATES in previous versions of the sample, maybe?