Closed mattjonesc closed 1 year ago
Hi mattjonesc, What hardware are you running on ? and version of operating system ? Are you running retropie ? The utility uses a python library pyusb. There are some Faq's that may well be able to help with the pyusb setup (which I think is the issue you are facing) https://github.com/pyusb/pyusb/blob/master/docs/faq.rst https://github.com/pyusb/pyusb/blob/master/README.rst the library does expect libusb to be installed - for retropie, this (if I remember correctly) is already pre-installed. You can check by running $ apt-cache policy libusb-1.0 or $ apt list libusb-1.0
to see if it is installed, if it isn't then you would need to install it Let me know how you get on (and what you did - I can then add that as an additional section in the help file for others)
Thanks,
Hi Shaun, thanks for the quick reply. I am running on a Pi 4 B 2gb. I am using recalbox, not retropie os. Recalbox is also linux based and using emulation station and retroarch. I am thinking what you have can be modified to work. That being said, I was able to install pyusb and it seems that only libusb1 was a pre-installed package. I have installed libusb now and reboot, but still getting the 'No backend available' exception. Below are the installed packages:
"# python3 ~/ipacultimateio/set-ultimateio-leds.py Exception found: No backend available
Package Version
certifi 2021.10.8 charset-normalizer 2.0.12 idna 3.3 importlib-metadata 6.6.0 importlib-resources 5.12.0 libusb 1.0.26b5 libusb1 2.0.1 packaging 23.1 paho-mqtt 1.4.0 pip 23.1.2 pkg-about 1.0.8 psutil 5.8.0 pycryptodomex 3.14.1 pygame 2.1.2 PyGObject 3.42.1 pyudev 0.22.0 pyusb 1.2.1 recalbox-configgen 1.0 requests 2.27.1 RPi.GPIO 0.7.0 setuptools 67.7.2 six 1.16.0 smbus 1.1 tomli 2.0.1 urllib3 1.26.9 wheel 0.40.0 zipp 3.15.0"
I will continue to try to traverse this exception with the pyusb documentation, but let me know if you have any other ideas.
EDIT: I see that this is the very first question in the pyusb FAQ, so I will attempt to run the debug script that they have provided and report back.
Hi there - so what did the command $ apt list libusb-1.0* return ?
The recalbox os doesn't have apt. Still learning, but it seems that it's different in that aspect from retropie os according to this post: https://forum.recalbox.com/topic/1726/sudo-command-not-found
I've been able to install your repo code as well as the additional python packages within the recalbox file structure which is similar to retropie. I've posted a question on the pyusb git Q&A based on what the debug response is:
import os os.environ['PYUSB_DEBUG'] = 'debug' import usb.core usb.core.find() 2023-05-15 17:00:29,757 ERROR:usb.libloader:'Libusb 1' could not be found 2023-05-15 17:00:29,758 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backe nd 2023-05-15 17:00:29,761 ERROR:usb.libloader:'OpenUSB library' could not be found 2023-05-15 17:00:29,762 ERROR:usb.backend.openusb:Error loading OpenUSB backend 2023-05-15 17:00:29,771 ERROR:usb.libloader:'Libusb 0' could not be found 2023-05-15 17:00:29,771 ERROR:usb.backend.libusb0:Error loading libusb 0.1 backe nd Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.10/site-packages/usb/core.py", line 1309, in find raise NoBackendError('No backend available') usb.core.NoBackendError: No backend available from usb.backend import libusb1 be = libusb1.get_backend() 2023-05-15 17:01:54,658 ERROR:usb.libloader:'Libusb 1' could not be found 2023-05-15 17:01:54,658 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend
Hi, so recalbox seems to be a very restricted, closed operating system - which means that out of the box you cannot install additional packages, which I think is needed. That, I think, is the problem here (as opposed to an issue with pyusb python package). You could ask the recalbox contributors to include the libusb package as part of their build and hope that is all that is missing, alternatively ask the project to support apt to allow other packages to be installed. I also found this article https://gitlab.com/recalbox/recalbox/-/issues/2265
looks like there is a way to copy the libusb files to recalbox by installing libusb on another machine first and then copying it across to the recalbox. Such as....
$apt update \
&& apt install -y libtool-bin libjson-c-dev git build-essential pkg-config libusb-1.0-0-dev
and then copying the libusb files to the recalbox
Copy /lib/aarch64-linux-gnu/libjson-c.so.5
to Recalbox in /lib/
.
Or if retropie provides all that you need it may be better to use that as a base.
Hope that helps.
Thanks Shaun. I actually found the same gitlab issue that you referenced and am exploring that route. I think that should get me there to at least be able to pass a command to the ultimarc board and configure the leds.
I agree, retropie would be my choice, however, another constraint that I am dealing with is that my interface is displayed on a CRT. This makes recalbox a better choice as it has support for CRTs out of the box. Batocera is another option, but it is also a buildroot OS so I would be dealing with the same issues as recalbox. Perhaps retropie will soon offer better CRT support and I can give it another shot.
I'm fine with closing this issue for now. I am sure I will reference your code if I can get the outlined method above to work. Thanks again for developing this and help with troubleshooting.
Thanks - will close the issue - hope it all goes well on getting libusb installed
I'm looking to get this configured with recalbox 9.0. I've followed the instructions and successfully installed the library and moved the udev rule. However, when running the python scripts -- set-ultimateio-leds.py, I am getting a 'No backend available' error. I've tried to traverse the device list scripts to identify what needs to be changed, but was hoping you could look into as I have been searching for an led controller that will work with my build of recalbox build.