1

I have created IOT Hub in azure portal and then I added iot edge device and Inside that I have created three modules edge hub,edge agent and opc publisher from azure market place

In the opc publisher log I can see that endpoint is connected but I am not able to see device to cloud message in iot hub it is always zero these are my configuration for opc publisher in Iot edge

{
    "Hostname": "OPCPublisher",
    "Cmd": [
        "PkiRootPath=/appdata/pki", 
        "--lf=/appdata/publisher.log", 
        "--pf=/appdata/publishednodes.json",
        "--aa",
        "--di=60",
        "--me=Json",
        "--mm=PubSub"
    ],
    "HostConfig": {
        "Binds": [
            "/c/IoTEdgeMapping:/appdata"
        ]
    }
}

moreover I am not using any environment variables in opc publisher. in Iot edge hub and iot edge agent I have made environment variables as upseteamProtocol:AMQPWS

DIAGNOSTICS INFORMATION for          :  (OPC Publisher 2.9.0.1)
2023-07-21 13:09:14   # Time                               : 2023-07-21T07:39:14.4554649Z
2023-07-21 13:09:14   # Ingestion duration                 :    00:00:00:48 (dd:hh:mm:ss)
2023-07-21 13:09:14   # Ingress DataChanges (from OPC)     :             10 (All time ~0.21/s; 10 in last 60s ~0.21/s)
2023-07-21 13:09:14   # Ingress EventData (from OPC)       :              0
2023-07-21 13:09:14   # Ingress ValueChanges (from OPC)    :             10 (All time ~0.21/s; 10 in last 60s ~0.21/s)
2023-07-21 13:09:14   # Ingress Events (from OPC)          :              0
2023-07-21 13:09:14   # Ingress BatchBlock buffer size     :              0
2023-07-21 13:09:14   # Encoding Block input/output size   :              0 | 0
2023-07-21 13:09:14   # Encoder Notifications processed    :             10
2023-07-21 13:09:14   # Encoder Notifications dropped      :              0
2023-07-21 13:09:14   # Encoder IoT Messages processed     :             11
2023-07-21 13:09:14   # Encoder avg Notifications/Message  :              1
2023-07-21 13:09:14   # Encoder worst Message split ratio  :              0
2023-07-21 13:09:14   # Encoder avg IoT Message body size  :            480
2023-07-21 13:09:14   # Encoder avg IoT Chunk (4 KB) usage :            0.1
2023-07-21 13:09:14   # Estimated IoT Chunks (4 KB) per day:              0
2023-07-21 13:09:14   # Outgress input buffer count        :              0
2023-07-21 13:09:14   # Outgress input buffer dropped      :              0
2023-07-21 13:09:14   # Outgress IoT message count         :             11 (0.2/s)
2023-07-21 13:09:14   # Connection retries                 :              1
2023-07-21 13:09:14   # Opc endpoint connected?            :           True
2023-07-21 13:09:14   # Monitored Opc nodes succeeded count:              1
2023-07-21 13:09:14   # Monitored Opc nodes failed count   :              0

this is my opc publisher logs

I am using this documentation to build this

moreover I am using UA TCP protocol

and my publishednodes.json is

[
  {
    "EndpointUrl": "opc.tcp://myipaddress:53530/OPCUA/SimulationServer",
    "UseSecurity": false,
    "OpcNodes": [
      {
        "Id": "i=2258",
        "OpcSamplingInterval": 2000,
        "OpcPublishingInterval": 5000,
        "DisplayName": "Current time"
      }
    ]
  }
]

what am I doing wrong? how to send data from opc ua server to opc publisher and then to iot hub?

James Z
  • 12,209
  • 10
  • 24
  • 44
Yash verma
  • 11
  • 2

1 Answers1

0

you are most likely missing routes on the IoT Edge device. The Device-to-cloud messages in IoT Edge device is handled by IoT Edge Hub that acts as a local broker and propagates messages to the cloud. To process messages using routes set up a route to send messages coming from an endpoint (module or device) to the input endpoint which could be your IoT Hub.

If you named the OPC Publisher module as publisher, here is what your route should look like if you would like to push data to IoT Hub FROM /messages/modules/publisher/* INTO $upstream. Please refer the below image for more reference.

enter image description here

Please refer the documentation How OPC Publisher works for additional guidance and the steps needed to configure the OPC publisher module.

I would also like to point that your binds section points to the directory "/c/IoTEdgeMapping:/appdata". I am not sure if you are trying to set up the module on an EFLOW device. If this is not an EFLOW device and you still could not see the data transmitted, try going with the default directories mentioned in the article and see if that helps.