Reputation: 512
I am working with Smart Bulbs. They have a LAN protocol that allows to communicate with the devices. The first step is to discover all the devices on the network. Here in the documentation it says that i can broadcast a udp message at port 56700 and i'll get a response from all the devices. But i am not sure what port i am supposed to listen to. I am listening to the same port and i only get the broadcasted message but no reply from the bulbs. I am broadcasting by using the IP address 255.255.255.255 and i am using python.
Upvotes: 0
Views: 1295
Reputation: 781255
The replies should go to the source port of the message that you sent.
Call socket.bind()
with the port set to 0
. The OS will assign a port, and then you should be able to listen on the same socket that you used to send the packets.
Upvotes: 0