Home:ALL Converter>Application running on Linux Mint system not receiving udp packets

Application running on Linux Mint system not receiving udp packets

Ask Time:2020-07-17T05:12:45         Author:NateH

Json Formatter

I have an ESP8266 on my local network sending small, periodic UDP packets to the global broadcast address (192.168.1.255) on port 12345.

I have the following for python3 udp receiver code:

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('', 12345))

while True:
    print("Server is listening...")
    print(s.recvfrom(4096))
    data, addr = s.recvfrom(4096)
    if data :
      print ("Message: ", data)

When I run this code on a Rasberry Pi (running Raspian Buster), I see the packets from the ESP8266 as expected. When I run the same code on a computer running Linux Mint, it receives nothing.

I have also used tcpdump on the linux computer, it DOES show the UDP packets.

nate ~/python/udpSever $sudo tcpdump -v -n port 12345
tcpdump: listening on enp2s0, link-type EN10MB (Ethernet), capture size 262144 bytes
16:47:00.068937 IP (tos 0x0, ttl 128, id 4, offset 0, flags [none], proto UDP (17), length 38)
    192.168.1.14.55555 > 192.168.1.255.12345: UDP, length 10

I have tried the same exercise using node.js code for the UDP receiving program, same results: Works on RasPi, does not work on Linux Mint computer (not showing node.js code, don't think it adds anything here).

I have no firewall or antivirus software installed on Linux Mint computer.

-I think the python UDP receiver code is valid because it works on the RasPi.

-I am sure the Linux computer is actually receiving the UDP packets because I can see them with the tcpdump command on that computer.

Any idea what might be preventing the UDP packets from getting to the python program (application level?) on the Linux Mint computer?
Any command line programs that could help diagnose this issue?
Does my user need some specific permissions enabled?

Author:NateH,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62943561/application-running-on-linux-mint-system-not-receiving-udp-packets
yy