IoT Edge Device in Offline Mode

Dhanavath Vishnu 366 Reputation points
2023-06-19T18:07:13.15+00:00

Hi SatishBoddu-MSFT, @LeelaRajeshSayana-MSFT

In my project we are having 4 IoT Edge modules, communication between those modules happen through API calls and edge hub routes. Presently I have deployed the modules on linux VM for testing. I want to test the offline mode scenario for this device, there are no gateways, all the modules are deployed on a single VM.

I have tried set a rule to keep the VM outbound ports to deny all condition. By this method, I have restarted the IoT edge system using sudo iotedge system restart this command makes the device connection state to the Disconnected, it reflects in IoT HUB twin.

After the above steps, the communication between the modules is lost, the module Client initialization is getting failed.

Any idea, how can we debug this scenario?

Thanks

D. Vishnu

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
598 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,271 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 17,766 Reputation points Moderator
    2023-06-20T22:11:15.6266667+00:00

    Hi @Dhanavath Vishnu Thank you for posting this question here.

    I believe this behavior you see is expected when you disable all outbound network ports on the VM. The Edge Hub module is responsible for module-to-module communication established using the routes. These communications work on ports 8883 (MQTTS) or 5671 (AMQPS) or 443(TLS) if using API. Hence all the routing and communication would be down when all outbound network ports all closed.

    An alternate/ideal way to test the offline capability of the IoT Edge device is by disabling just the network access to the host VM rather than closing all the ports. You can disable the network access to an Azure hosted VM by running the command ifconfig eth0 down. This will disable the netwokk connectivity to the device and forces it to operate in offline mode. You can later enable network access by connecting to serial console of the VM and use ifconfig eth0 up command to restore connectivity.

    Hope this helps. Please let us know if you have any additional questions or need further clarifications on this.


    If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.