Real-time monitoring of IoT sensor data

0

Hi,

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. https://aws.amazon.com/blogs/mobile/iot-with-aws-appsync/

Regards, Ashish

3개 답변
1

These links would also help and give you some ideas:

The filters on the right will help to find a better match here: https://aws.amazon.com/iot/blog/

https://aws.amazon.com/blogs/architecture/category/internet-of-things/aws-iot-analytics/

Kishan
답변함 2년 전
1

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: https://github.com/aws-samples/aws-amplify-react-iot-pub-sub-using-cp

profile pictureAWS
전문가
Greg_B
답변함 2년 전
0

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. https://theskenengineering.com/building-a-react-js-app-with-aws-iot/ I think it mentions the same steps as mentiond in Amplify PubSub tutorial. https://docs.amplify.aws/lib/pubsub/getting-started/q/platform/js/

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: https://docs.aws.amazon.com/iot/latest/developerguide/example-iot-policies.html

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠