Shifu basic function: device access

How to Modify the Configuration of Device Access

1. Edit edgedevice.yamlthe file

Before connecting the device, you need to edgedevice.yamledit the file. For different protocols, protocolSettingsfurther configuration can be performed according to the protocol. For detailed configuration, please go to Shifu API Reference.

...
connection: Ethernet  
address: 0.0.0.0:11112
protocol: HTTP 
protocolSettings:  
  OPCUASetting:  
...
  • connection: Indicates the network connection method of the device.
  • address: Indicates the network address of the device.
  • protocol: Indicates the communication protocol for interacting with the device.
  • protocolSettings: Indicates the next step of setting the protocol, and different settings need to be introduced for different protocols .

2. Create deviceshifu

After modifying the above files, you can create deviceshifu . At this time, deviceshifu will try to connect to your device through the configuration you set.

3. Detect device access status

If you kubectl get pods -n deviceshifufind that the deviceshifu status appears Erroror through the command CrashLoopBackOff, it means that the connection is abnormal.

You can also kubectl logs <NAME> -n deviceshifuprint error messages by command.

Access an OPC UA device through configuration

connection: Ethernet  
address: opc.tcp://192.168.0.111:4840/freeopcua/server 
protocol: OPCUA  
protocolSettings:  
  OPCUASetting:  
    SecurityMode: None  
    ConnectionTimeoutInMilliseconds: 5000  
    AuthenticationMode: UserName  
    Username: user1  
    Password: pwd1

Through the above configuration, addressset the address of your OPC UA device, protocolset it OPC UA, protocolSettingjoin OPCUASetting, and configure SecurityMode(information security mode), ConnectionTimeoutInMilliseconds(connection timeout), AuthenticationMode(authentication default) and account password, etc.

After modifying the above configuration, create a deviceshifu to access the OPC UA device.

This article is published by Boundless Authorization

Guess you like

Origin blog.csdn.net/Edgenesis/article/details/129362793