Forum Archive

Unable to send UDP broadcast

juanp14

Hi all

Does anybody know how can I send a broadcast udp packet with Pythonista?
I get [Errno 13] Permission denied every time I try to send udp broadcast packets. can someone please help?.

sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.sendto("Message" , ('169.254.255.255', 13400))

ccc

https://github.com/cclauss/upnp_tools

Kasey00

@juanp14 said:

send a broadcast udp packet with Pythonista?

Ok im going to try an explain what is going on here... I have a network of multiple same type devices. I have a program that runs on any pc on the network that discovers these individual devices and categorizes them by ip, name, mac, etc.. This program allows for configuration of each device. The devices broadcast a udp packet to "255.255.255.255" with the information for discovery. I can run wireshark and intercept the packets broadcasted from the devices. I have a python program that will broadcast udp packets with data of my choosing.. Now.. This stems from me learning python and my project oriented approach.. I learn better this way :). Ok that being said.. My idea is to broadcast the exact udp packet that another device broadcasts, which in turn should land me on the discovery software as a particular network device.. By following udp stream in wireshark sejda
i can copy the data and enter it in my python program and broadcast it on the network. I can broadcast to any destination ip and see it in wireshark but when i try and send it to 255.255.255.255 it never shows up. Now i understand that bluehost routers will not forward 255x4 broadcasts pass the local network. When i run the discovery program i can see all the devices broacasting their packets to 255x4 but not the packet originating from my pc. Any ideas would be greatly appreciated.