Wireshark receives UDP multicast packages, but subscribe sample does not?

435 views
Skip to first unread message

Theresa Lichtenberger

unread,
Apr 3, 2019, 3:36:32 AM4/3/19
to open62541
First of all thank you very much for the great work you are doing on this project!

I am currently trying to publish timestamps on the raspberry pi and subscribe to them on my windows based PC. For this, I connected BOTH the Raspberry Pi and the Windows PC to a Switch. So, if I start the publish sample on the Raspberry Pi, I can already see the incoming UDP multicast packages in Wireshark on my Windows PC. So theoretically, the subscribe application also should be able to receive the packages and print them out to the console. But that is not the case. The subscribe sample does NOT print out any timestamps to the console which means, it does not receive any UDP multicast packages.

I have already tried out the suggestion from Julius Pfrommer and specified a network interface.
In order to find the correct network interface name, I typed in "ipconfig /all" and looked it up

I am pretty sure it is the "Ethernet-Adapter Ethernet 3". And I can kind of confirm this by looking it up on wireshark (as the "Ethernet 3" interface is the only one on which I receive the UDP multicast packages):

Therefore, I specified the network interface by changing your suggested line to:
`UA_NetworkAddressUrlDataType networkAddressUrl = {UA_STRING("Ethernet 3"), UA_STRING("opc.udp://224.0.0.22:4840")};`
I tried it both with the pubsub_subscribe_standalone and with the tutorial_pubsub_subscribe.c.
But in both examples, it prints out a warning that there was a problem with creating the PubSub Connection and that the network interface selection failed. Afterwards however, it successfully creates a PubSub Connection. But obviously not with my specified network interface (because I still cannot receive any UDP multicast packages).

What can I do to solve this problem? I know the packages are there on my pc, I see them on Wireshark, so why isn't the subscribe sample working? It is working if I run the publish example on the PC as well.

Thank you for any help you can possibly give me! I really appreciate it!

With kind regards,
Theresa Lichtenberger

network_interface.PNG
wireshark_network_interfaces.PNG
pubsub_tutorial_subscriber_console_output.PNG

dapauli...@gmail.com

unread,
Jul 31, 2019, 9:40:55 AM7/31/19
to open62541
Hi Theresa

I stumbled upon the same issue. Note that the subscriber example works as expected under Linux.

It seems that the issue is related to Windows picking the wrong interface to listen for the multicast traffic, see https://stackoverflow.com/questions/15322242/python-bind-error-on-multicast-bind-on-windows.

Specifying the network interface in the example code does not work, as this affects only the outgoing traffic. As a workaround, I had to change the following library code:

in ua_pubsub_udp.c, UA_PubSubChannelUDPMC_regist

replace
groupV4.imr_interface.s_addr = UA_htonl(INADDR_ANY);
with
if (UA_inet_pton(AF_INET, "192.168.1.31", &groupV4.imr_interface.s_addr) < 0) {
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "PubSub Connection regist failed: Bad network interface IP");
return UA_STATUSCODE_BADINTERNALERROR;
}

Replace the IP address with the IP of your network interface.

Other than that, did you gain any experience with receiving the published data from your raspberry pi in some other tool? I'm still looking for a client where I can properly test my PubSub application.

Regards
Daniel

Sten Grüner

unread,
Jul 31, 2019, 10:09:42 AM7/31/19
to dapauli...@gmail.com, open62541
Is it similar to the mdns multicast intetface selection?


If yes maybe the pr can be cloned for pub/sub?
--
You received this message because you are subscribed to the Google Groups "open62541" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open62541+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open62541/507a1431-1603-4848-a72c-6613500778b0%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages