question

ambhareshvenkatraman-7264 avatar image
0 Votes"
ambhareshvenkatraman-7264 asked asergaz edited

Iot Edge offline capabilities

I have a scenario where data comes from a module and i send it to IOT Hub in another module. When internet is not working the messages are stored in a queue by a in built azure function. I want to store these data locally so that if my system crashes these data does not vanish.

When there is no internet the interpreter is not coming out of the function send_message_to_output() since its waiting for a Ack from the cloud , which won't happen until the network is back.

Is there any function I can use to store these data locally even when there is no internet or is there any work around for this?

azure-iot-hubazure-iot-edgeazure-iot
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ambhareshvenkatraman-7264 Messages and module state information are stored in the IoT Edge hub's local container filesystem by default. For improved reliability, especially when operating offline, you can also dedicate storage on the host IoT Edge device. For more information, see Give modules access to a device's local storage

Let us know if it helps.

2 Votes 2 ·

Thanks for the response Ashok. Can I know what is the default location inside the container where the data are stored.

0 Votes 0 ·

1 Answer

SandervandeVelde42 avatar image
1 Vote"
SandervandeVelde42 answered asergaz edited

Hello @ambhareshvenkatraman-7264 ,

as mentioned above, offline support is already built-in into Azure IoT Edge.

Messages are persisted on disk until the internet connection comes back.

The location the messages are stored is adjustable as seen in here.

This is also part of ruggedizing your edge device.

Give both the edgeHub and edgeAgent access to a folder using an Environment variable and Container Create options.

In Linux, this an example for both modules:

{
  "HostConfig": {
    "Binds": [
      "/etc/iotedge/storage/:/iotedge/storage/"
    ]
  }
}


(merge this with the already existing edgeHub container create options)

and the environment variable: storageFolder = /iotedge/storage/

Make sure the folder "etc/iotedge/storage" exists on disk and has enough access rights.

There are extra capabilities like priority messages and TTL on the edge routing configuration also.


· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you so much for the help.

0 Votes 0 ·

Hi ,
The local storage is saving it as binary files. is there any way that we can store them in a readable format?

Thanks,
Ambharesh

0 Votes 0 ·
SandervandeVelde42 avatar image SandervandeVelde42 ambhareshvenkatraman-7264 ·

Hello @ambhareshvenkatraman-7264 ,

I check the related documentation, I do not see a property for managing the format.

You can give feedback on the module and even submit a feature proposal here (Share the proposal link so we can upvote).


0 Votes 0 ·