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

3 Antworten

These links would also help and give you some ideas:

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

beantwortet vor 2 Jahren

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
beantwortet vor 2 Jahren

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

beantwortet vor 2 Jahren
  • 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:

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen