Correct way to stop and start custom modules in Azure IoT

Satyam Chauhan 567 Reputation points
2022-09-15T15:30:09.843+00:00

Hi,

I have created 2 Custom Modules, 1st module gets message from an API and sends it to the 2nd Module. 2nd Module does some processing and sends it to IoT Hub. I have followed steps from tutorial-csharp-module after I do build and publish and Create deployment for single device the Modules start running, and I have no idea how to stop and then start them again.

Please help, as I am very new to it.

Thanks and Regards,
Satyam

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
401 questions
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.
576 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,205 questions
{count} votes

Accepted answer
  1. QuantumCache 20,271 Reputation points
    2022-09-16T05:40:23.897+00:00

    Hello @Satyam Chauhan ,

    I have deployed an IoTEdge Device with RHEL8.1 for this scenario and tested quickly few module deployments and their status management..

    Please follow the below instructions on how to properly manage the IoT Edge modules.

    Starting and stopping of the modules depends on the IoT Edge deployment on the device, and is controlled by EdgeAgent by design.
    If you want to stop the module, the way to do that is to create a new deployment with the module status as Stopped. You can also stop the entire IoT Edge runtime ($>sudo iotedge system stop), which will stop the modules as well.

    Creating deployment from the portal: you have to choose the desired state of the Module and then submit the deployment for that device.

    241742-image.png

    241724-image.png

    241735-image.png

    Once the Deployment is submitted from the Azure portal, i see the particular module is now stopped.

    241649-image.png

    Run the below commands on the device.

    sudo iotedge system stop  
    

    241710-image.png

    sudo iotedge system restart  
    

    241761-image.png

    If the response is helpful, please click "Accept Answer" and upvote it.

    Happy to Help you! Please leave your comments in the below section for further help in this matter.

    2 people found this answer helpful.

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.