question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don´t work with [TV]Samsung LED32

See original GitHub issue
$ python --version
Python 3.6.2

$ uname -a
Linux blackbird 4.13.5-1-ARCH #1 SMP PREEMPT Fri Oct 6 09:58:47 CEST 2017 x86_64 GNU/Linux
$ dlnap.py --device tv --play ~/Videos/aviao.mp4 --proxy --log debug

INFO:DlnapDevice:=> New DlnapDevice (ip = 10.0.200.86) initialization..
INFO:DlnapDevice:location: http://10.0.200.86:7676/smp_11_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {'root': [{'specVersion': [{'major': ['1'], 'minor': ['0']}], 'device': [{'deviceType': ['urn:schemas-upnp-org:device:MediaRenderer:1'], 'pnpx:X_compatibleId': ['MS_DigitalMediaDeviceClass_DMR_V001'], 'df:X_deviceCategory': ['Display.TV.LCD Multimedia.DMR'], 'dlna:X_DLNADOC': ['DMR-1.50'], 'friendlyName': ['[TV]Samsung LED32'], 'manufacturer': ['Samsung Electronics'], 'manufacturerURL': ['http://www.samsung.com/sec'], 'modelDescription': ['Samsung TV DMR'], 'modelName': ['UN32J4303'], 'modelNumber': ['AllShare1.0'], 'modelURL': ['http://www.samsung.com/sec'], 'serialNumber': ['20110517DMR'], 'UDN': ['uuid:1017df81-000e-1000-aa9a-b8bbaff0dbce'], 'sec:deviceID': ['CPCHDC2MYPGGE'], 'iconList': [{'icon': [{'mimetype': ['image/jpeg'], 'width': ['48'], 'height': ['48'], 'depth': ['24'], 'url': ['/dmr/icon_SML.jpg']}, {'mimetype': ['image/jpeg'], 'width': ['120'], 'height': ['120'], 'depth': ['24'], 'url': ['/dmr/icon_LRG.jpg']}, {'mimetype': ['image/png'], 'width': ['48'], 'height': ['48'], 'depth': ['24'], 'url': ['/dmr/icon_SML.png']}, {'mimetype': ['image/png'], 'width': ['120'], 'height': ['120'], 'depth': ['24'], 'url': ['/dmr/icon_LRG.png']}]}], 'serviceList': [{'service': [{'serviceType': ['urn:schemas-upnp-org:service:RenderingControl:1'], 'serviceId': ['urn:upnp-org:serviceId:RenderingControl'], 'controlURL': ['/smp_13_'], 'eventSubURL': ['/smp_14_'], 'SCPDURL': ['/smp_12_']}, {'serviceType': ['urn:schemas-upnp-org:service:ConnectionManager:1'], 'serviceId': ['urn:upnp-org:serviceId:ConnectionManager'], 'controlURL': ['/smp_16_'], 'eventSubURL': ['/smp_17_'], 'SCPDURL': ['/smp_15_']}, {'serviceType': ['urn:schemas-upnp-org:service:AVTransport:1'], 'serviceId': ['urn:upnp-org:serviceId:AVTransport'], 'controlURL': ['/smp_19_'], 'eventSubURL': ['/smp_20_'], 'SCPDURL': ['/smp_18_']}]}], 'sec:ProductCap': ['Y2014,WebURIPlayable,SeekTRACK_NR,NavigateInPause,ScreenMirroringP2PMAC=5e:49:7d:b3:1d:2b'], 'pnpx:X_hardwareId': ['VEN_0105&DEV_VD0001']}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED32
INFO:DlnapDevice:control_url: /smp_19_
INFO:DlnapDevice:rendering_control_url: /smp_13_
INFO:DlnapDevice:=> Initialization completed
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 401
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Stop"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:Stop xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><Speed>1</Speed>
               </u:Stop>
            </s:Body>
         </s:Envelope>
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 532
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><CurrentURI>http://10.0.200.24:8000//home/mnemonic/Videos/aviao.mp4</CurrentURI><CurrentURIMetaData></CurrentURIMetaData>
               </u:SetAVTransportURI>
            </s:Body>
         </s:Envelope>
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 401
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><Speed>1</Speed>
               </u:Play>
            </s:Body>
         </s:Envelope>
----------------------------------------
Exception happened during processing of request from ('10.0.200.86', 44253)
Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.6/socketserver.py", line 696, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/home/mnemonic/bin/dlnap.py", line 295, in do_GET
    shutil.copyfileobj(f, self.wfile)
  File "/usr/lib/python3.6/shutil.py", line 79, in copyfileobj
    buf = fsrc.read(length)
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xee in position 31: invalid continuation byte
----------------------------------------

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
semeioncommented, Oct 17, 2017

Finally I was able to figure out the problem, unfortunately the problem is the internal python proxy server that does not seem to work properly. The --proxy option does not work as it should.

I installed apache and set up a URL pointing to it and it worked correctly.

USING APACHE LIKE PROXY WORKED:

$ dlnap.py --device tv --play http://10.0.200.24/~mnemonic/aviao.mp4 --log debug

INFO:DlnapDevice:=> New DlnapDevice (ip = 10.0.200.86) initialization..
INFO:DlnapDevice:location: http://10.0.200.86:7676/smp_11_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u'root': [{u'device': [{u'manufacturerURL': [u'http://www.samsung.com/sec'], u'serviceList': [{u'service': [{u'controlURL': [u'/smp_13_'], u'serviceType': [u'urn:schemas-upnp-org:service:RenderingControl:1'], u'serviceId': [u'urn:upnp-org:serviceId:RenderingControl'], u'eventSubURL': [u'/smp_14_'], u'SCPDURL': [u'/smp_12_']}, {u'controlURL': [u'/smp_16_'], u'serviceType': [u'urn:schemas-upnp-org:service:ConnectionManager:1'], u'serviceId': [u'urn:upnp-org:serviceId:ConnectionManager'], u'eventSubURL': [u'/smp_17_'], u'SCPDURL': [u'/smp_15_']}, {u'controlURL': [u'/smp_19_'], u'serviceType': [u'urn:schemas-upnp-org:service:AVTransport:1'], u'serviceId': [u'urn:upnp-org:serviceId:AVTransport'], u'eventSubURL': [u'/smp_20_'], u'SCPDURL': [u'/smp_18_']}]}], u'modelName': [u'UN32J4303'], u'iconList': [{u'icon': [{u'mimetype': [u'image/jpeg'], u'width': [u'48'], u'depth': [u'24'], u'url': [u'/dmr/icon_SML.jpg'], u'height': [u'48']}, {u'mimetype': [u'image/jpeg'], u'width': [u'120'], u'depth': [u'24'], u'url': [u'/dmr/icon_LRG.jpg'], u'height': [u'120']}, {u'mimetype': [u'image/png'], u'width': [u'48'], u'depth': [u'24'], u'url': [u'/dmr/icon_SML.png'], u'height': [u'48']}, {u'mimetype': [u'image/png'], u'width': [u'120'], u'depth': [u'24'], u'url': [u'/dmr/icon_LRG.png'], u'height': [u'120']}]}], u'dlna:X_DLNADOC': [u'DMR-1.50'], u'df:X_deviceCategory': [u'Display.TV.LCD Multimedia.DMR'], u'serialNumber': [u'20110517DMR'], u'sec:deviceID': [u'CPCHDC2MYPGGE'], u'pnpx:X_compatibleId': [u'MS_DigitalMediaDeviceClass_DMR_V001'], u'sec:ProductCap': [u'Y2014,WebURIPlayable,SeekTRACK_NR,NavigateInPause,ScreenMirroringP2PMAC=5e:49:7d:b3:1d:2b'], u'modelNumber': [u'AllShare1.0'], u'deviceType': [u'urn:schemas-upnp-org:device:MediaRenderer:1'], u'friendlyName': [u'[TV]Samsung LED32'], u'modelURL': [u'http://www.samsung.com/sec'], u'modelDescription': [u'Samsung TV DMR'], u'UDN': [u'uuid:1017df81-000e-1000-aa9a-b8bbaff0dbce'], u'pnpx:X_hardwareId': [u'VEN_0105&amp;DEV_VD0001'], u'manufacturer': [u'Samsung Electronics']}], u'specVersion': [{u'major': [u'1'], u'minor': [u'0']}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED32
INFO:DlnapDevice:control_url: /smp_19_
INFO:DlnapDevice:rendering_control_url: /smp_13_
INFO:DlnapDevice:=> Initialization completed
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 401
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Stop"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:Stop xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><Speed>1</Speed>
               </u:Stop>
            </s:Body>
         </s:Envelope>
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 515
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><CurrentURIMetaData></CurrentURIMetaData><CurrentURI>http://10.0.200.24/~mnemonic/aviao.mp4</CurrentURI>
               </u:SetAVTransportURI>
            </s:Body>
         </s:Envelope>
DEBUG:DlnapDevice:POST /smp_19_ HTTP/1.1
User-Agent: /home/mnemonic/bin/dlnap.py/0.15
Accept: */*
Content-Type: text/xml; charset="utf-8"
HOST: 10.0.200.86:7676
Content-Length: 401
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"
Connection: close

<?xml version="1.0" encoding="utf-8"?>
         <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <s:Body>
               <u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
                  <InstanceID>0</InstanceID><Speed>1</Speed>
               </u:Play>
            </s:Body>
         </s:Envelope>
[TV]Samsung LED32 @ 10.0.200.86

I also maybe noticed a bug in the script, when using a local URL the address sometimes goes wrong with // between the URLs

For example, using the command:

$ dlnap.py --device tv --play ~/Videos/Logitech_Mouse_Trackman_M570__Repair_Left_Click_Problem.mkv --proxy --log debug

It will cause a CurrentURI:

<InstanceID>0</ InstanceID><CurrentURI>http://10.0.200.24:8000//home/mnemonic/Videos/Logitech_Mouse_Trackman_M570__Repair_Left_Click_Problem.mkv</CurrentURI><CurrentURIMetaData></ CurrentURIMetaData></u: SetAVTransportURI>

Note that the address is // inserted, i don´t know if it is a bug in the script.

About the python internal proxy error, i googled the error and found somethings, maybe it help you to fix the bug:

https://stackoverflow.com/questions/5525915/python-socketserver-error-upon-connection https://stackoverflow.com/questions/12019189/python-socket-server-error https://stackoverflow.com/questions/28779942/python-http-server-giving-error-when-connected-to https://github.com/Steveice10/FBI/issues/318

I am not a python developer, but i think the proxy implementation in the script have a bug.

I hope you can fix it because this script is very nice.

Thank you in advance.

1reaction
cherezovcommented, Oct 17, 2017

I wonder if this reproducible with python 3.4 and/or with other video file?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to troubleshoot the Samsung TV that will not turn on
Ensure that your cable and outlet work properly. First, ensure that all the cabling is firmly inserted. Leave the TV unplugged for 30...
Read more >
How to Fix a Samsung TV that Won't Turn On - YouTube
Here are some simple steps to take to fix a Samsung TV that won't turn on. Please take a moment and Subscribe for...
Read more >
How to Fix a Samsung TV That Won't Turn On - Alphr
You may need to reset your remote control. Remove the batteries, then press and hold the “Power button” for about eight seconds. After...
Read more >
Samsung TV No Sound—What to Do? - Alphr
1. The first things to try are, of course, the simplest ones. If you have a picture on your TV but no sound,...
Read more >
Samsung TV Won't Turn On (You Should Try This Fix FIRST)
If your Samsung TV won't turn on you need to reset it. Unplug your TV and wait a full 60 seconds. While the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found