Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
711 stars 191 forks source link

Error: Operation now in progress #57

Closed Walek001 closed 6 years ago

Walek001 commented 6 years ago

Hi!

When I type command sudo python3 -m samsungctl --host 192.168.1.110 --port 8001 KEY_MUTE --method websocket in my terminal I see this error:

Error: Operation now in progress

I think this is from web socket, but do not know workaround. Do not see this message in your code.

My TV is H6640.

Ape commented 6 years ago

Are you using samsungctl 0.7.0? Does this happen with 0.6.0?

Walek001 commented 6 years ago

Using 0.7.0, i go deeper today and I think this is web socket error

Ape commented 6 years ago

Could you try 0.6.0?

baloo887 commented 6 years ago

Hi Ape, same issue for me with 0.7.0 my command is: samsungctl --host 192.168.1.110 --port 8001 KEY_MUTE --method websocket

I also tried with 0.6.0, with the same command. In this case I dont get any error but nothing happens . My samsung tv model is UE40JU6400

Walek001 commented 6 years ago

@Ape yes, in next 3 days I do it. Also try run app in debug mode to catch where this exception is throwed.

teeedubb commented 6 years ago

Hi,

Thanks for your work on this program - its very handy and more reliable than CEC.

I too started getting this error after upgrading to 0.7.0. The same command worked OK in the previous version (sorry, I dont know what version it was)

/home/blaster/.local/bin/samsungctl --host 192.168.123.203 --method websocket --name blaster KEY_POWER Traceback (most recent call last): File "/home/blaster/.local/bin/samsungctl", line 11, in <module> sys.exit(main()) File "/home/blaster/.local/lib/python2.7/site-packages/samsungctl/__main__.py", line 105, in main with Remote(config) as remote: File "/home/blaster/.local/lib/python2.7/site-packages/samsungctl/remote.py", line 10, in __init__ self.remote = RemoteWebsocket(config) File "/home/blaster/.local/lib/python2.7/site-packages/samsungctl/remote_websocket.py", line 22, in __init__ self._serialize_string(config["name"])), config["timeout"]) File "/usr/lib/python2.7/dist-packages/websocket/_core.py", line 219, in create_connection websock.connect(url, **options) File "/usr/lib/python2.7/dist-packages/websocket/_core.py", line 438, in connect self.sock.connect(address) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 115] Operation now in progress

Ape commented 6 years ago

Can you test if reverting https://github.com/Ape/samsungctl/pull/55/files fixes the issue?

teeedubb commented 6 years ago

How would I do that? I installed via PIP on ubuntu 16.04 if that helps

Ape commented 6 years ago

@teeedubb Something like this:

$ git clone git@github.com:Ape/samsungctl.git
$ git checkout 0.7.0
$ python -m samsungctl # verify that the bug occurs with 0.7.0
$ git revert fd1606bfa4
$ python -m samsungctl # check if the revert helped
teeedubb commented 6 years ago

Yep that fixes it

Ape commented 6 years ago

Can you try to set the timeout to some value? E.g. samsungclt --timeout 10 ...

@nunofgs Do you any ideas?

teeedubb commented 6 years ago

0.7.0 works when setting a timeout value

nunofgs commented 6 years ago

@Ape yep looks like the default timeout of 0 is setting an actual timeout of 0 in the websocket client. In order to get the default timeout, we'd need to pass None.

I'll submit a PR shortly to fix this.

teeedubb commented 6 years ago

Thanks!