MicrochipTech / AzureDemo_AVR-IoT_Wx

"IoT Made Easy!" - Connect the AVR-IoT WA/WG Development Board to Microsoft Azure
2 stars 1 forks source link

Doesn't recover automatically from internet disruption #3

Open SharxRobotics opened 10 months ago

SharxRobotics commented 10 months ago

I left the device connected to the internet and it was uploading to Azure as expected. Initially a little bit too fast, 1 update per second, which would cause problems with the free Azure service having an 8000 messages per day limit. So I increased the upload interval from 1 second to 12 seconds and it was working when I left the office. There was an internet (not Wifi) disruption in the middle of the night, as reported by other devices at the office. When internet was restored 45 min later, all other devices resumed their updates but the AVR-IoT stayed disconnected until I manually unplugged it from USB power and plugged it back in.

I added the red arrow in the screenshot from the Azure IoT hub below to indicate the time that the internet was lost.

image

So the code needs a bit more error resiliency, not just for Wifi disruption but also for the case where the Wifi is solidly connected but when the WAN connection to the Wifi router is disrupted.

SharxRobotics commented 10 months ago

Looks like it doesn't recover automatically from any sort of error. I activated 3 units on Azure and purposely let them exceed the quota of 8000 messages for the free account. After midnight UTC Azure allows a new quota of 8000 messages, but the AVR-IoT devices stayed stuck in error mode with red light on. image