Browse through the questions and answers listed below or filter and sort to narrow down your results.
AWS IoT rule SQL query for mqtt nested arrays
I have the following mqtt message:
```
{
"sensors": [
{
"lsid": 412618,
"data": [
{
"temp_in": 72.3,
"heat_index_in": 72,
"dew_point_in": 55.9,
"ts": 1652785241,
"hum_in": 56.3
}
],
"sensor_type": 243,
"data_structure_type": 12
},
{
"lsid": 421195,
}
```
I can get the "sensors,0.lsid" value and the entire "data" array using this query:
```
select get(sensors,0).lsid as ls, get(sensors, 0).data as data1 from "topic"
```
but what I really need is to get "temp_in:72.3" , i.e. the values from the second level array
I've tried using this :[https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-nested-queries.html](), but unless i'm not following it correctly, it doesnt seem to work.
Any help would be greatly appreciated
Accepted AnswerInternet of Things
1
answers
0
votes
11
views
asked 2 days ago
1
answers
0
votes
6
views
asked 3 days ago
IoT services by project?
Hi,
I plan to have several distinct IoT projects on my account which will not share devices or business logic. I also need to be able to configure separate production and development environments for these projects so that testing can occur without impacting production.
It's unclear to me how this should be done. With most other services, you start by creating a container or an environment, like with data you might create separate databases, or with servers, separate Ec2 instances.
When I started working with IoT services, I was surprised that I didn't have to start by setting up such an environment.
I assume that people are able to run distinct dev and production environments, and different projects, without having to resort to getting different Amazon accounts for each project. What's the right way to do this?
Thanks,
Frank
Accepted AnswerInternet of Things
1
answers
0
votes
5
views
asked 2 months ago
What is a thingId?
Hi,
I noticed that if I query the Thing registry through the Java SDK (describeThing() function), the return value, DescribeThingResponse, has a "thingId" property. I don't see this value when I examine the thing in the AWS console. What is its purpose?
Is it safe to ignore the thingId in my application and just use the thingName as the unique identifier?
Thanks,
Frank
Accepted AnswerInternet of Things
1
answers
0
votes
4
views
asked 2 months ago
How do Thing names work in IoT?
I'm a little confused about what a Thing's "name" really means in IoT services.
I created a Thing with a name ("thing1") and created a certificate for it at the same time. That certificate is only assigned to thing1.
I set up a client using the certificate, and it was able to connect to the IoT service and send shadow updates as "thing1". Then I tried having that device send shadow updates as "thing2" or "thing3". To my surprise, this worked, even though there is no "thing2" or "thing3" defined on my account.
I had planned to give each of my devices its own certificate and assumed that by having separate certificates, the devices would not be able to spoof another device. But this doesn't seem to be the case.
What's the recommended way to achieve the security I want?
Accepted AnswerInternet of Things
1
answers
0
votes
14
views
asked 2 months ago
How to do Custom Authentication in http header for MQTT-over-Websocket using C++ SDK?
Hi,
For "MQTT over WebSockets" found in [https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html](), the credential can be passed "Through request headers or query parameters in the HTTP UPGRADE request to establish the WebSockets connection."
Does anyone know how to do this using the AWS IoT SDK C++?
I understand that I can use Mqtt::OnWebSocketHandshakeIntercept() to embed authorisation into the HTTP header. However, it is unclear how it can be done since Http::HttpHeader basically only has name and value data members or is there another way to do it?
Any assistance is greatly appreciated,
Andi
Accepted AnswerInternet of Things
2
answers
0
votes
3
views
asked 2 months ago
3
answers
0
votes
4
views
asked 2 months ago
3
answers
0
votes
12
views
asked 3 months ago
Endpoint for IOT services?
How does an AWS IOT device know what endpoint to hit in order to access the IOT instance associated with my AWS account?
Do all devices just hit the same endpoint, and IOT figures it out based on their certificate? Or do I need to program my device with an endpoint, or some other information to tell it to communicate with my account?
Thanks.
Accepted AnswerInternet of Things
1
answers
0
votes
11
views
asked 3 months ago
ThrottlingException when calling IoT SearchIndex
Hi
I have just implemented an api to get the online status for our IoT devices using the SearchIndex operation in AWS IoT. This worked fine during testing, but when it was put into production it failed immediately. I tried manually doing a SearchIndex from the console at the time and got the following error:
```
> aws iot search-index --index-name "AWS_Things" --query-string "thingName:xxx" --profile yyy
An error occurred (ThrottlingException) when calling the SearchIndex operation (reached max retries: 2): Rate exceeded
```
How can I find out what the current throttling limit is for this operation?
I found a list of throttling limits in the documentation, but can't see anything that concerns the IoT Index:
https://docs.aws.amazon.com/general/latest/gr/iot-core.html#throttling-limits
From our logs found that the API was hit about 90 times per second at the time. We currently have around 430K devices.
We could reduce the load by doing some caching on our side, but without knowing what the limits are, it is difficult to know if that will be sufficient.
Is there perhaps a better way to query the online status of a device?
Accepted AnswerInternet of Things
1
answers
0
votes
7
views
asked 3 months ago
1
answers
0
votes
5
views
asked 4 months ago