Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not connect to UE55KS8090, TypeError on #develop #122

Open
vogler opened this issue Oct 7, 2019 · 3 comments
Open

Does not connect to UE55KS8090, TypeError on #develop #122

vogler opened this issue Oct 7, 2019 · 3 comments

Comments

@vogler
Copy link

vogler commented Oct 7, 2019

I'm currently using Ape/samsungctl but it only has KEY_HDMI which toggles HDMI inputs if one is already active. So I was happy to see this repo has KEY_HDMI1 as well. Sadly I can't get it to work.

Installed deps via pipenv (maybe add a Pipfile and Pipfile.lock (or poetry - IDK, not into Python)), and ran

$ pipenv run python -m samsungctl -v --host 192.168.178.24 --method websocket --name myremote KEY_VOLDOWN

but it just waits, doesn't output anything and the TV also shows no notification.
(Aside: it needed ^C^C^C^C to kill (threading issue I guess), of course ^\ works.)

Then I tried the develop branch, but got a TypeError:

$ pipenv run python -m samsungctl
get_logger_name: samsungctl
get_logger_name: samsungctl.upnp.UPNP_Device
get_logger_name: samsungctl.upnp.UPNP_Device.adapter_addresses
get_logger_name: samsungctl.upnp.UPNP_Device.discover
get_logger_name: samsungctl.upnp.UPNP_Device.action
get_logger_name: samsungctl.upnp.UPNP_Device.icon
get_logger_name: samsungctl.upnp.UPNP_Device.service
get_logger_name: samsungctl.upnp.UPNP_Device.embedded_device
get_logger_name: samsungctl.upnp.UPNP_Device.upnp_class
get_logger_name: samsungctl.upnp.discover
get_logger_name: samsungctl.upnp
get_logger_name: samsungctl.wake_on_lan
get_logger_name: samsungctl.remote_legacy
get_logger_name: samsungctl.websocket_base
get_logger_name: samsungctl.art_mode
get_logger_name: samsungctl.application
get_logger_name: samsungctl.remote_websocket
get_logger_name: samsungctl.remote_encrypted.crypto
get_logger_name: samsungctl.remote_encrypted
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/voglerr/samsungctl/samsungctl/__main__.py", line 391, in <module>
    main()
  File "/Users/voglerr/samsungctl/samsungctl/__main__.py", line 237, in main
    logger.setLevel(log_levels[args.verbose])
TypeError: list indices must be integers or slices, not NoneType
@vogler
Copy link
Author

vogler commented Oct 7, 2019

Ok, seems like the develop branch crashes without -v (and it no longer accepts --method).
Still, no luck:

$ pipenv run python -m samsungctl -v --host 192.168.178.24 --name myremote KEY_VOLDOWN
get_logger_name: samsungctl
get_logger_name: samsungctl.upnp.UPNP_Device
get_logger_name: samsungctl.upnp.UPNP_Device.adapter_addresses
get_logger_name: samsungctl.upnp.UPNP_Device.discover
get_logger_name: samsungctl.upnp.UPNP_Device.action
get_logger_name: samsungctl.upnp.UPNP_Device.icon
get_logger_name: samsungctl.upnp.UPNP_Device.service
get_logger_name: samsungctl.upnp.UPNP_Device.embedded_device
get_logger_name: samsungctl.upnp.UPNP_Device.upnp_class
get_logger_name: samsungctl.upnp.discover
get_logger_name: samsungctl.upnp
get_logger_name: samsungctl.wake_on_lan
get_logger_name: samsungctl.remote_legacy
get_logger_name: samsungctl.websocket_base
get_logger_name: samsungctl.art_mode
get_logger_name: samsungctl.application
get_logger_name: samsungctl.remote_websocket
get_logger_name: samsungctl.remote_encrypted.crypto
get_logger_name: samsungctl.remote_encrypted
Unable to discover any TV's
$ # returned without blocking

@vogler
Copy link
Author

vogler commented Oct 8, 2019

Seems like my TV does not accept KEY_HDMI1. I'm now back to using Ape:master with this workaround (cf. Ape#95 (comment)):

pipenv run python -m samsungctl -vv --host 192.168.178.24 --method websocket KEY_SOURCE KEY_DOWN KEY_RIGHT KEY_RIGHT KEY_ENTER

@vogler
Copy link
Author

vogler commented Oct 8, 2019

The original problem seems to be a deadlock:

$ pipenv run python -m samsungctl --host 192.168.178.24 --method websocket KEY_HDMI
Starting new HTTP connection (1): 192.168.178.24:8001
http://192.168.178.24:8001 "GET /api/v2/ HTTP/1.1" 200 1238
RemoteWrapper.__init__(config=<samsungctl.config.Config object at 0x104f68850>)
RemoteWrapper.__init__(config=<samsungctl.config.Config object at 0x104f68850>)
Starting new HTTP connection (1): 192.168.178.24:8001
http://192.168.178.24:8001 "GET /api/v2/ HTTP/1.1" 200 1238
RemoteWrapper.open()
RemoteWrapper.power()
RemoteWrapper.power => False
RemoteWrapper.power(value=True)
RemoteWrapper.power()
RemoteWrapper.power => False
RemoteWrapper.mac_address()
RemoteWrapper.mac_address => 'C0:97:27:19:F8:7E'
RemoteWrapper.mac_address()
RemoteWrapper.mac_address => 'C0:97:27:19:F8:7E'
RemoteWrapper.power()
RemoteWrapper.power => False
RemoteWrapper.open()
^CRemoteWrapper.mac_address()
RemoteWrapper.mac_address => 'C0:97:27:19:F8:7E'
RemoteWrapper.power()
RemoteWrapper.power => False
RemoteWrapper.open()
^CRemoteWrapper.mac_address()
RemoteWrapper.mac_address => 'C0:97:27:19:F8:7E'
RemoteWrapper.power()
RemoteWrapper.power => False
RemoteWrapper.open()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant