Closed Peter-Krebs closed 5 years ago
Couple of things for you to try:
If that doesn't work let me know.
Thanks for the pointers!
We need the UDP broadcast for discovering other hosts. Manually looping through IP ranges would take forever in comparison and is not future-proof regarding IPv6 address ranges.
Screenshot: Output of the AdvancedSend example:
Sending 3 and "Three" works when explicitly stating IP + port.
Sending 4 and "Four" with a broadcast is not received on the other end.
Any ideas?
Yea, I take your points about the wireshark stuff. From experience UDP broadcasting can be problematic with some hardware. It might be for some reason the broadcast packets are not being sent up the network stack correctly on the pi's, but that's outside my area of expertise.
For reference if you're trying to broadcast between two .net native machines on the same network it works quite well (http://www.networkcomms.net/udp-broadcasting/). Perhaps if you have the machines that's another thing to try that might then point the finger directly at a mono issue or pi issue.
The UDP broadcasts arrive when using netcat, so it's not blocked in any way.
Since I've posted the original issue I have adapted a low-level implementation based on this answer:
StackOverflow: How to do network discovery using UDP broadcast
This sends/receives UDP broadcasts flawlessly. So not truly a Mono or Pi issue.
But of course this does not have encryption and compression which I wanted to get to later.
If my code from the OP does not ring any bells for you in terms of what's wrong, maybe I need a bit of a re-think anyway what I could go test.
I'm on vacation for two weeks and will come back to this at some point.
If you don't have anything to add you can close the issue for now and I'll come back to the library later. Thanks for your time!
Am closing this as it's now stale and we never got to the bottom of this issue.
Many thanks for the discussion.
Thanks for making this library, I like the concept!
As the title suggests: I've tried to make a UDP broadcast work on two Raspberry Pi boxes, connected to the same router as my laptop. They seemingly cannot talk to each other using NetworkComms. There are no errors output or exceptions thrown while the application is running.
I need the Raspberrys to broadcast to each other. Is my usage of your library at fault here or do you have any pointers? How can I provide further info for debugging NetworkComms's part of things?
Versions
NetworkComms 3.0.3
Raspberrry Pi 3
.NET Framework 4.6.1 mono 4.6.2 OS: Raspbian Lite - Raspbian GNU/Linux 9 (stretch)
Source code
SSH Session
When starting the program on two raspberries, they don't receive messages (console window does not print the received ChatMessage):
Wireshark sees broadcasts
Meanwhile... the broadcasts can be seen in Wireshark:
Netcat works
A netcat session reveals that send/receive should work, so it's not likely a configuration issue:
Thanks in advance!