How to provide iot service to our devices during aws code update roll out? - amazon-web-services

We are using AWS IOT for our home automation product.
Recently we started to face a new issue with AWS IOT services.
The problem is when AWS IOT team release new code updates, they disconnect certain devices from mqtt.
Our devices connect to mqtt , aws disconnects them immediately , ultimately leading to connect -> disconnect cycle.Our devices make shadow update/get request whenever they connect to mqtt.
As a result this causes high iot message usage. The worst thing is mqtt service remains unavailable during this time so users can't use our product and they start calling our customer support and we have no valid reason to satisfy them, leading to very bad user experience.
This issue has been occurred three times in last couple of months.
We tried to get some solution from AWS developer support but no benefit.
Could anyone please suggest a way that we can use to provide service to our customers when this issue occurs?
We are using nodemcu esp8266 and mongoose os on hardware side.

Related

web interface for potentiometer in aws iot

actually, I write program in Arduino ide which read potentiometer value and send it to AWS MQTT. whenever I revolve my potentiometer it prints value in AWS MQTT and now I want it to access from web page tell me what are the possible ways we access the data on web page
thanks.
I try to access it through node red in AWS cloud formation.my node is complete but it shows connecting error and not connected.
There are several ways available. I think this blog will be helpful - 7 patterns for IoT data ingestion and visualization- How to decide what works best for your use case
If you want to directory interact with IoT Core from Web browser, Amplify PubSub Library may be good.

AWS IoT Device online/offline check

I am currently working on an IoT device using AWS IoT core. I am new to working with IoT device. What is the standard/best way for determining whether the device is online and connected to the internet?
Thanks you!
Since you have been using AWS IoT Core, I would recommend that you stay in fully managed services provided by AWS IoT suite. No need to reinvent the wheel such as provisioning a separate database for a basic requirement of pretty much every IoT-enabled solution.
What I understand is that you want to monitor your IoT device fleets for state changes or failures in operation, and to trigger actions when such events occur. To address this challenge, I'd suggest using AWS IoT Events. It accepts inputs from many different IoT telemetry data sources including smart sensors, edge devices, management applications, and other AWS IoT services. You can easily push any telemetry data input to AWS IoT Events by using a standard API interface.
In specific to device heartbeat, please take a look at this sample detector model. A detector model simply represents your equipment or process. On the console, you can find some other pre-made detector model templates which you can customize based on your use-case.
One way to know if a device is online is to check for a heartbeat.
A device heartbeat is a small mqtt message to a topic that the device sends every 5 minutes.
In IoT Core, you would configure a rule that would update a Dynamodb table with a timestamp each time a message is sent to the heartbeat topic.
By checking this timestamp in Dynamodb, you can confirm if your device is currently online.
You can follow this Developer Guide to get connect disconnect events. it works on MQTT topics so we can use rules to trigger Lambda or other services.

AWS IoT scaling issues and metrics for monitoring IoT

I am using AWS IoT Service.
When a device sends a registration message to MQTT broker, I have a rule to store it in a SQS queue.
A Lambda function is triggered, when the message is added to the Queue. The Thing is created for the device and it's certificate is registered.
While carrying out the load testing, I observed that, after some time, the incoming messages are not received on the AWS MQTT broker and are not processed.
I have written some test clients which run on EC2 instances to simulate the MQTT clients.
If I restart the test clients after some time, again I can see the messages coming to AWS IoT.
I am not sure, if this is the issue of MQTT broker or if it is the issue with the clients running on EC2 instances.
I can think of possible issues because of limits on AWS IoT ,
https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_iot
I want to know what are the possible AWS IoT matrices, I need to monitor for this or which IoT specific alarms I need to configure?
Is it a possible issue on EC2 side? ( maybe network out bytes per second, etc.)
There is another load testing scenario, in which I am not doing registration of devices, but just capturing the connect or disconnect events. In this case, I am not observing similar issues.
As you know, there is some limits about AWS IoT.
API Transactions per Second
CreateCertificateFromCsr 15
CreateDynamicThingGroup 5
CreateJob 10
CreatePolicy 10
CreatePolicyVersion 10
CreateRoleAlias 10
CreateThing 15
Generally, AWS API throws Exception when it run over limts.
How about catch Exception?
If you want to check EC2 network issue, use some command ( netstat, tcpdump, ... )

Google Cloud - Detecting Offline Devices

I am rather new to Google Cloud IoT Core and the associated services, and have come across a problem for which I can find no "best practice" solution.
Using Google Cloud IoT Core to receive telemetry data from IoT Devices, what is the best way to detect when an IoT Sensor Device goes offline or becomes silent? Other Cloud based IoT Service implementations have built-in notification timeouts for generating alerts, but I can find no similar for Google IoT
Example: A number of IoT Edge devices monitors the temperature of cold storage rooms, and pushes a measurement every minute to a Google Cloud IoT Core, via MQTT or HTTP through WiFi or mobile data connections. If the measured temperature exceeds acceptable limits, an alert message is triggered, and routed to operational service personnel.
However, if one of the IoT Edge sensors suddenly stops operating, for whatever reason, how can this be detected by Google Cloud IoT services? Obviously, the only sign of something being wrong, is that no messages have been received from a certain DeviceID for a period substantially longer than the configured messaging-interval, e.g. 2 x interval + grace_period, so that an alert can be generated to warn of a lack of telemetry data, possibly caused by a power failure, which needs to be addressed?
Is there any standard-means by which an "IoT Device Presence" status can be automatically maintained for each device, based on the (lack of) received telemetry data from the device, in such a way, that the state change (online/offline transitions) can cause alert messages to be generated?
Or will it require a separate scheduled service to iterate all (supposedly active) devices, measuring the duration since the last received telemetry (temperature) update, and updating the device presence status directly?
Assuming you just want disconnect events, there was a solution posted earlier that involves setting up StackDriver logs that exports messages to Pub/Sub. From there, you can handle the event in a Cloud Function to send an email in a similar way to what is available in your listed implementation. It takes more time to set up, but is more flexible in terms of what you can do with connect/disconnect events.
Google Core IoT Device Offline Event or Connection Status

AWS IOT subscribe timeout exception

I have been using the AWS IOT python sdk for developing a cloud based iot software as a part
of a larger solution.However I frequently get the subscribe and publish timeout exceptions after some time on every run. Though i don't see a pattern here i am able to receive the messages published for some time duration.
How do i fix this issue so that i do not get those exceptions?
Is there any parameter that i have to set to prevent the IOt Subscription issue?
Or is there any additional setup needed to be done on the cloud?
Thanks in advance.