litra-driver icon indicating copy to clipboard operation
litra-driver copied to clipboard

"ValueError: Device not found" on Windows

Open sonofskywalker3 opened this issue 2 years ago • 3 comments

Maybe Windows isn't supported, but I'm trying to find a relatively simple solution for using my streamdeck to control the Litra Glow, without getting into all the hid stuff myself. I love the simplicity of this, but unfortunately it's not working "out of the box" for me. I already had python and pip installed, so I updated pip, installed litra-driver and tried to run it. The UI comes up, but when I select the on button or when I try the lc on command it fails and says "ValueError: Device not found" Here's the complete output:

C:\Users\Jeff>lc on Traceback (most recent call last): File "c:\users\jeff\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\jeff\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Jeff\AppData\Local\Programs\Python\Python39\Scripts\lc.exe\__main__.py", line 7, in <module> File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\llgd\cli\cli.py", line 77, in main fire.Fire({ File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\llgd\cli\cli.py", line 28, in on light_on() File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\llgd\lib\llgd_lib.py", line 68, in light_on dev, reattach = setup() File "c:\users\jeff\appdata\local\programs\python\python39\lib\site-packages\llgd\lib\llgd_lib.py", line 34, in setup raise ValueError('Device not found') ValueError: Device not found

I also ran pip install libusb since I saw it referenced in previous issues. Oh, and I made sure GHub isn't running, and unplugged/replugged already. Got the same result in commandline and powershell, haven't tried WSL yet. Sorry if I'm just making a dumb mistake here, I'm not a coder, but I do design and support software for a living, so I can usually follow developer directions.

sonofskywalker3 avatar Jul 13 '22 15:07 sonofskywalker3

Made it working in Windows 11 \o/ The solution is in this post: https://nyorikakar.medium.com/printing-with-python-and-epson-pos-printer-fbd17e127b6c

My steps:

  • Copy libusb-1.0.dll from libusb in C:\Windows\System32
  • pip install libusb pyusb
  • pip install litra-driver
  • Run Zadig and change the driver for Litra Glow to WinUSB
  • Modfy the litra-driver source by commenting out the block which checks for kernel driver in lldg_lib.py (for me this was in: %HOME%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\llgd\lib)
    #try:
    #    if dev.is_kernel_driver_active(0):
    #        logging.debug("kernel driver active")
    #        reattach = True
    #        dev.detach_kernel_driver(0)
    #    else:
    #        logging.debug("kernel driver not active")

    #except AttributeError:
    #    logging.debug(
    #        '"is_kernel_driver_active()" method not found. Continuing')
  • Start lcui.exe from the installation path of litra-driver (for me %HOME%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\lcui.exe ) and enjoy!

unconfigured avatar Oct 24 '22 20:10 unconfigured

Sadly the device turns off most of the times when move the sliders (sometimes it changes brigtness/color)... So there is another issue. But at least it connects and reacts - the basic stuff seems to be there.

unconfigured avatar Oct 24 '22 20:10 unconfigured

Just a heads up that I've released a go version of this application , a single native executable for the cli and ui. Let me know if you can give it a try!

kharyam avatar Mar 07 '24 16:03 kharyam