dcnielsen90 / python-bravia-tv

MIT License
13 stars 6 forks source link

Not working with KDL-32EX650 #10

Closed jcassee closed 4 years ago

jcassee commented 4 years ago

According to the TV SideView page, I think this model should be supported. However, when I try to connect, it fails:

>>> from bravia_tv import BraviaRC
>>> b = BraviaRC('192.168.14.7')
>>> b.connect('0000', 'test', 'test device')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/joost/Ontwikkeling/Python/python-bravia-tv/bravia_tv/braviarc.py", line 63, in connect
    resp = self.bravia_req_json('accessControl', authorization, headers=headers)
  File "/home/joost/Ontwikkeling/Python/python-bravia-tv/bravia_tv/braviarc.py", line 138, in bravia_req_json
    return_value = json.loads(response.text)
  File "/home/joost/.pyenv/versions/3.8.2/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/joost/.pyenv/versions/3.8.2/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/joost/.pyenv/versions/3.8.2/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The reason is the request returns 404 Not Found.

I used Packet Capture on Android to sniff requests from the "Video & TV SideView" app, which can connect to the TV. I have attached six requests I captured from connecting the TV with the app:

request1.log request2.log request3.log request4.log request5.log request6.log

Does this help? Anything I can do to debug this problem further?

dcnielsen90 commented 4 years ago

The compatibility list in the README referenced an application that uses a different protocol then this library. This would likely require a rewrite. I am open to PRs that increase the compatibility; however I unfortunately do not have the time to reverse engineer sideview app. I apologize for the time you have spent on this due to the misinformation in our README.

As of the newest release, we have updated the README and the library to better reflect what is and is not compatible with this library.

jcassee commented 4 years ago

@dcnielsen90 No problem. Thanks for the info, and for updating the documentation. It's an older TV and I think time is better spent on newer models..