Hi there, I’m trying to get my devices on AWS IoT, but I’ve been having this intermittent issue that’s very frustrating.
Occasionally, when running the command
mos aws-iot-setup --aws-region us-west-2, the command fails with the following message:
Attaching policy "mos-default" to the certificate... 2020/12/21 20:52:13 This operation, AttachPrincipalPolicy, has been deprecated Attaching the certificate to "my-device-name"... Writing certificate to aws-my-device-name.crt.pem... Uploading aws-my-device-name.crt.pem (1141 bytes)... Error: context deadline exceeded /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/common/mgrpc/mgrpc.go:460: /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/dev/dev_conn_impl.go:167: /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/dev/dev_conn_impl.go:190: /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/fs/fs.go:240: /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/x509utils/gen_cert.go:328: failed to upload aws-my-device-name.crt.pem /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/aws/aws.go:401: /build/mos-BVS5qt/mos-2.18.0+1ec8595~xenial0/cli/main.go:198: aws-iot-setup failed
The command hangs on
Uploading aws-my-device-name.crt.pem (1141 bytes)... for about a minute or two. If I re-run the command multiple times, it’ll eventually work. Sometimes it works on the first try. Sometimes, I have to re-run this command 5+ times to get my device connected. I’ve tried reflashing the device with my firmware, power cycling the device, and even rebuilding the whole firmware & reflashing, without success.
Has anyone else experienced this issue or know what’s going on with this? Does it have anything to do with the
This operation, AttachPrincipalPolicy, has been deprecated warning?