2

I have and old scanner compatible with sane-backends.

I want to install the sane backends on my Mac (macOS 10.14 Mojave).

The scanner is an USB one, so libusb library is required.

What I have done:

I have MacPorts, so I installed libusb and libusb-compat from there.

Then I downloaded the source of sane-backends from their GitLab repository. I made the ./configure with these arguments in it: ./configure --CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" BACKENDS='hp5590' I had to use the CFLAGS and LDFLAGS because otherwise sane-backends gave me and error “usb.h can’t be find” or something similar. Than I included only my scanner in BACKENDS because there was an error with the make, something to do with another scanner.

If I type sane-find-scanner it works. So I suppose I have installed it correctly.

What’s the problem now?

It cannot find my scanner. And... if I type sane-find-scanner -v this is the result (I omitted unnecessary stuff):

This is sane-find-scanner from sane-backends 1.0.27git

[...]

searching for USB scanners:
libusb not available
    # No USB scanners found. If you expected something different, make sure that
    # you have loaded a kernel driver for your USB host controller and have setup
    # the USB system correctly. See man sane-usb for details.
    # SANE has been built without libusb support. This may be a reason
    # for not detecting USB scanners. Read README for more details.

Maybe useful:

MBP-di-Umberto:~ umberto$ which sane-find-scanner
/opt/local/bin/sane-find-scanner

MBP-di-Umberto:~ umberto$ pkg-config --cflags --libs libusb
-I/opt/local/include -I/opt/local/include/libusb-1.0 -L/opt/local/lib -lusb

MBP-di-Umberto:~ umberto$ port contents libusb
Port libusb contains:
  /opt/local/include/libusb-1.0/libusb.h
  /opt/local/lib/libusb-1.0.0.dylib
  /opt/local/lib/libusb-1.0.a
  /opt/local/lib/libusb-1.0.dylib
  /opt/local/lib/pkgconfig/libusb-1.0.pc

MBP-di-Umberto:~ umberto$ port contents libusb-compat
Port libusb-compat contains:
  /opt/local/bin/libusb-config
  /opt/local/include/usb.h
  /opt/local/lib/libusb-0.1.4.dylib
  /opt/local/lib/libusb.a
  /opt/local/lib/libusb.dylib
  /opt/local/lib/pkgconfig/libusb.pc

EDIT

I solved this. “Magically”* libusb has been found. I uninstalled sane-backends and reinstalled it without CFLAGS etc. in the default directory (/usr/local).

Make sure, if you installed it with a --prefix, if you did ./configure again without the --prefix, in order to do make uninstall you have to rerun ./configure with the original --prefix. Just for saying...

*[EDIT: I suppose I have been using the 1.0.25 version that uses libusb-0.1 by default (I have 1.0). If you have libusb-1.0 but you are using sane-backends-1.0.25 you have to pass the --enable-libusb-1.0 argument to the ./configure. Since the version 1.0.27 libusb-1.0 is preferred, you don’t have to put your preference in ./configure --enable.... I think that was the “magic”.]

Problem now is “device is not configured”

That’s the output:

searching for USB scanners:
device 0x03f0/0x1305 at 020:005 is not configured
found USB scanner (vendor=0x05ac [Apple Inc.], product=0x821d [Bluetooth USB Host Controller]) at libusb:029:008
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

Also I would like the Bluetooth USB Host Controller not displaying in the list.

Umberto
  • 61
  • 4
  • I find I have to click **Apple menu**, **System Preferences**, **Printers and Scanners** and **Open scanner XYZ** before it will work with `libusb`. No idea why. – Mark Setchell Nov 01 '18 at 22:09
  • What do you mean for **Open scanner XYZ**? – Umberto Nov 04 '18 at 10:14
  • When you click **Printers and Scanners** it should show you a list of the attached printers and scanners on the left side. Click the one you want to use and then click **Open this scanner** on the right side. – Mark Setchell Nov 04 '18 at 10:17
  • If the scanner itself is recognized... The problem is my scanner doesn't appear in the System Preferences Printers and Scanners. I’m trying to make it works with the `scanimage` command. – Umberto Nov 04 '18 at 12:20

0 Answers0