- Newest
- Most votes
- Most comments
Hi:
AWS IoT Core's life-cycle events (https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html) are designed to be used for persistent connections using MQTT in order to determine whether a device's connection was established or disconnected. HTTP Rest APIs are using by design short-lived connections and the connection can be multiplexed when using AWS IAM credentials and thereby doesn't provide an indication whether a specific device is "connected".
If you need to tell whether a specific device is connected/online you'll need to use MQTT connections instead. Client IDs are independent of Things and unless the relationship is maintained by the device using a clientID via MQTT that matches its registered Thing name there is no relationship between the two.
As Christoph mentioned, the devices are identified as things if they use thing name as the clientId while connecting to IoT Core. Is there a reason for not able to use thing name as clientId?
We could add thing name in life cycle message but we don't do it today because customers can get thing name from the clientId. Refer https://docs.aws.amazon.com/iot/latest/developerguide/iot-thing-management.html
Hey,
using the thing name as the clientId would definitely be the preferred way but the developer who works on the firmware of the devices was set on using the REST API to push updates to the shadow for some reasons regarding the device architecture.
Apparently it's not possible to manually set the clientId when using the REST API (according to this post https://forums.aws.amazon.com/message.jspa?messageID=751184#751184 ) at this moment which lead to my problem.
I've now brought the reasoning regarding the connectivity using the REST API towards the dev and was able to convince him to change his implementation of the IoT messages to using MQTT so I guess the issue is resolved for now. Thanks for your answers!
Mathis
Relevant content
- asked a year ago
- Accepted Answerasked a year ago
- Accepted Answerasked 4 months ago
- What's the difference between Lambda function execution role permissions and invocation permissions?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago