OPC UA PubSub Traps And Pitfalls: Difference between revisions
From OPC Labs Knowledge Base
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
; Subscriber does not receive anything, even when no filter is specified - but I am sure the publisher works. | ; Subscriber does not receive anything, even when no filter is specified - but I am sure the publisher works. | ||
: Check that you are publishing and subscribing on the intended network interfaces. On computers with multiple interfaces, which is now common, a default interface is chosen by the software when no interface is specified, and it may commonly be a wrong choice. In tools like '''OpcCmd''' or '''UADemoSubscriber''', use the '''-ConnectionNetworkInterface''' ('''-cni''') option. In subscriber code, set the '''InterfaceName''' property of '''UAPubSubConnectionDescriptor'''.'''ResourceAddress'''. | : Check that you are publishing and subscribing on the intended network interfaces. On computers with multiple interfaces, which is now common, a default interface is chosen by the software when no interface is specified, and it may commonly be a wrong choice. In tools like '''OpcCmd''' or '''UADemoSubscriber''', use the '''-ConnectionNetworkInterface''' ('''-cni''') option. In subscriber code, set the '''InterfaceName''' property of '''UAPubSubConnectionDescriptor'''.'''ResourceAddress'''. | ||
; Subscriber does not receive anything, when on the same host as the publisher. | |||
: This happens with some network adapters. You can install and use a loopback adapter to make it work. On Windows 10, run Add Hardware Wizard ('''hdwwiz.exe'''), tell it that you want to select the hardware manually from a list, and from Network Adapters, select Microsoft -> Microsoft KM-TEST Loopback Adapter. |
Revision as of 19:54, 30 August 2019
- Error "Unable to activate the adapter (...). Return code: -8"
- On Linux, elevated privileges are needed in order to send raw Ethernet packets. Run your program with sudo to resolve this issue.
- Error "Unable to load shared library 'libpcap' or one of its dependencies. ..."
- If you are on Ubuntu 18: Libpcap is "preinstalled", but SharpPcap won't find it. There are various ways how to resolve it. One of them is to create a copy of symlink /user/lib/x86_64-linux-gnu/libpcap.so.0.8 to symlink libpcap.so in the same directory.
- Subscriber does not receive anything, even when no filter is specified - but I am sure the publisher works.
- Check that you are publishing and subscribing on the intended network interfaces. On computers with multiple interfaces, which is now common, a default interface is chosen by the software when no interface is specified, and it may commonly be a wrong choice. In tools like OpcCmd or UADemoSubscriber, use the -ConnectionNetworkInterface (-cni) option. In subscriber code, set the InterfaceName property of UAPubSubConnectionDescriptor.ResourceAddress.
- Subscriber does not receive anything, when on the same host as the publisher.
- This happens with some network adapters. You can install and use a loopback adapter to make it work. On Windows 10, run Add Hardware Wizard (hdwwiz.exe), tell it that you want to select the hardware manually from a list, and from Network Adapters, select Microsoft -> Microsoft KM-TEST Loopback Adapter.