Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get IP address of an UPnP device

Tags:

linux

upnp

I'm trying to find out the IP address of an UPnP device connected to my network. On Windows I'm able to get this information by referring to the following question on StackOverflow:

UPnP Multicast: missing answers from M-SEARCH (Discovery)

However, how can I do on Linux?

like image 655
ChristianR Avatar asked Jul 02 '13 10:07

ChristianR


1 Answers

Depending on how you identify the correct device you could take a look at gssdp-discover in gupnp-tools package (which is part of the GUPnP project). If that is not what you want but you are prepared to code a bit, take a look at the source: gssdp-discover is only ~100 lines of C so you should be a able to do what you want in a few dozen lines of python...

Example:

$ gssdp-discover -t uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2 -n 3
Using network interface wlan0
Scanning for resources matching uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2
resource available
  USN:      uuid:c013f58f-3072-4c3b-9df8-4f869c03edf2
  Location: http://10.10.15.61:49152/description.xml
$ 
like image 135
Jussi Kukkonen Avatar answered Oct 16 '22 21:10

Jussi Kukkonen