Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect multiple devices to same Thing in AWS-IOT?

I am working on a project to install 100+ nodes of temperature sensors in an area, all of which perform the same function. The data they publish is the sensor id and the reading. I am using AWS-IOT for the backend.

Now, to do so, I think I will need to create 1 'thing' per node in aws-iot which I believe is extremely hard to maintain and unscalable.

So my question here is, how to connect multiple nodes to same 'thing' in AWS-IOT so that the cluster is easy to manage. Is there any alternate way to manage the cluster efficiently? Any inputs are welcome. Thanks.

like image 301
Adi Avatar asked Jun 01 '16 18:06

Adi


3 Answers

Faced with a similar dilemma and the impracticality of creating too many 'things' on the AWS IoT administration console; I've done some research and found that connecting multiple devices to the same 'thing' is strongly discouraged by AWS.

Anyway its not possible to keep two different nodes using the same MQTT id connected to the same thing (the last connected node with the same id kicks out the previously connected node), although you can use your client ID with the help of some code.

I learned that actually you don't need a 'thing' to connect to AWS IoT, just a certificate will do; and that you can create elements on AWS IoT service by code.

So, in summary; facing a similar question myself, I ran across this information below, found it useful in my case and sharing it here. https://forums.aws.amazon.com/thread.jspa?threadID=234102

like image 76
weaVaer Avatar answered Sep 28 '22 16:09

weaVaer


It would seem that the only way to do that would be to create your own gateway that aggregates the data before sending it to AWS IoT. You can't have multiple MQTT connections with the same client ID.

Use the API to automate assignment of certificates and private keys to nodes. The sensor ID may be used as the thing name and MQTT client ID. It takes some work up front, but then you can leverage AWS IoT for all the housekeeping moving forward.

like image 32
Judge Maygarden Avatar answered Sep 28 '22 17:09

Judge Maygarden


You can use the same Thing with multiple clientId. You can use the sensor id as the clientId.

like image 31
Weidian Huang Avatar answered Sep 28 '22 15:09

Weidian Huang