Persistent error coming from libusb0

379 views Asked by At

I'm using a Python application that accesses a USB device (pipsta printer) and executes a routine. It's running fine outside the container, but when it comes to the container it returns a error like this:

(File "usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 386, in _check: raise USBError(errmsg, ret) USB.core.USBError: [Errno None] couldn't opendir(): No such a file or directory)

In my dockerfile, I've included all the packages relevant to Python and USB, and I also moved the relevant files to /etc/udev/rules.d and restarted udev.

2

There are 2 answers

1
user7368999 On

I know this is an old question (I've only just encountered it). The following is a paraphrasing of the FAQ. The following steps should help diagnose the problem.

  1. Download the latest set of Pipsta examples..
  2. Extract the contents of the zip file.
  3. Change directory to where the files were extracted
  4. Change directory to the Examples folder.
  5. Using a terminal run the command python verify_pipsta_install.py. This will try and help diagnose problems.

The following will should fix the python usb library error.

  1. If your Pipsta printer firmware is V9.2.03 please upgrade the firmware to V9.2.08 using the fpu (both can be found in the downloads section of bit bucket.
  2. Install the latest version of the Pipsta examples (download from bitbucket).
  3. Copy the new pipsta/Examples/system_scripts/ to /etc/udev/rules.d/60-ablesystems-pyusb.rules
  4. Restart the Raspberry Pi

If the printer still fails to be discovered then -

The following workaround may work. 1. Unplug the printer from the USB port 1. Enter the command sudo lsusb 1. Reconnect the printer 1. Enter the command sudo lsusb

If the printer has been detected by the Linux environment then either /dev/ap1400 or /dev/pipsta should exist in the filesystem.

NOTE The Pipsta now has Debian packages to help with installation. I have a link limit on my account but search for pipsta-printer-utilities-1.1.1-Linux.deb and pipsta-cups-driver-0.3.0-armhf.deb for more information.

0
andrew.fox On

Make sure you:

  • followed every step from assembly instruction and https://bitbucket.org/ablesystems/pipsta/wiki/Pipsta%20First-Time%20Setup
  • printer is connected to the power
  • printer is connected via usb to raspberry
  • printer's led doesn't blink (should be green constantly)
  • proper usb library is installed (or try to install different version of the usb library). What version are you using? python: print(usb.__version__) , it works fine for me with version 1.0.0rc1
  • is printer visible to the os? command: ls /dev/ap1400