wallneradam / tc420

Python Library and CLI for TC420 (USB) LED Controller / Dimmer
GNU General Public License v3.0
22 stars 8 forks source link

not working in Win10 + python 3.9.5 + libusb 1.0.24b1 #10

Open aromanowski opened 2 years ago

aromanowski commented 2 years ago

Hi! I just tried to run this on Win10 after following the install instructions and I get the following error:

(base) C:\>tc420 time-sync
Traceback (most recent call last):
  File "c:\miniconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\miniconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Miniconda3\Scripts\tc420.exe\__main__.py", line 7, in <module>
  File "c:\miniconda3\lib\site-packages\tc420\__main__.py", line 300, in main
    cmd_group()
  File "c:\miniconda3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "c:\miniconda3\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "c:\miniconda3\lib\site-packages\click\core.py", line 1668, in invoke
    super().invoke(ctx)
  File "c:\miniconda3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\miniconda3\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "c:\miniconda3\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\miniconda3\lib\site-packages\tc420\__main__.py", line 79, in cmd_group
    ctx.obj.dev = TC420()
  File "c:\miniconda3\lib\site-packages\tc420\tc420.py", line 301, in __init__
    if self.dev.is_kernel_driver_active(0):
  File "c:\miniconda3\lib\site-packages\usb\core.py", line 1108, in is_kernel_driver_active
    return self._ctx.backend.is_kernel_driver_active(
  File "c:\miniconda3\lib\site-packages\usb\backend\libusb1.py", line 915, in is_kernel_driver_active
    return bool(_check(self.lib.libusb_kernel_driver_active(dev_handle.handle,
  File "c:\miniconda3\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform

libusb version is 1.0.24 (https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.24/libusb-1.0.24.7z/download) I copied: libusb-1.0.24\MinGW64\dll\libusb-1.0.dll -> Windows\System32 libusb-1.0.24\MinGW32\dll\libusb-1.0.dll -> Windows\SysWOW64

libusb-1.0.24\MinGW64\dll\libusb-1.0.lib -> Miniconda3\libs libusb-1.0.24\MinGW64\dll\libusb-1.0.lib -> Miniconda3\Library\lib

python is 3.9.5 with the following packages:

Package                Version
---------------------- -------------------
brotlipy               0.7.0
certifi                2021.5.30
cffi                   1.14.6
chardet                4.0.0
click                  8.0.3
colorama               0.4.4
conda                  4.10.3
conda-package-handling 1.7.3
cryptography           3.4.7
idna                   2.10
importlib-metadata     4.9.0
importlib-resources    5.4.0
libusb                 1.0.24b1
menuinst               1.4.16
packaging              21.3
pip                    21.1.3
pkg-about              1.0.3
pycosat                0.6.3
pycparser              2.20
pyOpenSSL              20.0.1
pyparsing              3.0.6
PySocks                1.7.1
pyusb                  1.2.1
pywin32                228
requests               2.25.1
ruamel-yaml-conda      0.15.100
setuptools             52.0.0.post20210125
six                    1.16.0
tc420                  0.2.1
tqdm                   4.61.2
urllib3                1.26.6
wheel                  0.36.2
win-inet-pton          1.1.0
wincertstore           0.2
zipp                   3.6.0

Can you help me understand what to do to make this work?

Thank you!

sasax commented 2 years ago

https://github.com/wallneradam/tc420/blob/b20468e5da8e4ceddbb2a9fbe1d7e5aa78e75418/tc420/__main__.py#L286

I had trouble with this method and this two @-commands. I removed the whole method and it worked on my raspberry pi with python3.9