arvydas / blinkstick-python

BlinkStick Python interface to control devices connected to the computer
Other
136 stars 53 forks source link

Blinkstick Nano w/Buildroot #55

Open lukemk1 opened 6 years ago

lukemk1 commented 6 years ago

Hello,

I am attempting to get a blickstick nano functioning on my raspberry bi 3 model b running a system image generated by buildroot (this is for an embedded project concept).

I believe that I have included all necessary dependencies.

From within the blinkstick source folder I am able to successfully execute the following commands:

# python setup.py build
# python setup.py install

From here I attempt to run the following command:

# blinkstick --repeats 1000 --pulse green

But I am greeted by the following error:

Traceback (most recent call last):
  File "/usr/bin/blinkstick", line 4, in <module>
    __import__('pkg_resources').run_script('BlinkStick==1.1.8', 'blinkstick')
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1534, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.6/site-packages/BlinkStick-1.1.8-py3.6.egg/EGG-INFO/scripts/blinkstick", line 324, in <module>
  File "/usr/lib/python3.6/site-packages/BlinkStick-1.1.8-py3.6.egg/EGG-INFO/scripts/blinkstick", line 213, in main
  File "build/bdist.linux-armv7l/egg/blinkstick/blinkstick.py", line 1496, in find_all
  File "build/bdist.linux-armv7l/egg/blinkstick/blinkstick.py", line 1485, in _find_blicksticks
  File "/usr/lib/python3.6/site-packages/usb/core.py", line 1263, in find
    raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available

As a quick final note, the only blinkstick command that does not result in the above error is:

blinkstick --help

Any guidance/help would be much appreciated.

arvydas commented 6 years ago

Do you have libusb installed?

lukemk1 commented 6 years ago

Yes, I do.

Here are all the relevant files:

# find / | grep libusb
/usr/lib/libusbgx.so
/usr/lib/libusb.so
/usr/lib/libusb-1.0.so
/usr/lib/libusbgx.so.2
/usr/lib/libusb-0.1.so.4.4.4
/usr/lib/python3.6/site-packages/libusb1-1.6.4-py3.6.egg-info
/usr/lib/python3.6/site-packages/libusb1-1.6.4-py3.6.egg-info/SOURCES.txt
/usr/lib/python3.6/site-packages/libusb1-1.6.4-py3.6.egg-info/PKG-INFO
/usr/lib/python3.6/site-packages/libusb1-1.6.4-py3.6.egg-info/top_level.txt
/usr/lib/python3.6/site-packages/libusb1-1.6.4-py3.6.egg-info/dependency_links.txt
/usr/lib/python3.6/site-packages/usb1/libusb1.pyc
/usr/lib/python3.6/site-packages/usb1/libusb1.py
/usr/lib/python3.6/site-packages/libusb1.pyc
/usr/lib/python3.6/site-packages/libusb1.py
/usr/lib/python3.6/site-packages/usb/backend/libusb0.pyc
/usr/lib/python3.6/site-packages/usb/backend/libusb1.pyc
/usr/lib/python3.6/site-packages/usb/backend/libusb1.py
/usr/lib/python3.6/site-packages/usb/backend/libusb0.py
/usr/lib/libusbgx.so.2.0.0
/usr/lib/libusb-0.1.so.4
/usr/lib/libusb-1.0.so.0.1.0
/usr/lib/libusb-1.0.so.0
/lib/libusb.so
find: /proc/17706: No such file or directory

Let me know if I am missing something.

arvydas commented 6 years ago

Can you try to ln libusb to /usr/local/lib similar to how this is done for MacOSX fix in the readme?

lukemk1 commented 6 years ago

So, the /usr/local/lib directory does not exist within my buildroot system. I'm not certain as to the specifics but I don't know if there is an alternative folder or if everything is collapsed into /usr/lib (I will do some research and get back to you).

# ls -al /usr/
- bin
- lib
- lib32 -> lib
- libexec
- sbin
- share

Do you think this might be the issue? But I did attempt to create the directory and add the links but the errors persist nonetheless.

lukemk1 commented 6 years ago

@arvydas I wanted to ping you again to see if you have any other ideas.

I've tried a handful of things, but have exhausted the options within my knowledge pool.

lukemk1 commented 6 years ago

@arvydas I'm pinging you again to see if you anticipate providing any additional assistance on resolving this issue. If not, then I will move on and look for a different LED option.

This is for a project concept that, in the end, would result in utilizing a significant number of units and thus, development time is critical.

I'd appreciate your candor so that I don't spend more time than necessary on my end.

Thanks.

arvydas commented 6 years ago

@lukemk1 will need a bit more details about how you are doing this here so that I could reproduce your issue. This seems to be an issue with PyUsb package and not BlinkStick. Are you using a tutorial that I could follow online to reproduce your issue?

lukemk1 commented 6 years ago

@arvydas It does seem to be a PyUsb issue. Unfortunately, I can't find any information to lead to some kind of a resolution anywhere online.

It will work on a generic Raspbian image, but with a Buildroot image does not. Even though I should have all the appropriate packages such as (but not limited to):

So I'm not sure where it's going wrong, unless there are other dependencies that are somehow not being accounted for.

I'm not using any tutorial as I'm familiar enough with Buildroot to do without.

But, here is a guide (using an old version) that should give you enough of an idea of the process:

https://cellux.github.io/articles/diy-linux-with-buildroot-part-1/

arvydas commented 6 years ago

@lukemk1 Thanks! Looks fun :) Will have a go at it tomorrow and will let you know if I need anything else.

lukemk1 commented 6 years ago

@arvydas Thanks for the assistance! If you have any questions let me know and I can help you out.