Code Monkey home page Code Monkey logo

Comments (8)

eslavnov avatar eslavnov commented on May 28, 2024

Thanks for the report! Do you get any kind of an error message (you might have to specify 'verbose' as True in the settings)?

from pylips.

eslavnov avatar eslavnov commented on May 28, 2024

Also, please attach the results of https://ip-address:1926/6/system (or http://ip-address:1925/6/system if the first does not work). Thanks!

from pylips.

marcelser avatar marcelser commented on May 28, 2024

The error is this one:
Sending GET request to http://192.168.10.78:1925/6/activities/current
Request sent!

<title>Not Found</title>Not Found Traceback (most recent call last): File "pylips.py.backup", line 453, in pylips = Pylips(os.path.dirname(os.path.realpath(__file__))+"/settings.ini") File "pylips.py.backup", line 97, in __init__ self.start_mqtt_updater(self.verbose) File "pylips.py.backup", line 447, in start_mqtt_updater self.mqtt_update_app() File "pylips.py.backup", line 413, in mqtt_update_app actv_status=json.loads(actv_status) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Here's the output of the /6/system output
{

"menulanguage": "German",
"name": "55OLED754/12",
"country": "Switzerland",
"serialnumber_encrypted": "K2kseVsmQFgkd15gKkJ+aqKgAW0YsiYm18R34DasGA4=",
"softwareversion_encrypted": "K2kseVsmQFgkd15gKkJ+amueMe3DHAmDQ8d/R/pbq76od3Wmqm0WSs8gfLFv0gbo",
"model_encrypted": "K2kseVsmQFgkd15gKkJ+aoVYVbm8KvlYgfINFpkYHig=",
"deviceid_encrypted": "K2kseVsmQFgkd15gKkJ+aoHwEy/f1mmf7qHz4lUYUPU=",
"nettvversion": "4.6.0.1",
"epgsource": "no_epg",
"api_version": {
"Major": 6,
"Minor": 1,
"Patch": 0
},
"featuring": {
"jsonfeatures": {
"recordings": [
"List",
"Schedule",
"Manage"
],
"ambilight": [
"Hue",
"HueStreaming",
"Ambilight"
],
"textentry": [
"context_based",
"initial_string_available"
],
"inputkey": [
"key",
"unicode"
],
"pointer": [
"context_based"
],
"activities": [
"browser"
]
},
"systemfeatures": {
"tvtype": "consumer",
"content": [
"dmr"
],
"pairing_type": "none",
"companion_screen": true,
"os_type": "Linux"
}
}
}

BTW: I commented out the call to activities and set the return value to 'None'. Then I ran into this error:

Sending POST request to http://192.168.10.78:1925/6/menuitems/settings/current
Request sent!
{
"version": 1,
"values": [
{
"value": {

                    }
            }
    ]

}

Traceback (most recent call last):
File "pylips.py.fixed_act", line 454, in
pylips = Pylips(os.path.dirname(os.path.realpath(file))+"/settings.ini")
File "pylips.py.fixed_act", line 97, in init
self.start_mqtt_updater(self.verbose)
File "pylips.py.fixed_act", line 450, in start_mqtt_updater
self.mqtt_update_ambihue()
File "pylips.py.fixed_act", line 405, in mqtt_update_ambihue
ambihue = ambihue_status["values"][0]["value"]["data"]["value"]
KeyError: 'data'

So I also had to comment out the call to the ambilight because the return value did not expect the returned json value. So I commented out this call as well in the same manner. So currently my pylips is running with some ugly hacks. Would be nice to have a proper detection of this case.

PPS: The system call needs to go to port 1925 because this TV runs on Philips SAPHI OS instead of Android.

It seems that some other URLs also don't work or have changed in SAPHI. For example I can turn on/off the ambilight in the Philips TV Remote App but not in pylips.

from pylips.

eslavnov avatar eslavnov commented on May 28, 2024

Thanks, this is very useful!

Did not know about the SAPHI OS (it flew completely under my radar), and it seems to behave slightly differently than Android/old non-Android TVs. That's why some endpoints like activities fail (it's for Android TVs) and the errors are not handled correctly (they are different from non-Android TVs).

Since I don't have such a TV to reverse-engineer it, the best I can do for now is basically repeat your hack - e.g. just skip the endpoints that don't return the expected data. However, if you install Charles and send me the captured traffic between the TV and Philips TV Remote App, then I'll be able to add support for SAPHI TVs.

from pylips.

albertomarrod avatar albertomarrod commented on May 28, 2024

Thanks, this is very useful!

Did not know about the SAPHI OS (it flew completely under my radar), and it seems to behave slightly differently than Android/old non-Android TVs. That's why some endpoints like activities fail (it's for Android TVs) and the errors are not handled correctly (they are different from non-Android TVs).

Since I don't have such a TV to reverse-engineer it, the best I can do for now is basically repeat your hack - e.g. just skip the endpoints that don't return the expected data. However, if you install Charles and send me the captured traffic between the TV and Philips TV Remote App, then I'll be able to add support for SAPHI TVs.

Hi! Maybe I can "help" you with this. I am a Saphi TV owner and I have no idea how to add the support for SAPHI TVs.

I guess I should install Charles on my laptop and then listen the ports of the TV. If I am wrong just tell me how to help you with this.

BTW: Thank you so much for your effort and for such a great work you made

from pylips.

eslavnov avatar eslavnov commented on May 28, 2024

Hey @albertomarrod,

Thanks for offering your help! To add support for SAPHI OS, I would require the following:

  1. List of pylips commands that do not work as expected on SAPHI OS
  2. For each of this commands, I'll need a saved Charles session with you using these commands via the Philips mobile remote app. Then I can take a look at the sent packets and reverse-engineer such commands.

If you choose to do it, please split these commands into different Charles sessions (otherwise it can be hard to figure out which request triggers which command)!

from pylips.

albertomarrod avatar albertomarrod commented on May 28, 2024

Hey @albertomarrod,

Thanks for offering your help! To add support for SAPHI OS, I would require the following:

  1. List of pylips commands that do not work as expected on SAPHI OS
  2. For each of this commands, I'll need a saved Charles session with you using these commands via the Philips mobile remote app. Then I can take a look at the sent packets and reverse-engineer such commands.

If you choose to do it, please split these commands into different Charles sessions (otherwise it can be hard to figure out which request triggers which command)

Hy @eslavnov,

I just start trying pylips and I am having the same issue than people on here #62.

I attached the issue I am getting... Maybe you will be able to help me more.

Thanks!

Pylips

Edit: My TV model is 65PUS6703

from pylips.

emivaljr avatar emivaljr commented on May 28, 2024

@albertomarrod I had the same issue on my Saphi OS TV and the solution is to enable WoWLAN option:
Network -> Switch on with Wi-FI(WoWLAN). It comes by default off.
After that, I was able to call the API on 1925 port.

from pylips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.