Connected and immediately disconnected from AWS IoT
I followed this tutorial to get my Omega2+ connected to AWS IoT. I have previously run a similar tutorial to connect to Losant with success. However, I'm not getting the same results with AWS.
At first, I had issues to get the mosquitto service running, but after fiddling with the certificate and key permissions I got it up and running (by this, I mean that running
ps | grep mosquittowill return
mosquitto -c /etc/mosquitto/mosquitto.conf.
I'm unable to update the shadow of my thing or retrieve it through any of the
mosquitto_sub. When I check the activity tab in the AWS console, I see connections in intervals of ~20 seconds immediately followed by a disconnect as shown in the image below.
I tried creating a new certificate, as I thought it might be an authentication issue, but I get the same result.
Any pointers are appreciated.
Edit. Also, I tried changing the
mosquitto.confto check the logs from my side by adding the line
log_dest file PATH_TO_THE_FILE, but this prevents the service from starting.
I figured it out. It turns out that the root CA file that the script from the tutorial downloads from Symantec is no longer supported.
The AWS documentation says it still supported in older regions for backwards compatibility (I'm in
us-east-1) but it seems that is not the case. The supported certificates can be downloaded from here.
Where should the root CA be stored on the omega's file system?
@James-Solderitsch Found it in /etc/awsiot where it needs to be named RootCA.pem. Then mosquitto needs to be restarted: /etc/init.d/mosquitto restart.