I was hoping to add 'device discovery' to a custom app I am developing. I have looked through many sendHubAction examples, but none seem to send a UDP broadcast packet (no data) on port 30303 so that the device's WiFi Module would respond.
Here is the details of what I need to accomplish. Any help, examples would be greatly appreciated.
The WiFi Module can be discovered on an network by sending a UDP broadcast packet (no data) on port 30303. The WiFi Module will respond with two ASCII-encoded lines of text, separated by CRLF. The first line is the hostname (BWGSPA, e.g.), and the second line is its MAC address. The OUI is 00:15:27. The IP address of the returned packet is the IP address of the WiFi module.
@thebearmay Would you be able to shed some light on this request or at least point me to a driver that has this type of LAN device discovery. I have racked my brains around using hubaction and you have many replies that provide great answers in threads I have searched.
Wow, thank you for such a quick reply and the example code to execute. I did your example code as a test from a test driver and noting was returned to the parse method.
Do I need to subscribe to a location/port or something to allow the lan devices time to respond?
Also, should I be sending this on a broadcast ip of 255.255.255.255:30303.
@thebearmay Thank you so much for your assistance,
At least I think your have the correct HE protocol statement, which I was trying several different types. But none get a response from the device.
It could be that the device using a wireless connection cannot receive/respond to broadcast packets. Perhaps my Netgear router defaults to preventing broadcast messages as in this documentation.
A Netgear router can block broadcast messages by utilizing a feature called "broadcast filtering" within its settings, which limits the number of broadcast packets that can be sent across the network, effectively preventing potential network disruptions caused by excessive broadcast traffic; you can access this feature through your router's web interface to enable or configure it depending on your need
I can test this using Python or other lan sniffing tools.