0

I'm trying to receive UDP Broadcast packets sent from FPGA connected via a LAN cable. the FPGA sends continuous packets to port 5001.

My python receiver code is simple:

from socket import *
s=socket(AF_INET, SOCK_DGRAM)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
s.bind(('', 5001))
print "trying to receive"
msg = s.recvfrom(1024)[0]
print msg
print "I'm outta here! Bye!"

I checked using Wireshark, and I found that the PC receives the packets. However, my Python code doesn't. I also checked sending packets from another local python code (to the same address and port) and my receiver got those packets.

Wireshark captures: Wireshark packets capture

2 Answers 2

0

The issue was the firewall permissions for python

0

In case this helps others, I had the exact same issue, but in my case the subnet prefix length was the problem, not the firewall.

The Ethernet interface on my PC was configured as /16, when for my device it needed to be /24.

Even with the wrong subnet prefix length Wireshark was still able to see the packets, but Python was not. Changing the Ethernet interface to /24 fixed the issue. I changed it on Windows 10 by going to Ethernet settings, then selecting the interface my device is connected to, and under IP settings, clicking Edit, then updating the Subnet prefix length.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.