OPCPublisher Module is not getting started

saurabh-3395 101 Reputation points
2022-12-12T06:59:55.423+00:00

Host Machine - Azure Windows VM
Edge Runtime - IoT Edge for Linux on Windows

Binding is not working and because of this OPCPublisher is throwing an error. I have placed pn.json file in c:\iiotedge folder inside the windows VM
and getting error in OPCPublisher module.

Below is the Create Container Option-

{  
  "Hostname": "OPCPublisher",  
  "Cmd": [  
    "publisher",  
    "--pf=/appdata/pn.json",  
    "--di=60",  
    "--to",  
    "--aa",  
    "--si=10",  
    "--ms=262144"  
  ],  
  "HostConfig": {  
    "PortBindings": {  
      "62222/tcp": [  
        {  
          "HostPort": "62222"  
        }  
      ]  
    },  
    "Binds": [  
      "c://iiotedge:/appdata"  
    ],  
    "ExtraHosts": [  
      "localhost:127.0.0.1"  
    ]  
  }  
}  
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
{count} votes

Accepted answer
  1. chbeier 1,871 Reputation points
    2022-12-13T10:29:46.883+00:00

    Hello @SaurabhShuklaUS-9711,

    The quickstart you posted is for generically setting up Azure IoT Edge for Linux on a Windows device (EFLOW). Have you been able to successfully deploy the Simulated Temperature Sensor module and to receive its data?

    There is another guide, specifically for OPC Publisher module tutorial-publisher-deploy-opc-publisher-standalone
    Your Container Create Options for OPC Publisher seems to be the cause as you mix Linux and Windows container create options.

    ...  
    "Binds": [  
           "c://iiotedge:/appdata"  
         ],  
    ...  
    

    EFLOW is based on CBL Mariner Linux, therefore it uses Linux containers and runs in a Linux VM on Windows. It is not possible to directly bind a folder from the host OS (Windows) into the container environment running in the Linux VM. The bind mount should be for a Linux directory within the EFLOW environment, e.g., /srv/opcpublisher what will be created if it does not exist by IoT Edge and bound to OPC Publishers /appdata working directory in the container.

    You can try the following Container Create Options and add your specific command line arguments after the module has started successfully.

    {  
        "Hostname": "opcpublisher",  
        "Cmd": [  
            "--pf=./pn.json",  
            "--aa"  
        ],  
        "HostConfig": {  
            "Binds": [  
                "/srv/opcpublisher:/appdata"  
            ]  
        }  
    }  
    

    ----------

    If your issue is solved, please mark the best answer, and feel free to upvote to help others with a similar issue finding a solution.

    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.