使用 Open62541 的 OPC UA 客户端服务器连接

时间:2020-12-29 12:39:29

标签: c opc-ua open62541

我在将 Raspberry Pi 上的客户端连接到 Raspberry pi 上的服务器时遇到了一些问题,希望你们对如何解决这个问题有一些想法。

它们都已使用本指南进行设置 https://open62541.org/doc/current/building.html

为了简单起见,我也使用了他们网站上的简单客户端和服务器设置,可在

https://open62541.org/doc/current/tutorial_client_firststeps.html

https://open62541.org/doc/current/tutorial_server_firststeps.html

唯一的区别是因为我使用的是 UA_ENABLE_AMALGAMATION 选项

#include <open62541/plugin/log_stdout.h>
#include <open62541/server.h>
#include <open62541/server_config_default.h>

已更改为

#include "open62541.h"

我得到的读数是

[2020-12-29 13:32:40.456 (UTC+0100)] warn/server        AccessControl: Unconfigured AccessControl. Users have all permissions.
[2020-12-29 13:32:40.456 (UTC+0100)] info/server        AccessControl: Anonymous login is enabled
[2020-12-29 13:32:40.456 (UTC+0100)] warn/server        Username/Password configured, but no encrypting SecurityPolicy. This can leak credentials on the network.
[2020-12-29 13:32:40.456 (UTC+0100)] warn/userland      AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2020-12-29 13:32:40.458 (UTC+0100)] info/network       TCP network layer listening on opc.tcp://xx:4840/

用于服务器和

[2020-12-29 13:32:43.668 (UTC+0100)] warn/userland      AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2020-12-29 13:32:43.671 (UTC+0100)] warn/network       Connection to opc.tcp://localhost:4840 failed with error: Connection refused
[2020-12-29 13:32:43.671 (UTC+0100)] info/client        Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: BadDisconnect

为了客户

我可以使用 UaExpert 连接到两个树莓派,但由于某种原因客户端不想连接?

任何想法可能导致此问题?

这些也是 Open62541 的当前配置

Open62541 configuration

1 个答案:

答案 0 :(得分:0)

通过将以太网电缆插入两个 raspberry 并出于某种原因通过无线连接到服务器,设法获得基本的客户端/服务器通信。

我认为其中一个存在一些设置问题。