Code Monkey home page Code Monkey logo

Comments (6)

cristipogacean avatar cristipogacean commented on July 26, 2024 1

@chunchiehdev, I believe the reason for this is that the trust relationship between your client and server is not properly established. your client try to connect, the server sends it's cert public key which is not trusted therefore the client closes the secure channel without providing a reason. This is normal behavior as per OPC UA Spec. You will need to explicitly establish the mutual trust between the peers (both sides client and server). This is done by adding the server's public key certificate in the client's trusted certificates store and the client's public key certificate in the server's trusted certificates store.

from iot-edge-opc-plc.

cristipogacean avatar cristipogacean commented on July 26, 2024 1

right, in Kubernetes context though, there might be k8s infrastructure entities that try to check the pod's health and use port 80 by default. This is done automatically without user's control, therefore the behavior of your server might be different than in a regular docker context.

from iot-edge-opc-plc.

chunchiehdev avatar chunchiehdev commented on July 26, 2024

@cristipogacean ,When I initially deployed to opc-plc AKS, I did not use any client-side tools to attempt a connection. However, it continuously keeps creating ChannelIds, and the ChannelIds keep increasing. Could this be related to network restrictions?

[08:47:49 INF] Node values will change every 10000 ms                                                                                                                                         
[08:47:49 INF] Node values sampling rate is 0 ms                                                                                                                                              
[08:47:49 INF] ChannelId 1: in Connecting state.                                                                                                                                              
[08:47:49 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 023404EE, ChannelId=1                                                                                                                        
[08:47:49 INF] Server - CreateEventManager.                                                                                                                                                   
[08:47:49 INF] Server - CreateAggregateManager.                                                                                                                                               
[08:47:49 INF] Server - CreateSessionManager.                                                                                                                                                 
[08:47:49 INF] Server - CreateSubscriptionManager.                                                                                                                                            
[08:47:49 INF] Server - Session Monitor Thread Started.                                                                                                                                       
[08:47:49 INF] Subscription - Publish Thread 0000000D Started.                                                                                                                                
[08:47:49 INF] Server - Enter Running state.                                                                                                                                                  
[08:47:49 INF] Server - Started.                                                                                                                                                              
[08:47:49 INF] OPC UA Server started                                                                                                                                                          
[08:47:49 INF] PLC simulation started, press Ctrl+C to exit ...                                                                                                                               
[08:47:49 INF] ChannelId 2: in Connecting state.                                                                                                                                              
[08:47:49 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 01AC495C, ChannelId=2                                                                                                                        
[08:47:50 INF] ChannelId 3: in Connecting state.                                                                                                                                              
[08:47:50 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 0342F10B, ChannelId=3                                                                                                                        
[08:47:50 INF] ChannelId 4: in Connecting state.                                                                                                                                              
[08:47:50 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 025F14A9, ChannelId=4                                                                                                                        
[08:47:50 INF] ChannelId 5: in Connecting state.                                                                                                                                              
[08:47:50 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 01FA0ABC, ChannelId=5                                                                                                                        
[08:47:51 INF] ChannelId 6: in Connecting state.                                                                                                                                              
[08:47:51 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 00DC0E29, ChannelId=6                                                                                                                        
[08:47:51 INF] ChannelId 7: in Connecting state.                                                                                                                                              
[08:47:51 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 02B6A1CA, ChannelId=7                                                                                                                        
[08:47:51 INF] ChannelId 8: in Connecting state.                                                                                                                                              
[08:47:51 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 021A7086, ChannelId=8                                                                                                                        
[08:47:51 INF] ChannelId 9: in Connecting state.                         
[08:47:51 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 021A7086, ChannelId=8                                                                                                                        
[08:47:51 INF] ChannelId 9: in Connecting state.                                                                                                                                              
[08:47:51 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 02A5C7B8, ChannelId=9                                                                                                                        
[08:47:52 INF] ChannelId 10: in Connecting state.                                                                                                                                             
[08:47:52 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 021EB607, ChannelId=10                                                                                                                       
[08:47:54 INF] ChannelId 11: in Connecting state.                                                                                                                                             
[08:47:54 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 03D8C971, ChannelId=11                                                                                                                       
[08:48:32 INF] ChannelId 81: in Connecting state.                                                                                                                                             
[08:48:32 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 00D7EBF3, ChannelId=81                                                                                                                       
[08:48:32 ERR] TCPSERVERCHANNEL ForceChannelFault Socket=028BAC6A, ChannelId=0, TokenId=0, Reason=BadConnectionClosed 'Remote side closed connection'                                         
[08:48:32 INF] ChannelId 75: in Faulted state.                                                                                                                                                
[08:48:32 INF] ChannelId 82: in Connecting state.                                                                                                                                             
[08:48:32 INF] TCPSERVERCHANNEL SOCKET ATTACHED: 028D4EAB, ChannelId=82  

from iot-edge-opc-plc.

cristipogacean avatar cristipogacean commented on July 26, 2024

I see. just noticed you're using port 80. This is not exactly indicated for OPC UA Applications. The default port of opc plc is 50000. I'm assuming that some entity in your environment is constantly attempting to connect on port 80. I suggest you use a different port, not that common.

from iot-edge-opc-plc.

chunchiehdev avatar chunchiehdev commented on July 26, 2024

Thank you. But I already set up the port number --pn=80 and also export it to 80.
When I use docker to run the opcplc. Then it will be normal on my computer. Like this.

 docker run --rm -it -p 80:80 -p 8080:8080 --name opcplc mcr.microsoft.com/iotedge/opc-plc:latest --pn=80 --autoaccept --sn=5 --sr=10 --st=uint --fn=5 --fr=1 --ft=uint --gn=5 --ll=trace --ph=opcplc --cdn=opcplc

It won't automatically create the ChannelId; it only logs the ChannelId when I use a connection tool to connect to it. I believe this is normal behavior.

<6>2024-06-14T09:24:06.000Z - Node values will change every 10000 ms
<6>2024-06-14T09:24:06.187Z - Server - CreateEventManager.
<6>2024-06-14T09:24:06.195Z - Server - CreateAggregateManager.
<6>2024-06-14T09:24:06.197Z - Server - CreateSessionManager.
<6>2024-06-14T09:24:06.199Z - Server - CreateSubscriptionManager.
<6>2024-06-14T09:24:06.200Z - Server - Session Monitor Thread Started.
<6>2024-06-14T09:24:06.203Z - Subscription - ConditionRefresh Thread 0000000D Started.
<6>2024-06-14T09:24:06.203Z - Subscription - Publish Thread 0000000C Started.
<6>2024-06-14T09:24:06.204Z - Server - Enter Running state.
<6>2024-06-14T09:24:06.204Z - Server - Started.
<6>2024-06-14T09:24:06.205Z - OPC UA Server started
<6>2024-06-14T09:24:06.208Z - PLC simulation started, press Ctrl+C to exit ...

from iot-edge-opc-plc.

chunchiehdev avatar chunchiehdev commented on July 26, 2024

Thank you so much!

from iot-edge-opc-plc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.