Real-time monitoring of IoT sensor data



Is there any standard architectural pattern (with code sample) that I can use for monitoring real-time sensor data in a web app?

I found this for monitoring real-time sensor data in mobile apps.

Regards, Ashish

已提问 2 年前992 查看次数
3 回答

These links would also help and give you some ideas:

The filters on the right will help to find a better match here:

已回答 2 年前

Hi Ashish. AppSync is one of the major options to consider for real-time applications. That blog and code should be relatively easy to apply to a web application instead of mobile.

One of the main alternatives (for real-time data) to AppSync is to have your application publish and subscribe directly to AWS IoT Core. This is often best achieved using the Amplify pubsub library. You could also use one of the AWS IoT Device SDKs instead. This example uses Amplify and Cognito to authenticate and retrieve credentials, but then the IoT Device SDK to publish and subscribe:

profile pictureAWS
已回答 2 年前

Thanks Greg_B for your reply. On following the same lines, I found this blog for implementing a React web app to monitor real-time sensor data. I think it mentions the same steps as mentiond in Amplify PubSub tutorial.

But I am still not able to see real-time data when publishing from AWS IoT Core test client.

Can you help me with this? Question 1: When we create the policy how do I get the resource arn to be filled in the Resource ARN field?

Question 2: I am getting this error in browser console logs for React app. I think this error comes when IoT Policy is not properly attached. Error: 'AMQJS0008I Socket closed.'

Any guidance on this would be helpful?

Regards, Ashish

已回答 2 年前
  • Hi Ashish. The policy in the tutorial has placeholders for the Account ID and region. You can find this information by clicking your IAM user name and region near the top right corner of the screen when in the AWS Management Console. For example, if your region is N. Virginia, then it's us-east-1. Your account ID is a 12-digit number. So the resource ARN ends up looking something like arn:aws:iot:us-east-1:012345678901:*

  • The policy in the tutorial is very permissive and not intended for production. You should create a least privilege policy in due course:

您未登录。 登录 发布回答。