Logitech / logi_craft_sdk

Provide (API) SDK specifications to map your app functions to Logitech Craft dial controller called "Crown".
575 stars 110 forks source link

Craft Python sample app #22

Open in06khattab opened 5 years ago

in06khattab commented 5 years ago

Sample Python executable is not working. I receive Error 403 Forbidden

The Sample C# app works fine.

This is what the manifest file looks like: image

The Python SDK sample is installed correctly in Logitech options: image

This is what it looks like when I run the craft.exe application: image

This is the error that I receive: `Slider receives focus Traceback (most recent call last): File "craft.py", line 323, in sliderFocus File "craft.py", line 338, in changeTool NameError: name 'ws' is not defined connect called... --- request header --- GET / HTTP/1.1 Upgrade: websocket Connection: Upgrade Host: 127.0.0.1:10134 Origin: http://127.0.0.1:10134 Sec-WebSocket-Key: tQzh2ylSomgH/2IhqVtt3Q== Sec-WebSocket-Version: 13


--- response header --- HTTP/1.1 403 Forbidden Server: WebSocket++/0.7.0

error from callback <bound method CraftClient.on_close of <main.CraftClient object at 0x03199130>>: on_close() missing 1 required positional argument: 'ws' File "site-packages\websocket_app.py", line 343, in _callback ComboBox receives focus Traceback (most recent call last): File "craft.py", line 313, in comboBoxFocus File "craft.py", line 338, in changeTool File "site-packages\websocket_app.py", line 155, in send websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed. ComboBox receives focus Traceback (most recent call last): File "craft.py", line 313, in comboBoxFocus File "craft.py", line 338, in changeTool File "site-packages\websocket_app.py", line 155, in send websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.`

naokihada commented 5 years ago

Hi @in06khattab

It appeared that latest websocket-client (currently 0.55) is not compatible and need to use older version (0.48 or before) with current sample code.

Following Python sample instruction need to be changed.

https://github.com/Logitech/logi_craft_sdk/tree/master/samples/CraftPython

NG: pip3 install websocket-client

OK: pip3 install websocket-client==0.48

If it is already installed, you can uninstall as following command. pip3 uninstall websocket-client

Please try again with older websocket-client

bmyonatan commented 4 years ago

I still receive 403 forbidden with websocket-client version 0.48. Any other suggestions?

IvarMatstoms commented 3 years ago

I could not get the examples or my own code working using the websocket library but switching to the websockets library the api works fine. I suspect it has something to do with the ssl connection but im not sure.