UPNP Plugin

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 8:45 am

UPNP Plugin

This plugin scans your network for active UPNP devices. It gather all data from the devices and builds Python objects that represent the UPNP device. it exposes all of the UPNP functions available for the device. It supports nested embedded devices and services. This is a real handy thing to be able to use/explore the UPNP devices on your network.

There are many questions I can answer about the various things that will be available. As an example. if exploring through a TV and you see a function that needs an InstanceId passed to it. this will almost always be a 0. it all has to do with the UPNP specification.

Some things that will get returned will be what is called escaped XML This is something i plan on adding a mechanism to parse the information and hand back an easy mechanism of accessing the objects in it.

I still have to code in the action memory for already entered values. this is a complicated process since everything is dynamically generate.


Enjoy!

0.1.1b Update
adds missing ipaddress library
adds some exception catching and logging if a UPNP service descriptor file is not retrieved

0.1.2b Update
removes IPV6
fixes traceback on float data type

0.1.3b Update

better error handling on xml parsing.
checks URL for a double /
Attachments
UPNP-0.1.3b.egplugin
(3.1 MiB) Downloaded 36 times
UPNP-0.1.2b.egplugin
(3.1 MiB) Downloaded 22 times
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 9:17 am

Kind of worked, got a couple of errors on startup but the Get Device did find my TV and only my TV though.

Code: Select all

09:17:53      Plugin: UPNP
09:17:53   Exception in thread Thread-10:
09:17:53   Traceback (most recent call last):
09:17:53     File "threading.pyc", line 801, in __bootstrap_inner
09:17:53     File "threading.pyc", line 754, in run
09:17:53     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 130, in do
09:17:53       sock = send_to(local_address)
09:17:53     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 119, in send_to
09:17:53       sock.bind((destination, 0))
09:17:53     File "socket.pyc", line 228, in meth
09:17:53   error: [Errno 10049] The requested address is not valid in its context
The a few seconds later:

Code: Select all

09:18:03   UPNP.DeviceAdded.UE40MU6120 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x04ED6750>
09:18:03   Exception in thread eg.UserPluginModule.UPNP:
09:18:03   Traceback (most recent call last):
09:18:03     File "threading.pyc", line 801, in __bootstrap_inner
09:18:03     File "threading.pyc", line 754, in run
09:18:03     File "C:\ProgramData\EventGhost\plugins\UPNP\__init__.py", line 74, in run
09:18:03       for device in UPNP_Device.discover(10):
09:18:03     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\__init__.py", line 22, in discover
09:18:03       yield UPNPObject(addr, locations)
09:18:03     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\instance_singleton.py", line 11, in __call__
09:18:03       super(InstanceSingleton, cls).__call__(id, *args)
09:18:03     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\upnp_class.py", line 61, in __init__
09:18:03       node
09:18:03     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 41, in __init__
09:18:03       response = requests.get(url + location)
09:18:03     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 71, in get
09:18:03       return request('get', url, params=params, **kwargs)
09:18:03     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 57, in request
09:18:03       return session.request(method=method, url=url, **kwargs)
09:18:03     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 475, in request
09:18:03       resp = self.send(prep, **send_kwargs)
09:18:03     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 585, in send
09:18:03       r = adapter.send(request, **kwargs)
09:18:03     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\adapters.py", line 453, in send
09:18:03       raise ConnectionError(err, request=request)
09:18:03   ConnectionError: ('Connection aborted.', BadStatusLine('HTTP1.1 404 Not Found\r\n',))

Code: Select all

09:18:51      Get Device
09:18:51         UPNP: Get Device: UE40MU6120
09:18:51         Dump Result to Log
09:18:51            
09:18:51            
09:18:51            UE40MU6120
09:18:51            IP Address: 192.168.1.215
09:18:51            ==============================================
09:18:51            Services:
09:18:51                Service name: ScreenSharingService
09:18:51                Service class: urn:samsung.com:service:ScreenSharingService:1
09:18:51                Access point: UPNPObject.ScreenSharingService
09:18:51                ----------------------------------------------
09:18:51                Methods:
09:18:51                    Method name: X_ConnectScreenSharingM2TV
09:18:51                    Access point: UPNPObject.ScreenSharingService.X_ConnectScreenSharingM2TV
09:18:51                    Call: dict(tBSSID, tWlanFreq, tListenFreq) = UPNPObject.ScreenSharingService.X_ConnectScreenSharingM2TV(mWlanMacAddress, mP2pDeviceAddress, mBluetoothMacAddress, mWFDSourcePort)
09:18:51                    ----------------------------------------------
09:18:51                        Parameters: 
09:18:51                        Name: mWlanMacAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mWlanMacAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Name: mP2pDeviceAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mP2pDeviceAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Name: mBluetoothMacAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mBluetoothMacAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Name: mWFDSourcePort
09:18:51                        UPNP data type: A_ARG_TYPE_mWFDSourcePort
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Return Values: 
09:18:51                        Name: tBSSID
09:18:51                            UPNP data type: A_ARG_TYPE_tBSSID
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                        Name: tWlanFreq
09:18:51                            UPNP data type: A_ARG_TYPE_tWlanFreq
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                        Name: tListenFreq
09:18:51                            UPNP data type: A_ARG_TYPE_tListenFreq
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                    Method name: X_ConnectScreenSharingTV2M
09:18:51                    Access point: UPNPObject.ScreenSharingService.X_ConnectScreenSharingTV2M
09:18:51                    Call: dict(tBSSID, tWlanFreq, tListenFreq, tWFDSourcePort) = UPNPObject.ScreenSharingService.X_ConnectScreenSharingTV2M(mWlanMacAddress, mP2pDeviceAddress, mBluetoothMacAddress)
09:18:51                    ----------------------------------------------
09:18:51                        Parameters: 
09:18:51                        Name: mWlanMacAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mWlanMacAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Name: mP2pDeviceAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mP2pDeviceAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Name: mBluetoothMacAddress
09:18:51                        UPNP data type: A_ARG_TYPE_mBluetoothMacAddress
09:18:51                        Py data type: str, unicode
09:18:51            
09:18:51                        Return Values: 
09:18:51                        Name: tBSSID
09:18:51                            UPNP data type: A_ARG_TYPE_tBSSID
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                        Name: tWlanFreq
09:18:51                            UPNP data type: A_ARG_TYPE_tWlanFreq
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                        Name: tListenFreq
09:18:51                            UPNP data type: A_ARG_TYPE_tListenFreq
09:18:51                            Py data type: str, unicode
09:18:51            
09:18:51                        Name: tWFDSourcePort
09:18:51                            UPNP data type: A_ARG_TYPE_tWFDSourcePort
09:18:51                            Py data type: str, unicode
09:18:51            Devices: None

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 11:47 am

try running it again.

the first error has something to do with IPV6. I have never screwed around with it with the python socket library. There seems to be some kind of a glitch somewhere. I know there are things missing when dealing with sockets on Windows in python from 2.7 all the way up to 3.5 i am not sure if they have fixed it in 3.6 The really messed up thing is they have known about the problems with it for over 10 years but never fixed it. they do not care about fixing problems they are only concerned with adding new features. Its really annoying to have to monkey patch programming glitches in other software issue that have been known about and have been there for over a decade.

In all reality I can probably drop the IPV6 support I do not think that at this time there are any devices that use IPV6 and UPNP. well none that i have seen thus far. the biggest downfall of IPV6 and the reason why it is not being used is because it's to figgin complex. and the normal user has to many issues trying to get it to work right. and when they have something they can simply click on the OK button and have it function sitting there staring them in the face, they will click on the button. I have turned off IPV6 on my network due to problems it caused and my packets not getting routed properly. the egg heads put way to much egg into the design of it.

the second error came up as a 404 not found error. I would have to add some debugging routines to see what the URL is that it is trying to load.

Now the strange thing is I am using an exact copy of the back end of this in the Samsung plugin and you do not get the error well not as of yet. which is rather strange.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 11:57 am

OK so i added the missing ipaddress library to this one as well.
and I added some exception catching to see if we can get a better handle on what is going on in that service.
I am going to wait to see if the Samsung plugin also messes up with the IPV6. if it does I am going to strip IPV6 out of both of them. I do not have a fully functional IPV6 network to test it on. And to be honest I have much better things to do with my time then to mess around with IPV6
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 12:03 pm

Hi, got this error on startup:

Code: Select all

12:01:45   Exception in thread Thread-13:
12:01:45   Traceback (most recent call last):
12:01:45     File "threading.pyc", line 801, in __bootstrap_inner
12:01:45   Exception in thread Thread-15:
12:01:45     File "threading.pyc", line 754, in run
12:01:45   Traceback (most recent call last):
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 130, in do
12:01:45   Exception in thread Thread-17:
12:01:45       sock = send_to(local_address)
12:01:45     File "threading.pyc", line 801, in __bootstrap_inner
12:01:45   Traceback (most recent call last):
12:01:45     File "threading.pyc", line 754, in run
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 119, in send_to
12:01:45     File "threading.pyc", line 801, in __bootstrap_inner
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 130, in do
12:01:45       sock.bind((destination, 0))
12:01:45     File "threading.pyc", line 754, in run
12:01:45       sock = send_to(local_address)
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 130, in do
12:01:45     File "socket.pyc", line 228, in meth
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 119, in send_to
12:01:45       sock = send_to(local_address)
12:01:45   error: [Errno 10049] The requested address is not valid in its context
12:01:45       sock.bind((destination, 0))
12:01:45     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 119, in send_to
12:01:45   
12:01:45     File "socket.pyc", line 228, in meth
12:01:45       sock.bind((destination, 0))
12:01:45   error: [Errno 10049] The requested address is not valid in its context
12:01:45     File "socket.pyc", line 228, in meth
12:01:45   
12:01:45   error: [Errno 10049] The requested address is not valid in its context
Then a couple of others shortly after:

Code: Select all

12:01:57   UPNP.DeviceAdded.UE40MU6120 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x04F02B90>
12:01:57   FAILED URL LOAD: http://192.168.1.1:1991/WFADevice.xml//x_wfawlanconfig.xml
12:01:57   Traceback (most recent call last):
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 42, in __init__
12:01:57       response = requests.get(url + location)
12:01:57     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 71, in get
12:01:57       return request('get', url, params=params, **kwargs)
12:01:57     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 57, in request
12:01:57       return session.request(method=method, url=url, **kwargs)
12:01:57     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 475, in request
12:01:57       resp = self.send(prep, **send_kwargs)
12:01:57     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 585, in send
12:01:57       r = adapter.send(request, **kwargs)
12:01:57     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\adapters.py", line 453, in send
12:01:57       raise ConnectionError(err, request=request)
12:01:57   ConnectionError: ('Connection aborted.', BadStatusLine('HTTP1.1 404 Not Found\r\n',))
12:01:57   UPNP.DeviceAdded.VMG3925B10B <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x0534CA90>
12:01:57   Exception in thread eg.UserPluginModule.UPNP:
12:01:57   Traceback (most recent call last):
12:01:57     File "threading.pyc", line 801, in __bootstrap_inner
12:01:57     File "threading.pyc", line 754, in run
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\__init__.py", line 74, in run
12:01:57       for device in UPNP_Device.discover(10):
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\__init__.py", line 22, in discover
12:01:57       yield UPNPObject(addr, locations)
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\instance_singleton.py", line 11, in __call__
12:01:57       super(InstanceSingleton, cls).__call__(id, *args)
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\upnp_class.py", line 61, in __init__
12:01:57       node
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 69, in __init__
12:01:57       url + control_url
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\action.py", line 29, in __init__
12:01:57       variable = state_variables[variable](direction)
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\data_type.py", line 51, in __call__
12:01:57       data_type = self.data_type(self.node, direction)
12:01:57     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\data_type.py", line 610, in __init__
12:01:57       default_value = int(default_value.text)
12:01:57   ValueError: invalid literal for int() with base 10: '0.0'

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 12:24 pm

ok update is in...
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 12:33 pm

Getting further, picked up my soundbar, TV and router and then this error:

Code: Select all

12:32:14   Exception in thread Thread-20:
12:32:14   Exception in thread Thread-21:
12:32:14   Traceback (most recent call last):
12:32:14   Traceback (most recent call last):
12:32:14   Exception in thread Thread-22:
12:32:14     File "threading.pyc", line 801, in __bootstrap_inner
12:32:14     File "threading.pyc", line 801, in __bootstrap_inner
12:32:14     File "threading.pyc", line 754, in run
12:32:14     File "threading.pyc", line 754, in run
12:32:14   Traceback (most recent call last):
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 131, in do
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 131, in do
12:32:14       sock = send_to(local_address)
12:32:14     File "threading.pyc", line 801, in __bootstrap_inner
12:32:14       sock = send_to(local_address)
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 120, in send_to
12:32:14     File "threading.pyc", line 754, in run
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 120, in send_to
12:32:14       sock.bind((destination, 0))
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 131, in do
12:32:14       sock.bind((destination, 0))
12:32:14       sock = send_to(local_address)
12:32:14     File "socket.pyc", line 228, in meth
12:32:14     File "socket.pyc", line 228, in meth
12:32:14     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 120, in send_to
12:32:14   error: [Errno 10049] The requested address is not valid in its context
12:32:14   error: [Errno 10049] The requested address is not valid in its context
12:32:14       sock.bind((destination, 0))
12:32:14   
12:32:14   
12:32:14     File "socket.pyc", line 228, in meth
12:32:14   error: [Errno 10049] The requested address is not valid in its context
12:32:14   
12:32:24   UPNP.DeviceAdded.UE40MU6120 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x05198470>
12:32:24   FAILED URL LOAD: http://192.168.1.1:1991/WFADevice.xml//x_wfawlanconfig.xml
12:32:24   Traceback (most recent call last):
12:32:24     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 42, in __init__
12:32:24       response = requests.get(url + location)
12:32:24     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 71, in get
12:32:24       return request('get', url, params=params, **kwargs)
12:32:24     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 57, in request
12:32:24       return session.request(method=method, url=url, **kwargs)
12:32:24     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 475, in request
12:32:24       resp = self.send(prep, **send_kwargs)
12:32:24     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 585, in send
12:32:24       r = adapter.send(request, **kwargs)
12:32:24     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\adapters.py", line 453, in send
12:32:24       raise ConnectionError(err, request=request)
12:32:24   ConnectionError: ('Connection aborted.', BadStatusLine('HTTP1.1 404 Not Found\r\n',))
12:32:24   UPNP.DeviceAdded.VMG3925B10B <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x05CF29B0>
12:32:24   UPNP.DeviceAdded.HWMS650 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x04EE7ED0>
12:32:26   Exception in thread eg.UserPluginModule.UPNP:
12:32:26   Traceback (most recent call last):
12:32:26     File "threading.pyc", line 801, in __bootstrap_inner
12:32:26     File "threading.pyc", line 754, in run
12:32:26     File "C:\ProgramData\EventGhost\plugins\UPNP\__init__.py", line 74, in run
12:32:26       for device in UPNP_Device.discover(10):
12:32:26     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\__init__.py", line 22, in discover
12:32:26       yield UPNPObject(addr, locations)
12:32:26     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\instance_singleton.py", line 11, in __call__
12:32:26       super(InstanceSingleton, cls).__call__(id, *args)
12:32:26     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\upnp_class.py", line 61, in __init__
12:32:26       node
12:32:26     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 48, in __init__
12:32:26       root = etree.fromstring(response.content)
12:32:26     File "src\lxml\etree.pyx", line 3213, in lxml.etree.fromstring
12:32:26     File "src\lxml\parser.pxi", line 1877, in lxml.etree._parseMemoryDocument
12:32:26     File "src\lxml\parser.pxi", line 1765, in lxml.etree._parseDoc
12:32:26     File "src\lxml\parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc
12:32:26     File "src\lxml\parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
12:32:26     File "src\lxml\parser.pxi", line 711, in lxml.etree._handleParseResult
12:32:26     File "src\lxml\parser.pxi", line 640, in lxml.etree._raiseParseError
12:32:26   XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1 (line 1)

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 12:39 pm

you see this crap.. idiots implementing UPNP and can't even get the path keyed in correctly to their own service files

/WFADevice.xml//x_wfawlanconfig.xml

see the //

that's not me. that is what the device is reporting as the location. again with the having to write code to handle errors made outside of my control. it's really aggravating.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 12:43 pm

and this is also most likely from the same device

12:32:26 XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1 (line 1)

this is probably going to be yet another error in the output from that device. they forgot a < in the xml file.

ok so i am going to have to handle badly formatted XML as well.


I do however have to take off for an hour and a half. I have to drop the wife off at work. A friend is using my car while i repair her BMW. and be it my luck it was an east cost car. so nice and rusty suspension, I am doing the ball joints and control arms. and find out the wheel bearings are so bad she wasn't to far from losing a wheel completely. and this is a 2007 x3. so not to old either. My wife has been nagging me for years that she wants to get a BMW and I tell her when she is willing to fix it herself she can have one. but until that day NO.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 12:57 pm

Unbelievable.

Anyway, no rush, thankful for you doing this.

Cheers

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 1:25 pm

It is what it is. My whole week is really screwed up. I have 3 PCs I need to repair. Well one is a laptop that has Tea spilt into it. So needless to say that one is done. So I got a new/used laptop for them. Nice laptop guy has 2 more he is selling. Intel I5 2.3 GHz dual core. 8 gigs ram. 128 gig SSD msata and a 1tb spinner 15.6" screen 2 gig ddr3 video ram. Display port finger print scanner 6 button touchpad. Earser tip mouse also. 150.00USD each. I am going to buy the other 2. They are HP EliteBooks. It has a nice metal jacket. It feels like a very solid laptop.

So I have to tear the old one down. Get the disk out and put it into an external case. Another laptop I have to use the daz loader on it. As well as see why the wifi isn't working (probably turned off with the switch on the side of it). The 3rd machine is a hoot. The bios info on boot says 640k base memory. So that should give you a clue to the age. It has a 25 pin dsub lpt port on the back.. they have windows 7 running (how is beyond me) and j was asked to make it faster. I said ok. Walked over and dropped it into the garbage. And asked is that fast enough??

And j ha e my delivery today for the HVAC stuff coming freight. So no delivery time. Just some time today. I need to get this BMW done but I need to drop the whole knuckle hub, spindal.... Off to get the bearings pressed out and in. It I do not know if I am going to even be able to do that because I can't leave my house. My whole week is s mess. I was supposed to get the oil changed in my car yesterday. Couldn't do that because I don't have the car. What should have been a 3 hour job on the BMW is now going on day 4.

Ever feel like throwing your hands up and just walking away. I am pretty close to doing that.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 2:14 pm

ok new version is up
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 5:30 pm

Getting further, it discovered my 2018 TV as well now (version number not updated in plugin):

Code: Select all

17:29:09   Exception in thread Thread-8:
17:29:09   Traceback (most recent call last):
17:29:09     File "threading.pyc", line 801, in __bootstrap_inner
17:29:09     File "threading.pyc", line 754, in run
17:29:09     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 131, in do
17:29:09       sock = send_to(local_address)
17:29:09     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\discover.py", line 120, in send_to
17:29:09       sock.bind((destination, 0))
17:29:09     File "socket.pyc", line 228, in meth
17:29:09   error: [Errno 10049] The requested address is not valid in its context
17:29:09   
17:29:19   UPNP.DeviceAdded.QE65Q7FNA <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x054F3ED0>
17:29:19   UPNP.DeviceAdded.UE40MU6120 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x05566D50>
17:29:19   FAILED URL LOAD: http://192.168.1.1:1991/WFADevice.xml//x_wfawlanconfig.xml
17:29:19   Traceback (most recent call last):
17:29:19     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 42, in __init__
17:29:19       response = requests.get(url + location)
17:29:19     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 71, in get
17:29:19       return request('get', url, params=params, **kwargs)
17:29:19     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\api.py", line 57, in request
17:29:19       return session.request(method=method, url=url, **kwargs)
17:29:19     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 475, in request
17:29:19       resp = self.send(prep, **send_kwargs)
17:29:19     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\sessions.py", line 585, in send
17:29:19       r = adapter.send(request, **kwargs)
17:29:19     File "C:\Program Files (x86)\EventGhost\lib27\site-packages\requests\adapters.py", line 453, in send
17:29:19       raise ConnectionError(err, request=request)
17:29:19   ConnectionError: ('Connection aborted.', BadStatusLine('HTTP1.1 404 Not Found\r\n',))
17:29:19   UPNP.DeviceAdded.VMG3925B10B <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x05514ED0>
17:29:19   UPNP.DeviceAdded.HWMS650 <eg.UserPluginModule.UPNP.UPNP_Device.upnp_class.UPNPObject object at 0x052B6150>
17:29:22   Exception in thread eg.UserPluginModule.UPNP:
17:29:22   Traceback (most recent call last):
17:29:22     File "threading.pyc", line 801, in __bootstrap_inner
17:29:22     File "threading.pyc", line 754, in run
17:29:22     File "C:\ProgramData\EventGhost\plugins\UPNP\__init__.py", line 74, in run
17:29:22       for device in UPNP_Device.discover(10):
17:29:22     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\__init__.py", line 22, in discover
17:29:22       yield UPNPObject(addr, locations)
17:29:22     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\instance_singleton.py", line 11, in __call__
17:29:22       super(InstanceSingleton, cls).__call__(id, *args)
17:29:22     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\upnp_class.py", line 61, in __init__
17:29:22       node
17:29:22     File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 48, in __init__
17:29:22       root = etree.fromstring(response.content)
17:29:22     File "src\lxml\etree.pyx", line 3213, in lxml.etree.fromstring
17:29:22     File "src\lxml\parser.pxi", line 1877, in lxml.etree._parseMemoryDocument
17:29:22     File "src\lxml\parser.pxi", line 1765, in lxml.etree._parseDoc
17:29:22     File "src\lxml\parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc
17:29:22     File "src\lxml\parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
17:29:22     File "src\lxml\parser.pxi", line 711, in lxml.etree._handleParseResult
17:29:22     File "src\lxml\parser.pxi", line 640, in lxml.etree._raiseParseError
17:29:22   XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1 (line 1)

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: UPNP Plugin

Post by kgschlosser » Tue Dec 11, 2018 6:47 pm

you should not be getting that same error.

File "C:\ProgramData\EventGhost\plugins\UPNP\UPNP_Device\service.py", line 48, in __init__
17:29:22 root = etree.fromstring(response.content)

The lines have moved in the updated code


this

root = etree.fromstring(response.content)

is now on line 52 not 48. the error states it is on line 48. so something didn't update properly.

I check the attached file and it has all of the updated code in it. so try it again please :-D
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 182
Joined: Thu Dec 04, 2014 2:44 pm

Re: UPNP Plugin

Post by holdestmade » Tue Dec 11, 2018 7:48 pm

I deleted both the UPNP and the Samsung plugins and now its not showing that error and discovered my WMP

The FAILED URL LOAD is my router.

I've PM'd you the router XML files

Post Reply