Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to read the OPCUA data, throwing Failed to read message from Server, error: write tcp 10.2xx.0.xx:47902->192.xxx.x.xxx:49320: write: broken pipe #533

Open
MaheshDevulapally opened this issue Mar 9, 2023 · 17 comments
Labels
help wanted Extra attention is needed OPC UA Priority: High question Further information is requested

Comments

@MaheshDevulapally
Copy link

Hi ,
I'm running shifu locally on my kind cluster.
When I tried to get the value from my opc uA server ,its throwing above mentioned error ..can anyone help me on this?Attached the below picture
image

@tomqin93
Copy link
Contributor

tomqin93 commented Mar 9, 2023

Hi @MaheshDevulapally , thanks for this issue
Do you mind sharing your configmap and edgedevice YAML files?
Also it would be great if you can share your OPC UA server's spec

@tomqin93 tomqin93 added the question Further information is requested label Mar 9, 2023
@MaheshDevulapally
Copy link
Author

MaheshDevulapally commented Mar 9, 2023 via email

@tomqin93
Copy link
Contributor

tomqin93 commented Mar 9, 2023

@MaheshDevulapally Thanks for sharing, we'll give that a try
In the mean time, do you mind sharing your configmap and edgedevice YAML files?
It looks like the pod has crashed due to errors, you can checkout the logs by

kubectl logs -n deviceshifu {POD_NAME}

@MaheshDevulapally
Copy link
Author

MaheshDevulapally commented Mar 9, 2023 via email

@MaheshDevulapally
Copy link
Author

MaheshDevulapally commented Mar 9, 2023 via email

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally , we are not able to see any of the files/attachment you sent.
The OPC UA deviceShifu maps each HTTP API to a Node ID, for example in https://github.com/Edgenesis/shifu/blob/main/examples/opcuaDeviceShifu/opcua_deploy/opcua_deviceshifu_configmap.yaml
we have the following:

...
  instructions: |
    instructions:
      get_value:
        protocolPropertyList:
          OPCUANodeID: "ns=2;i=2"
      get_time:
        protocolPropertyList:
          OPCUANodeID: "i=2258"
      get_server:
        protocolPropertyList:
          OPCUANodeID: "i=2261"
...

so get_value maps to ns=2;i=2 and so on.

Currently we do not support NodeID browsing. May I know what's the use case? You can create a feature request for that.

Regarding the FreeOpcUa Python Serverroot from server command, it means you are probably connected to our mock opcua device. You need to configure edgedevice.yaml to your server's address

@MaheshDevulapally
Copy link
Author

Hi Tom,
Sorry I was replying through Email ,that might be the reason you are not able to read the files. Attached now.
Yeah u were right even though I have changed the node address it referred to free opc ua server which i'm running. I deleted the deployment/service now it is redirected to my Kepware Opcua server but below error I'm getting kindly help me
image
Thank you,Mahesh
Yamlzipfile.zip

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally , it looks like you are still using the default IDs in the example, can you please try any of the predefined NodeIDs in your server besides these in configmap?

  instructions: |
    instructions:
      get_value:
        protocolPropertyList:
          OPCUANodeID: "ns=2;i=2"
      get_time:
        protocolPropertyList:
          OPCUANodeID: "i=2258"
      get_server:
        protocolPropertyList:
          OPCUANodeID: "i=2261"

@MaheshDevulapally
Copy link
Author

MaheshDevulapally commented Mar 16, 2023

Hi Tom,
Yeah you were right. It was output of default examples.
Now just look at the below output when I'm trying to connect Kepware OPC server which I insatlled locally. Also attached the configmap and edgedevice YAML files.
image

TempMarch16th.zip.
Also could you help me how get those node id's any reference article etc...currently I'm using OPC expert tool to know the node IDs... It would be great if shifu could support OPC NodeID browsing.

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally
Thank you for the info, it looks like you are trying to request a node ID that does not exist in your Kepware Server.
You may want to find a valid ID from OPC expert tool and replace it in the default ConfigMap's OPCUANodeID field
BTW just saw your issue #545 and we are looking into it.

@MaheshDevulapally
Copy link
Author

MaheshDevulapally commented Mar 16, 2023

Hi @tomqin93
Finally I was able to read the data from Kepware server.
But I have below questions

  1. If I want to read multiple tag values ,in which format I should provide OPC UA node IDS? I tried in list format but didn't worked.
    get_value:
    protocolPropertyList:
    OPCUANodeID: ["ns=2;s=Channel1.Device1.Tag1","ns=2;s=Channel1.Device1.Tag2"]
  2. does instructions are interlinked? meaning if I provide wrong identifier for get server or get time it will break get value instruction? also can I add additional instructions get_device2value by providing that respective opcUAnodeID
    get_value:
    protocolPropertyList:
    OPCUANodeID: "ns=2;s=Channel1.Device1.Tag1"
    get_time:
    protocolPropertyList:
    OPCUANodeID: "i=84"
    get_server:
    protocolPropertyList:
    OPCUANodeID: "i=85"
  3. This is related to MQTT deployment I'm facing below when I'm port forwarding
    image

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally
Regarding your questions:

  1. Currently we do not support list mapping, if you would like to read from multiple tags you need to use multiple APIs.
  2. Yes each API is linked to a node ID. And yes you can provide more API mappings by appending using the same format.
  3. Not really sure what happens here. Have you tried port forward without address 0.0.0.0 and access it using localhost? According to Kubernetes document you are using the right command. Not sure if it's related to Windows. Also can you try using a high port? i.e. 31883:1883

@MaheshDevulapally
Copy link
Author

Hi @tomqin93 ,
I have added Getvalue1 instruction by giving second tag Nodeid but its throwing below error .can you help me any config in some other Yaml files missing?
image
image

  1. Same error with 31883

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally , when you update the configmap, did you delete the pod?
Currently you need to manually delete the pod or reapply via kubectl delete -f <folder> and kubectl apply -f <folder> to take effect

@MaheshDevulapally
Copy link
Author

Hi @tomqin93 Yeah this time I forgot to delete pod this time and it worked. Another observation is that even when remote opcua server is down , again we need to delete the pod and create again.
Regarding MQTT any help ?
also correct me if I'm wrong ,below CURL command we need to run inside nginx right?
image
Also could you tell me right command for windows to below ....grep is not recognized
sudo kubectl get pods -A | grep robotarm

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally ,

  1. Regarding the OPC UA server down and not reconnecting, can you please create an issue for this so we can keep track of it? It may be a bug from the library we used Stuck in infinite loop of StatusBadNoSubscription (0x80790000) gopcua/opcua#434
  2. For MQTT, did you try forwarding without the --address prefix?
  3. Yes the command looks correct, make sure you have changed the MQTT server address and configmap accordingly as stated here https://shifu.run/docs/guides/cases/connect-mqtt
  4. the windows equivalent to should be sudo kubectl get pods -A | findstr 'robotarm'. Also if you are running just a few devices, you can just remove the last part and issue sudo kubectl get pods -A directly.

@tomqin93
Copy link
Contributor

Hi @MaheshDevulapally , btw not sure if you saw my comment in the feature request issue.
To better understand your request and provide you with the best possible solution, could you please send an email to xqin@edgenesis.com?
We can also arrange a short 1-on-1 meeting to discuss the issue in more detail.

@saiyan86 saiyan86 added help wanted Extra attention is needed OPC UA Priority: High labels Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed OPC UA Priority: High question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants