Git Product home page Git Product logo

airsane's Introduction

build

AirSane

AirSane is a SANE frontend, and a scanner server that supports Apple's AirScan protocol. Scanners are detected automatically, and published through mDNS. Acquired images may be transferred in JPEG, PNG, and PDF/raster format.

AirSane's intended purpose is to be used with AirScan/eSCL clients such as Apple's Image Capture, sane-airscan on Linux, and the eSCL client built into Windows 10 and 11.

In addition to the AirScan/eSCL server functionality, a simple web interface is provided.

Images are encoded on-the-fly during acquisition, keeping memory/storage demands low. Thus, AirSane will run fine on a Raspberry Pi or similar device.

Authentication and secure communication are supported in conjunction with a proxy server such as nginx (see the https readme file).

If you are looking for a powerful SANE web frontend, AirSane may not be for you. You may be interested in scanservjs instead.

AirSane has been developed by reverse-engineering the communication protocol implemented in Apple's AirScanScanner client (macos 10.12.6, /System/Library/Image Capture/Devices/AirScanScanner.app).

Regarding the mDNS announcement, and the basic working of the eSCL protocol, David Poole's blog was very helpful.

In the meantime, the eSCL protocol has been officially published here.

Usage

Web interface

Open http://machine-name:8090/ in a web browser, and follow a scanner link from the main page.

macOS

When opening 'Image Capture', 'Preview', or other applications using the ImageKit framework, scanners exported by AirSane should be immediately available.

In the 'Printers and Scanners' control panel, exported scanners will be listed with a type of 'Bonjour Scanner'.

A macOS compatible scanner plugin for the "GIMP" image editing software is provided here.

If you define a custom icon for your scanner (see below), note that you will have to use the scanner through 'Image Capture' once before it will be shown with this icon in 'Printers and Scanners'. This seems to be a bug in macOS at least up to Catalina.

Linux

Install the sane-airscan backend with

sudo apt-get install sane-airscan

or whatever the packet manager of your distribution requires to install it. Using sudo nano /etc/sane.d/dll.conf, add a line "airscan", and prepend a # character before the "escl" entry if present. (There are two airscan backends, called "escl" and "airscan", but only "airscan" is compatible with AirSane.) When done, scanimage -L should list your AirSane devices, and SANE clients such as XSane or simple-scan should be able to scan from them.

Windows

eSCL support in Windows has been introduced in Windows 11 first, but is now available in Windows 10 as well: https://support.microsoft.com/en-us/topic/june-28-2022-kb5014666-os-builds-19042-1806-19043-1806-and-19044-1806-preview-4bd911df-f290-4753-bdec-a83bc8709eb6

Connecting to an AirSane scanner

Go to "Settings"->"Bluetooth & devices"->"Printers and Scanners." There, click "Add Device". AirSane devices will appear as devices to add, click "Add". Wait until the device appears in the list of devices below, click the device, and choose "Install app" or "Open scanner" in order to install the Microsoft scanner app, or open it if has been installed before. Note that Windows does not allow more than 4 AirSane scanners in total.

Mopria client on Android

As of version 1.4.10, the Mopria Scan App will detect all AirSane scanners and display them with name and icon. After choosing scan options, you will be able to scan to your android device.

Installation

Build and install from source for OpenWRT

Build files and instructions for OpenWRT are published here: https://github.com/cmangla/AirSane-openwrt

Build and install from source on macOS

AirSane may be run on a macOS installation in order to serve locally attached scanners to eSCL clients such as Apple Image Capture. For instructions, see the macOS README file.

Build and install from source on Debian/Ubuntu/Raspbian

Build

sudo apt-get install libsane-dev libjpeg-dev libpng-dev
sudo apt-get install libavahi-client-dev libusb-1.*-dev
sudo apt-get install git cmake g++
git clone https://github.com/SimulPiscator/AirSane.git
mkdir AirSane-build && cd AirSane-build
cmake ../AirSane
make

Install

The provided systemd service file assumes that user and group 'saned' exist and have permission to access scanners. Installing the sane-utils package is a convenient way to set up a user 'saned' with proper permissions:

sudo apt-get install sane-utils

Make sure that sudo scanimage -L lists all scanners attached to your machine. Listing scanners as user 'saned' should show all scanners as well:

sudo -u saned scanimage -L

If all scanners are listed for 'root' but none for 'saned,' you might have hit a bug in libsane. As a workaround, create a file /etc/udev/rules.d/65-libsane.rules with this content:

ENV{libsane_matched}=="yes", RUN+="/usr/bin/setfacl -m g:scanner:rw $env{DEVNAME}"

Double-check the location of the setfacl binary using which setfacl, adapt the line if necessary. Unplug and re-plug all scanners. sudo -u saned scanimage -L should now list all of them.

To install AirSane:

sudo apt-get install avahi-daemon
make && sudo make install
sudo systemctl enable airsaned
sudo systemctl start airsaned
sudo systemctl status airsaned

Disable saned if you are not using it:

sudo systemctl disable saned

Disable unused scanner backends to speed up device search:

sudo nano /etc/sane.d/dll.conf

The server's listening port, and other configuration details, may be changed by editing '/etc/default/airsane'. For options, and their meanings, run

airsaned --help

By default, the server listens on all local addresses, and on port 8090.

To verify http access, open http://localhost:8090/ in a web browser. From there, follow a link to a scanner page, and click the 'update preview' button for a preview scan.

Optional configuration

In addition to the options that may be configured through /etc/default/airsane, it is possible to configure options to be used when scanning from a certain device. To specify such options, create a file /etc/airsane/options.conf, readable by user saned.
This file may contain the following kinds of lines:

  • Empty lines, and comment lines starting with #, will be ignored.
  • Lines beginning with the word device, followed with a regular expression,
    will begin a device section that applies to all devices with SANE device name or make-and-model string matching the regular expression.
  • Lines beginning with an option name, and an option value separated by white space, will define an option.
    Options at the top of the file are applied to all scanners. If a scanner matches multiple device lines,
    options from all of these device sections will be applied.
    Options may be SANE backend options, or AirSane device options (see below).

SANE backend options

To display the SANE options supported by a device, use sudo -u saned scanimage -L to get its SANE name, and then sudo -u saned scanimage -d <device name> -A to get a list of options.
In options.conf, SANE options must be given without leading minus signs, and with white space between the option's name and its value. White space is removed from the beginnning and the end of the value.

AirSane device options

gray-gamma

A gamma value that is applied to grayscale image data before transmission. The gamma value is given as a floating-point value.

color-gamma

A gamma value that is applied to color image data before transmission, using identical gamma values for all components.

synthesize-gray

A value of yes or no. If set to yes, AirSane will always request color data from the SANE backend, even if the user requests a grayscale scan. In this case, grayscale values will be computed from RGB component data after gamma correction, using weights as suited for sRGB data:
Y = 0.2126 * R + 0.7152 * G + 0.0722 * B
This is useful for backends that do not allow true grayscale scanning or incorrectly return a single color component even if true gray is requested (observed with the SANE genesys backend).

icon

Name of a png file that should be used as the scanner's icon. This may be an absolute path, or a relative path. If relative (e.g., just a file name without a path), it is relative to the location of the options file.

The image should have a size of 512x512, 256x256 or 128x128 pixels and an alpha channel for transparency. If pixel dimensions are not powers of two, the image will not be accepted by macOS.

location

A string that appears in the note field of the mDNS announcement. This should be an indication where the scanner is located, such as "Living Room" or "Office." If no location is given in the options file, this defaults to the host name of the machine that runs airsaned.

Example options.conf file

# Example options.conf file for airsane
# Set SANE brightness to 10 for all scanners
brightness 10
# Set a default icon for all scanners
icon Gnome-scanner.png

# Compensate for OS-side gamma correction with gamma = 1.8 = 1/0.555555
gray-gamma 0.555555
color-gamma 0.555555

# Set options for all scanners using the genesys backend
device genesys:.*
synthesize-gray yes

# Set icon and calibration file option for a scanner "Canon LiDE 60"
device Canon LiDE 60
icon CanonLiDE60.png
location Living Room
calibration-file /home/simul/some path with spaces/canon-lide-60.cal

Color Management (Gamma Correction)

When receiving scan data from an AirScan scanner, macOS seems to ignore all color space related information from the transmitted image files, and interprets color and gray levels according to standard scanner color profiles. Using ColorSync Utility, one can see that these color profiles are called Scanner RGB Profile.icc and Scanner Gray Profile.icc, located at /System/Library/Frameworks/ICADevices.framework/Resources. Unfortunately, it is not possible to permanently assign a different color profile to an AirScan scanner using ColorSync Utility: the specified color profile is not used, and the profile setting is reverted to the original standard profile.

The SANE standard does not prescribe a certain gamma of backend output.

The macOS standard profiles assume a gamma value of 1.8, which does not necessarily match the data coming from the SANE backend. As a result, scanned images may appear darker than the original, with fewer details in darker areas, or brighter, with fewer details in brighter areas.

Using the gamma options of AirSane, you will be able to neutralize the gamma value of 1.8 in the macOS scanner profile. Apply the inverse of 1.8 as a gray-gamma and color-gamma value in your AirSane configuration file, as shown in the example above. By multiplying with another factor between 0.45 and 2.2, you can correct for the gamma value returned from the SANE backend.

Ignore List

If a file exists at the location for the ignore list (by default, /etc/airsane/ignore.conf), AirSane will read that file line by line, treat each line as a regular expression to be matched against a device's SANE name, and will ignore any device that matches.

The original purpose of the ignore list is to avoid loops with backends that auto-detect eSCL devices, but it may be used to suppress any device from AirSane's list of published devices.

Access File

If a file exists at the location for the access file (by default, /etc/airsane/access.conf), the file's content will be used to implement access restriction.

Each non-comment line in the access file defines a rule to allow or deny access from a range of IP addresses. A rule either begins with "allow" to allow access, or "deny" to deny access. Separated with white space follows a single IP address, or a range of IP addresses in the form "192.168.0.0/16" where the number after the slash character defines the number of nonzero bits in the mask used to compare addresses. Alternatively, a rule may specify a network interface from which local addresses and netmasks are taken: "local on eth0" to use address and netmask from interface eth0, or "local on *" to use all existing network interfaces.

Troubleshoot

  • Compiling fails with error: "‘png_const_bytep’ does not name a type". You have libpng installed in an old version. Some distributions provide libpng12 and libpng16 for you to select. Installing libpng16-dev should fix the issue:
   sudo apt install libpng16-dev
  • If you are able to open the server's web page locally, but not from a remote machine, you may have to allow access to port 8090 in your iptables configuration.

  • Enabling the 'test' backend in /etc/sane.d/dll.conf may be helpful to separate software from hardware issues.

  • To troubleshoot permission issues, compare debug output when running airsaned as user saned vs running as root:

  sudo systemctl stop airsaned
  sudo -u saned airsaned --debug=true --access-log=-
  sudo airsaned --debug=true --access-log=-
  • Scan appears too dark or too bright. See notes about color management (gamma correction) above. Start out with the suggested factor of 0.55. Try settings between 0.45 and 2.2 until scan quality appears good.

  • A dark vertical stripe appears in the middle of the scan when using a Canon scanner ("genesys" backend). This is a known bug in the genesys backend, present in libsane versions 1.0.26 and 1.0.27. The solution is to remove the libsane package, and install SANE from source.

  • Apple Image Capture fails to connect to the scanner (shows an "error 21345"). Enable IPv6 in your local network, and on the machine running AirSane. After rebooting the machine running AirSane, you will be able to scan from Apple Image Capture.

  • Scanners are not advertised, and in the debug log, you seen an avahi error "Bad State (-2)". Most likely, the avahi-daemon package is not installed, or avahi-daemon is not running/enabled:

  sudo install avahi-daemon
  sudo systemctl enable avahi-daemon
  sudo systemctl start avahi-damon

  • You can see no scanners, and you’re using scanbd. scanbd works by proxying local scanners as network scanners, so you need to tell AirSane to include network scanners in its list. In /etc/default/airsane, set LOCAL_SCANNERS_ONLY=false. Also, at least on Debian systems, the scanbm service needs 2 network connections to be able to talk to AirSane, so:
  sudo systemctl edit scanbm.socket
  # Change MaxConnections=1 to MaxConnections=2 and save
  sudo systemctl restart scanbm.socket
  • You are unable to connect to the AirSane web page, or to scan from a remote computer. AirSane comes with a pre-configured access file that restricts access to local addresses. To disable this mechanism, you may temporarily rename the access file at /etc/airsane/access.conf (or /usr/local/etc/airsane/access.conf on FreeBSD), and restart the daemon. If access is possible then, consider to add the remote machine's IP address to an "allow" clause in the access file, and enable it again.

airsane's People

Contributors

cmangla avatar jbruechert avatar kovalev0 avatar rrthomas avatar simulpiscator avatar stackrainbow avatar thecaralice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airsane's Issues

Scanner not discovered on my Mac

I recently installed the precompiled Sane backends and AirSane from pcloadletter on my synology DS414. I can now access my scanner (a Canon Lide 700F) via my browser and scan images that way.
However I cannot add it in my Macs (latest version of Mojave) Printer and Scanner settings or access it in the Image Capture app.
Today I opened a Finder window and navigated to the Airscan app you mentioned in your description (system - library - image capture...) and double clicked on it. Suddenly the scanner appeared and I was able to add it.
However after a reboot I couldn’t manage to get it working again. Do I miss anything?

AirSANE - last error was 98: Address already in use

To whom it may concern:

I have been getting this error message with AirSANE:

stable unique name: genesys:Canon LiDE 110:1
uuid: d8945d57-e60e-5593-9694-3343e3b55408
/etc/airsane/options.conf: regex 'genesys:.*' matches device name 'genesys:libusb:001:003'
published as 'Canon LiDE 110 #2'
server finished with error status -1, last error was 98: Address already in use

Can some please help with this?

I have tried Googling for a solution, but I cannot find any problem that is similar to the one I am having. I appreciate any help or guidance.

AirSane inconsistently segfaults on init with the default list of backends enabled in dll.conf

This one confused me. In my testing I had commented out all the backends except my own scanner's plustek one and airsaned was very reliable - starting and stopping as expected hundreds of times as I developed the package for Synology NAS.

However, now that I am close to release-ready, when testing a fresh installation of the very same sane-backends 1.0.28 (with libusb 1.0.23 since the system has a pre-v1.0 version) airsaned would not start:

enumerating local devices...
sane_init(nullptr, nullptr)
Segmentation fault (core dumped)

Oddly, it would start if sane was removed from the inetd config. This is the same system I have used since the start, and the only difference I can find is that now the list of enabled backends is back to the very inclusive default state.

AirSane returns to a reliable working state once all the unwanted backends are commented out from etc/sane.d/dll.conf.

Trying again several times I find that sometimes it works fine despite all the backends remaining enabled. In summary then it appears to be inconsistent with all backends enabled, and reliable when most of them are commented out. I notice that your README recommends to comment out unused ones, so is there a timeout issue in airsaned perhaps during device detection? Ideally I want this to be a package that requires no manual configuration, so most users will in fact have the default inclusive list.

sane-find-scanner -q and scanimage -L worked fine throughout - and presumably AirSane's device enumeration will be using those same sane library functions so I think it's unlikely the cause of the issue lies with sane-backends.

Any ideas?

macOS documentation

There're two issues in the macOS documentation.

diff --git a/README.macOS.md b/README.macOS.md
index 9d09b37..bbcac0b 100644
--- a/README.macOS.md
+++ b/README.macOS.md
@@ -12,7 +12,7 @@ There, execute the following commands:
 sudo port install sane-backends jpeg libpng
 sudo port install cmake
-git clone github.com/SimulPiscator/AirSane.git
+git clone https://github.com/SimulPiscator/AirSane.git
 mkdir AirSane-build && cd AirSane-build
 cmake  ../AirSane
 make
diff --git a/README.md b/README.md
index 50a6ed8..24c0af6 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ Build files and instructions for OpenWRT have been published here:
 ### Build on macOS
 AirSane may be run on a macOS installation in order to serve locally attached
 scanners to eSCL clients such as Apple Image Capture. For instructions, see 
-[the macOS README file](README-macOS.md).
+[the macOS README file](README.macOS.md).
 
 ### Build and install from source on Debian/Ubuntu/Raspbian
 #### Build

Add Hostname in Published Name?

I would like to add @ $hostname after the shared Bonjour name (same behavior as CUPS/mDNS). For example:
Screen Shot 2020-07-29 at 5 03 59 PM
I looked around file zeroconf/mdnspublisher.cpp but not sure where to inject the additional string. This is not super important but a good-to-have feature. This additional hostname can also merge with CUPS when played right for multifunction printers.
Thanks again.

Not all page sizes available

Of the three scanners I have tested, one offers A5 and A6 paper size but no A4. The other two do not offer A4 Landscape .

--
Brian.

Segfault at Gamma-Table

Hey there,

first of all thank you very much for your efforts for this project :)
I am currently trying to set up my Raspberry Pi 3b+ to act as a scan server.
The scanner is found on my MacBook and everything seems to run smoothly.
Unfortunately as soon as I hit "scan" I get a segfault on the server:

> airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: pixma:04A91748_17209A (CANON Canon PIXMA MG5100)
sane_init(nullptr, nullptr)
sane_open(pixma:04A91748_17209A) -> 0x7544ef28
[source] := "Automatic Document Feeder" -> Invalid argument
[source] := "Flatbed"
sane_close(0x7544ef28)
sane_exit()
uuid: 9d226c1e-7148-9ccf-9a2b-5607a4c7ad44
published as 'CANON Canon PIXMA MG5100'
listening on 127.0.0.1:8090
listening on 192.168.2.183:8090
listening on ::1:8090
listening on fe80::746f:e962:5761:4170:8090
sane_init(nullptr, nullptr)
sane_open(pixma:04A91748_17209A) -> 0x72d006f0
[mode] := "Color" -> reload options
[source] := "Flatbed"
[resolution] := 300dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 210mm
[br-y] := 297mm
sane_start(0x72d006f0) with options:
[br-x] = 210mm
[br-y] = 297mm
[button-1] = 0
[button-2] = 0
[button-controlled] = 0
[button-update] = n/a
[custom-gamma] = 1
[gamma] = 2.2
[gamma-table] = segmentation fault

I am using the Canon MG5150 multifunctional printer as a scanner and am running the latest Raspbian: "Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux".
If I use the "test" scanner on saned it works, so this might be related to my very scanner model :( The "test" scanner doesn't seem to offer a gamma table though.
I use saned in parallel to access the scanner from my Linux machine and this works without problems, so it's likely not sane-related.
Let me now if you need more info!

Image Capture.app: Failed to open a connection to the device (-21355)

I am running AirSane on a Raspberry Pi 3B (Raspbian GNU/Linux 10 \n \l (v 10.2)). I am using macOS 10.15.2 as a client.

When trying to use Image Capture I get the following error message:

Screenshot 2020-01-06 at 20 00 18

In System Preferences the Scanner gets configured as:

Screenshot 2020-01-06 at 20 10 35

I runned the server via

sudo -u saned airsaned --debug=true --access-log=-

and when using Image Capture I saw no activity at all:

enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL] (Hewlett-Packard Deskjet_F4500_series)
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x752362c0
[source] := "Flatbed"
sane_close(0x752362c0)
sane_exit()
uuid: 27b46af4-f1f6-55ca-b60d-dc7814f8d43b
published as 'Hewlett-Packard Deskjet_F4500_series'
listening on 127.0.0.1:8090
listening on 192.168.0.11:8090
listening on ::1:8090
listening on [SOME IPV6 IP]:8090
listening on [SOME IPV6 IP]::8090
listening on [SOME IPV6 IP]::8090

Scanning via "http://local-ip-of-pi:8090" works without any issue and making a test scan results into this:

enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL] (Hewlett-Packard Deskjet_F4500_series)
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x752362c0
[source] := "Flatbed"
sane_close(0x752362c0)
sane_exit()
uuid: 27b46af4-f1f6-55ca-b60d-dc7814f8d43b
published as 'Hewlett-Packard Deskjet_F4500_series'
listening on 127.0.0.1:8090
listening on 192.168.0.11:8090
listening on ::1:8090
listening on [SOME IPV6 IP]:8090
listening on [SOME IPV6 IP]::8090
listening on [SOME IPV6 IP]::8090
192.168.0.4 - - [06/Jan/2020:18:51:12 +0000] "GET /" 404 0 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"
192.168.0.4 - - [06/Jan/2020:18:51:34 +0000] "GET /27b46af4-f1f6-55ca-b60d-dc7814f8d43b" 200 2866 "http://192.168.0.11:8090/" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x73019918
[mode] := "Gray"
[source] := "" -> Invalid argument
[resolution] := 600dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 148mm
[br-y] := 210mm
sane_start(0x73019918) with options:
[batch-scan] = 0
[br-x] = 148mm
[br-y] = 210mm
[brightness] = 0
[compression] = "JPEG"
[contrast] = 0
[jpeg-quality] = 10
[length-measurement] = "Padded"
[mode] = "Gray"
[resolution] = 600dpi
[source] = "Flatbed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_read(0x73019918): End of file reached
sane_close(0x73019918)
sane_exit()
192.168.0.4 - - [06/Jan/2020:18:57:07 +0000] "POST /27b46af4-f1f6-55ca-b60d-dc7814f8d43b" 200 17375883 "http://192.168.0.11:8090/27b46af4-f1f6-55ca-b60d-dc7814f8d43b" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"

It seems like Image Capture is not even trying to communicate to the server.

[feature request] WSD support

Hi,

as I also have some Windows 10 clients, I'd like to also be able to use my network scanner in Windows.

May I ask to integrate WSD support? I know, this is totally different to AirScan, but I hope to see it integrated.

Thanks in advance,
meiser

Just a question about this

I am not a programmer at all but find myself deepely involved in supporting a specific scanner that has pretty bad driver support. I have created a web interface that allows it to scan from anywhere on the network by way of a Linux host. I would like to add Apple AirScan compatibility to it if possible, so that the host listens for airscan requests and passes them along to the scanner, even if some features like PDF require the use of imagemagick

It seems you had to disassemble the AirScan protocol and emulate it .

I would like to know if you could be so kind ... are these two parts the most responsible for listening for AirScan Requests? It seems these are the most relevant.

airsaned.default Listening by interface rather than address to fix IPv6 issue a year ago
airsaned.service Listening by interface rather than address to fix IPv6 issue a year ago

I am looking for a way to get airscan service added to my custom webserver so that iOS devices will work with it.I thought you might offer a pointer or two?

AirSane listening interface issue

Hi,

running airsaned on macOS 10.15, I'd like the daemon only to listen on the loopback interface lo0.

When the scanner is not yet connected and the daemon is started, the daemon listens on lo0. As soon as the scanner is connected, the daemon listens on all interfaces. On disconnect, the daemon then again only listens on lo0.

$ /usr/local/sbin/airsaned --interface=lo0 --base-port=8090 --options-file=/usr/local/etc/airsane/options.conf --ignore-list=/usr/local/etc/airsane/ignore.conf --debug=true
git commit: 538f5d6 (branch master, rev 154+)
build date: 2021-01-10T14:17:06Z
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
listening on 127.0.0.1:8090
listening on [::1]:8090
listening on [fe80::1]:8090
hotplug event, reloading configuration
received SIGHUP, reloading
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: genesys:libusb:020:016 (Canon LiDE 90)
sane_init(nullptr, nullptr)
sane_open(genesys:libusb:020:016) -> 0x7fadbfe0d9a0
[source] := "Flatbed"
sane_close(0x7fadbfe0d9a0)
sane_exit()
stable unique name: genesys:Canon LiDE 90:1
uuid: f623eb2c-baa8-543b-a71a-24b9a75abd1b
/usr/local/etc/airsane/options.conf: regex 'genesys:.*' matches device name 'genesys:libusb:020:016'
published as 'Canon LiDE 90'
listening on 127.0.0.1:8091
listening on 127.0.0.1:8090
listening on [::1]:8091
listening on [::1]:8090
listening on [fe80::1]:8091
listening on [fe80::1]:8090
listening on [fe80::c7a:c89a:f723:19f8]:8091
listening on 192.168.2.2:8091
listening on [IPv6 GUA]:8091
listening on [IPv6 GUA]:8091
listening on [fe80::2c3d:5cff:fe96:8199]:8091
listening on [fe80::2c3d:5cff:fe96:8199]:8091
listening on [fe80::300c:3fde:382a:cdfc]:8091
listening on [fe80::fe2c:73fd:f8cb:1dd5]:8091
listening on [fe80::5ab8:d839:b1e6:8165]:8091
listening on 192.168.217.1:8091
listening on 172.16.210.1:8091
listening on [fe80::aede:48ff:fe00:1122]:8091
hotplug event, reloading configuration
received SIGHUP, reloading
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
listening on 127.0.0.1:8090
listening on [::1]:8090
listening on [fe80::1]:8090

Mu old ticket was closed new install failure

sudo make install
[ 5%] Building CXX object CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o
/usr/src/AirSane/imageformats/pngencoder.cpp: In member function ‘virtual void PngEncoder::onWriteLine(const void*)’:
/usr/src/AirSane/imageformats/pngencoder.cpp:122:47: error: ‘png_const_bytep’ does not name a type
::png_write_row(p->mpPng, static_cast<png_const_bytep>(data));
^
/usr/src/AirSane/imageformats/pngencoder.cpp:127:52: error: ‘png_const_bytep’ does not name a type
::png_write_row(p->mpPng, reinterpret_cast<png_const_bytep>(p->mLineBuf
^
CMakeFiles/airsaned.dir/build.make:398: recipe for target 'CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o' failed
make[2]: *** [CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/airsaned.dir/all' failed
make[1]: *** [CMakeFiles/airsaned.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Not all resolutions available

A nice, useful application with good instructions for compilation and installation.

I have a local HP aio (a PSC 1300) which offers scan resolutions of 75, 300 and 600 dpi in the browser.

  • scanimage -A -d | grep resolution

returns

  • 75|100|150|200|300|600dpi [75].

Is there a reason for the difference?

--
Brian.

support for adf scanner

Hi,

is it possible to add support for adf-scanners? (like canon p215, etc ?)

Regards,
Simon

Failed to Connect from Image Capture

I have set up AirSane server on Debian Buster/Arm64 and can download scanned images on http://:8090. On MacOS Catalina side, the scanner pops up in Image Capture and also shown up as Bonjour Scanner. However it throws the error "Failed to open a connection to the device (-21345)".

I then tried to get some log on the server end as instructed:
sudo -u saned airsaned --debug=true --access-log=-
It shows nothing when I am connecting with Image Capture. However it can tell me when I access the web interface. I'm wondering if my avahi is not set up properly?

Trying to find the Keyword in ScannerStatus

I am trying to find the keyword in ScannerStatus when a scan is ready for download. I am working on a project but do not have access to an eSCL scannner right now

ScannerStatus
pwg:State can be "Idle", "Preparing", "Stopped" or "????" once the document is ready. I can ot identify this I can see clients trying to read it and sending "Idle" is not what they want to hear.

Can you tell me what this "document ready" state is?

Error: Aborted: ResourcesAreNotReady

I had my ScanSnap ix500 set up and working locally using SANE. I briefly had it working in Apple Image Capture with AirSane, but now it isn't working anymore, either locally in simple-scan or over AirSane. There's no error message in Apple Image Capture (it just sits indefinitely), but in localhost:8090 I get the error Error: Aborted: ResourcesAreNotReady when I try to run a scan.

Somewhat strangely, the original ScanSnap device ("FUJITSU ScanSNAP ix500") disappeared from simple-scan and was replaced with a new one (three new ones, in fact), titled "ESCL FUJITSU ScanSnap ix500", and on localhost:8090 there are two identically named scanners, one of which is a dead link. Incidentally, clicking the dead link just caused airsaned to SEGFAULT:

$ sudo -u saned airsaned --debug=true --access-log=-
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: fujitsu:ScanSnap iX500:1200753 (FUJITSU ScanSnap iX500)
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap iX500:1200753) -> 0x7f99a81501c0
[source] := "ADF Duplex" -> reload options
sane_close(0x7f99a81501c0)
sane_exit()
stable unique name: fujitsu:FUJITSU ScanSnap iX500:1
uuid: 643027f6-f4aa-540e-beb3-2b8dd8266466
published as 'FUJITSU ScanSnap iX500'
found: escl:ScanSnap iX500:1200753 (FUJITSU ScanSnap iX500)
sane_init(nullptr, nullptr)
sane_open(escl:ScanSnap iX500:1200753) -> SANE_Status Invalid argument
sane_exit()
error: failed to open device
listening on 127.0.0.1:8090
listening on 192.168.4.34:8090
listening on [::1]:8090
listening on [fd10:e07c:45dd:1:d87:f4a4:20d7:b2f7]:8090
listening on [fd10:e07c:45dd:1:eeda:2a26:b3f4:3fcc]:8090
listening on [fe80::1599:88b7:1612:3a0e]:8090
127.0.0.1 - - [20/Dec/2020:22:15:39 -0500] "GET /" 200 604 "" "Mozilla/5.0(X11;Ubuntu;Linuxx86_64;rv:84.0)Gecko/20100101Firefox/84.0"
127.0.0.1 - - [20/Dec/2020:22:15:39 -0500] " " 200 -85 "" ""
Segmentation fault

Any idea what's happening here?

Packages for Synology

Hi, this is not really an issue, but can you maybe share some information about how to build / compile (or whatever it's called) Airsane for a Synology Diskstation (DS 414 specifically in my case).
About a year ago I installed a pre-compiled package from pcloadletter as you suggest in your instructions, but the version provided there is quite old by now and I'd like to make use of all of the improvements and new features of Airsane that you added recently.
Please don't get me wrong I'm fully aware that it would be very time consuming for you to compile your app for all those different architectures so I'm really not complaining.
It's just that I have literally no clue how to do it myself. And it's frustrating because SANE means Scanner Access Now Easy. And with your app it is in fact very easy. But still so difficult (for me at least)...

I think you are on to something great here.

I think you are on to something great here.

I recently wrote an email to the SANE Devs list that to date, has not received an reply. I think the antiquated SANE over network needs to be seriously revamped for something more modern and a standard in use today, CUPS has managed to keep up with the times and did so before Apple aquired it. SANE needs to follow that example.

There are three potential models
eSCL/AirScan
WSD
IPP scanning

Any of which if replacing SANE over network would be better than what we have now. I think the first two are xml based, not sure about the third. It is far too easy to read ScannerSettings and derive settings to submit an xml to POST then read the resulting file. It opens up new ways for machine to machine communication, which as we step in to the 21st centrury becomes more and more important. Maybe today you do not need your refridgerator to scan something but tomorrow some new whizbang device will come out incorporating one of these standards. This is without mentioning the ease with which one might convert WSD xml to eSCL xml or visa versa;

What you have here is the potential foundation for that, with the single exception that SANE still has no eSCL Back-end. If such a back-end existed the need for the antiquated SANE over network protocol would be eliminated.

File naming with more than one Scan.*

I am not a great fan of Scan(2).pdf as a file name because "(" and ")" have to be escaped on the command line. I would alter it to a more convenient Scan-2.pdf if I knew which part of the code to change.

--
Brian.

different scan behaviour in AIC (simple vs advanced options)

Hi,

I see a different behaviour in AIC if I scan with simple options or advanced options. There is a part missing at the top of the page.
I own a Brother DCP-1510 which uses the brother4 SANE driver (deb package version 0.4.9-1), running on Ubuntu 20.04.

Looking at the debug output, [tl-y] = 64.994mm is set when using the advanced options, this is not the case in "simple mode".

airsaned-log.txt
Scan AIC simple options.png
Scan AIC advanced options.pdf

Here are the AIC advanced options settings:
Scan AIC settings.pdf

BTW, everything works fine when scanning via the web interface or the Android Mopria app.

Thanks in advance for having a look.
Best regards,
meiser

WS-Scan

Not an issue, but have you ever thought about doing the same thing for WS-Scan? One server for all scanners is such a nice idea...

Segmentation fault on transfer-format option for Epson L3150

I have Epson L3150 scanner and I struggle to make it network shared. I can use scanimage to scan manually but couldn't get AirSane working because of Segmentation fault. Scanner is discoverable and web interface returns valid options. I managed to access scanner with SwingSane, scan starts but images are empty. scanimage works perfectly fine

Looks like sane's backends do not support epsonscan2 at all?

enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: epsonscan2:L3150 Series:esci2:usb:ES016E:4419 (EPSON L3150 Series)
sane_init(nullptr, nullptr)
sane_open(epsonscan2:L3150 Series:esci2:usb:ES016E:4419) -> 0x7f806c038ab0
[source] := "Flatbed" -> reload options
sane_close(0x7f806c038ab0)
sane_exit()
stable unique name: epsonscan2:EPSON L3150 Series:1
uuid: d26d9bff-4dce-529a-b7a4-ec731da1002e
published as 'EPSON L3150 Series'
listening on 127.0.0.1:8090
listening on 192.168.88.240:8090
listening on 10.8.0.6:8090
listening on [::1]:8090
listening on [fe80::e23f:49ff:fe77:e9b3]:8090
listening on [fe80::79a8:a404:fba6:e16]:8090
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:01 +0300] "GET /eSCL/ScannerCapabilities" 200 2556 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:01 +0300] "GET /eSCL/ScannerIcon" 200 48698 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "GET /eSCL/ScannerStatus" 200 364 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "POST /eSCL/ScanJobs" 201 0 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "GET /eSCL/ScannerStatus" 200 795 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
sane_init(nullptr, nullptr)
sane_open(epsonscan2:L3150 Series:esci2:usb:ES016E:4419) -> 0x7f8064025a80
[mode] := "Color"
[source] := "Flatbed" -> reload options
[resolution] := 50dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 297mm
sane_start(0x7f8064025a80) with options:
[br-x] = 216mm
[br-y] = 297mm
[brightness] = 0
[contrast] = 0
[dropout] = "None"
[gamma-correction] = 2.2
[image-count] = 0
[long-paper-mode] = 0
[mode] = "Color"
[remove-background] = "None"
[resolution] = 200dpi
[rotate] = "0 degrees"
[scan-area] = "Manual"
[source] = "Flatbed"
[threshold] = 128
[tl-x] = 0mm
[tl-y] = 0mm
[transfer-format] = Segmentation fault

sudo -u saned scanimage -d 'epsonscan2:L3150 Series:esci2:usb:ES016E:4419' -A returns

All options specific to device `epsonscan2:L3150 Series:esci2:usb:ES016E:4419':
  General:
    --mode Color|Grayscale|Monochrome [Color]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --source Flatbed [Flatbed]
        Selects the scan source (such as a document-feeder).
    --duplex[=(yes|no)] [inactive]
        Selects the ADF mode (yes:duplex/no:simplex)
    --resolution 50..1200dpi (in steps of 1) [200]
        Sets the resolution of the scanned image.
    --x-resolution 50..1200dpi (in steps of 1) [inactive]
        Sets the horizontal resolution of the scanned image.
    --y-resolution 50..1200dpi (in steps of 1) [inactive]
        Sets the vertical resolution of the scanned image.
    --scan-area Letter|A4|A5|A5 (Landscape)|A6|A6 (Landscape)|A8|A8 (Landscape)|B5 [JIS]|Postcard|Postcard (Landscape)|PlasticCard|Maximum|Manual [Manual]
        Select an area to scan based on well-known media sizes.
  Geometry:
    -l 0..215.9mm [0]
        Top-left x position of scan area.
    -t 0..297.18mm [0]
        Top-left y position of scan area.
    -x 0..215.9mm [215.9]
        Width of scan-area.
    -y 0..297.18mm [297.18]
        Height of scan-area.
  Enhancement:
    --deskew[=(yes|no)] [inactive]
        Rotate image so it appears upright.
    --dropout None|Red|Blue|Green [None]
        Selects the dropout.
    --rotate 0 degrees|90 degrees|180 degrees|270 degrees|Auto [0 degrees]
        Rotate
    --skip-blankpages 0..100 (in steps of 1) [inactive]
        Skip Blank Pages Settings.
    --brightness -100..100 (in steps of 1) [0]
        Controls the brightness of the acquired image.
    --contrast -100..100 (in steps of 1) [0]
        Controls the contrast of the acquired image.
    --threshold 0..255 [128]
        Select minimum-brightness to get a white point
  Other:
    --double-feed-detection None [inactive]
        Detection Double Feed
    --gamma-correction 0.5..3 (in steps of 0.0999908) [2.2]
        Selects the gamma correction value from a list of pre-defined devices
        or the user defined table, which can be downloaded to the scanner
    --image-count 1..999 (in steps of 1) [0]
        Image Count
    --long-paper-mode[=(yes|no)] [no]
        Select this mode if you want to scan documents longer than what the
        ADF would normally support. Please note that it only supports automatic
        detection of the document height.

Bounjour advertisement

In the Bonjour advertisement I see some things although not necessary can contribute to a "prettier" interface . One of thise things the txt "representation" field, which both OSX and Mopria will use. At least one version of mopria I tested did have a problem with a "." after hostname.local. As I reported it maybe it got fixed. I know it would be complicated to accommodate thousands if different scanner models icons, but consistent with another suggestion I made here about the ability to customize ScannerSettings xml, one may need the ability to override (with custom) or even deactivate the Bonjour advertisement. Maybe some do not want automatic discovery of scanners, to help keep unauthorized users from using them.

Delay Service Start on Boot

I've noticed that the service may fail with the following error on boot:

Jul 29 15:26:11 nanopi airsaned[1240]: [bjnp] create_broadcast_socket: ERROR - bind socket to local address failed - Cannot assign requested address
Jul 29 15:26:17 nanopi airsaned[1240]: server finished with error status -1, last error was 99: Cannot assign requested address

I'm not an expert in networking services loading order but one hacky way to get around it could be delay the service by a couple of seconds e.g.:

[Service]
ExecStartPre=/bin/sleep 10

Mopria Android Crashes with AirSANE

Testing with Mopria Android , the program crashes and closes. Wireshark reveals that It Sent ScannerStatus.xml just before the crash. So it looks like possibly someting in ScannerrStatus.xml is causing the crash.

Since Mopria is involved in defining these standards it seems compatibility should be a priority

no further scan possible after canceling the preview scan in AIC

Hi,

while AIC scanned the preview, I pressed the cancel button. After this, I couldn't scan anymore. I had to power-off and power-on my scanner.
I own a Brother DCP-1510 which uses the brother4 SANE driver (deb package version 0.4.9-1), running on Ubuntu 20.04.

The log shows which indicates that airsaned "hangs" at sane_open(brother4:bus1;dev2)

document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother4:bus1;dev2) -> 0x7fd4c001cbc0
[mode] := "24bit Color" -> reload options
[source] := "FlatBed"
[resolution] := 100dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 212mm
[br-y] := 356mm
sane_start(0x7fd4c001cbc0) with options:
[br-x] = 211.881mm
[br-y] = 355.567mm
[mode] = "24bit Color"
[resolution] = 100dpi
[source] = "FlatBed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_cancel(0x7fd4c001cbc0) -> pressed cancel during preview scan
sane_close(0x7fd4c001cbc0)
sane_exit()
document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother4:bus1;dev2)

Thanks in advance for having a look.
Best regards,
meiser

Out of memory error with Brother DCP-7030

I am trying to make the scanner part of a Brother DCP-7030 work with AirSane but it keeps failing:
Whether I start the scan via the AirSane web interface or via "Image Capture" on a Mac, the scanner makes it's starting noises but then stops after a second or so. Meanwhile scanning with scanimage works perfectly fine.

AirSane debug mode always reports sane_read(0x7f895c1098b0): Out of memory

Output from sudo airsaned --debug=true --access-log=-:

reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: brother3:bus2;dev1 (Brother DCP-7030)
sane_init(nullptr, nullptr)
sane_open(brother3:bus2;dev1) -> 0x7f811c136c70
[source] := "FlatBed"
sane_close(0x7f811c136c70)
sane_exit()
stable unique name: brother3:Brother DCP-7030:1
uuid: 2bd3004d-341f-5655-abba-3dccc99c3448
/etc/airsane/options.conf: regex 'brother3:.*' matches device name 'brother3:bus2;dev1'
published as 'Brother DCP-7030'
listening on 127.0.0.1:8090
listening on 192.168.178.22:8090
listening on 172.17.0.1:8090
listening on 172.18.0.1:8090
listening on [::1]:8090
listening on [fe80::7285:c2ff:fe30:f4df]:8090
listening on [fe80::42:2dff:febf:4f11]:8090
listening on [fe80::20bd:c6ff:fef2:47f5]:8090
192.168.178.35 - - [14/Nov/2020:14:15:46 +0100] "GET /" 200 516 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
192.168.178.35 - - [14/Nov/2020:14:15:46 +0100] "GET /" 200 516 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
192.168.178.35 - - [14/Nov/2020:14:15:48 +0100] "GET /2bd3004d-341f-5655-abba-3dccc99c3448" 200 2896 "http://192.168.178.22:8090/" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
document format requested: image/jpeg
document format used: image/jpeg
using grayscale gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother3:bus2;dev1) -> 0x7f895c1098b0
[mode] := "True Gray" -> reload options
[source] := ""
[resolution] := 300dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 210mm
[br-y] := 297mm
sane_start(0x7f895c1098b0) with options:
[br-x] = 209.981mm
[br-y] = 296.973mm
[brightness] = 0%
[contrast] = 0%
[mode] = "True Gray"
[resolution] = 300dpi
[source] = "FlatBed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_read(0x7f895c1098b0): Out of memory
sane_cancel(0x7f895c1098b0)
sane_close(0x7f895c1098b0)
sane_exit()
192.168.178.35 - - [14/Nov/2020:14:15:56 +0100] "POST /2bd3004d-341f-5655-abba-3dccc99c3448" 200 0 "http://192.168.178.22:8090/2bd3004d-341f-5655-abba-3dccc99c3448" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"

Output from sudo scanimage -d "brother3:bus2;dev1" -A:

All options specific to device `brother3:bus2;dev1':
  Mode:
    --mode Black & White|Gray[Error Diffusion]|True Gray|24bit Color [24bit Color]
        Select the scan mode
    --resolution 100|150|200|300|400|600|1200|2400|4800|9600dpi [200]
        Sets the resolution of the scanned image.
    --source FlatBed [FlatBed]
        Selects the scan source (such as a document-feeder).
    --brightness -50..50% (in steps of 1) [inactive]
        Controls the brightness of the acquired image.
    --contrast -50..50% (in steps of 1) [inactive]
        Controls the contrast of the acquired image.
  Geometry:
    -l 0..215.9mm (in steps of 0.0999908) [0]
        Top-left x position of scan area.
    -t 0..355.6mm (in steps of 0.0999908) [0]
        Top-left y position of scan area.
    -x 0..215.9mm (in steps of 0.0999908) [215.88]
        Width of scan-area.
    -y 0..355.6mm (in steps of 0.0999908) [355.567]
        Height of scan-area.

I have to note that the reported resolutions seem not correct as the scanner only supports 100, 200, 300 and 600 dpi.

Addition:
I see now that airsane reports my experiments with the config file in line /etc/airsane/options.conf: regex 'brother3:.*' matches device name 'brother3:bus2;dev1'. I tried to set default options for the printer as I suspected wrong default settings (like the scan area), but this didn't help.

FUJITSU ScanSnap ix500 Sheet-Fed Scanner Appearing as Flatbed Scanner

Hi @SimulPiscator, thanks for your quick response on the other issue! It seems to have fixed some things, but there are still some quirks to be ironed out. For example, the ESCL version of the scanner shows up as a flatbed, rather than sheet-fed. Scanning still works on macOS, but the scanner settings in Image Capture indeed think the device is a flatbed, so neither double-sided nor automatic multi-page scans work. Both double-sided and automatic multi-page scans work locally using SANE over USB, so this seems to be a problem with AirSane, not SANE.

Here's one set of outputs:

$ sudo -u saned scanimage -L
device `fujitsu:ScanSnap iX500:1200753' is a FUJITSU ScanSnap iX500 scanner
device `escl:http://127.0.0.1:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner
device `escl:http://192.168.4.34:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner
device `escl:http://fd10:e07c:45dd:1:c98a:733d:a197:6f53:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner

Notice that the ESCL scanners (which shouldn't be visible after your change), add the word "flatbed".

Crash when initializing

Hi, I'm trying to use an old scanner that works perfectly with xsane, but the program crashes and I don't know what I am doing wrong:

user@ubuntu-linux:~$ airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: plustek:libusb:002:003 (Canon CanoScan N650U/N656U)
sane_init(nullptr, nullptr)
sane_open(plustek:libusb:002:003) -> 0x7fca1803fa30
sane_close(0x7fca1803fa30)
sane_exit()
uuid: b3ebec0b-d7ff-a6aa-7553-3510934a8447
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 1) > this->size() (which is 0)
Aborted (core dumped)

If I disconnect the scanner and enable the test backend, it runs correctly and I can see the dummy scanners on my browser:

user@ubuntu-linux:~$ airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: test:0 (Noname frontend-tester)
sane_init(nullptr, nullptr)
sane_open(test:0) -> 0x7f4b9c041360
[source] := "Flatbed"
[source] := "Automatic Document Feeder"
sane_close(0x7f4b9c041360)
sane_exit()
uuid: e2a87172-2497-5763-fb24-12e41c529760
published as 'Noname frontend-tester'
found: test:1 (Noname frontend-tester)
sane_init(nullptr, nullptr)
sane_open(test:1) -> 0x7f4b9c089f60
[source] := "Flatbed"
[source] := "Automatic Document Feeder"
sane_close(0x7f4b9c089f60)
sane_exit()
uuid: f1f7c52b-99b7-84c8-0ac3-69b370c194d9
published as 'Noname frontend-tester #2'
listening on 127.0.0.1:8090
listening on 10.211.55.10:8090
listening on ::1:8090
listening on fdb2:2c26:f4e4:0:70e4:21a3:8b9f:44b9:8090
listening on fdb2:2c26:f4e4:0:21c:42ff:fe82:9e1:8090
listening on fe80::21c:42ff:fe82:9e1:8090

AirSane is not showing scanner that scanimage -L shows

Hi!
This is a recent problem that didn't appear weeks (or months) ago when I installed AirSane for the first time.
The problem appeared on a RaspberryPi 3 B+ with Raspbian Buster.

I followed all instructions for installing AirSane, I have done it before with same scanner and same Raspberry Pi but on Raspbian Stretch and worked perfectly. Now it installed nicely but AirSane is not showing the scanner.

If I run sudo scanimage -L I get the right scanner: device epson2:libusb:001:004 is a Epson GT-9800 flatbed scanner

But on the AirSane server I get that there are no scanners:

Scanners

No scanners available

Build

date: Oct 12 2019, 18:22:53

commit: 7fbaa42 (branch master, revision 44)

Any idea what can be causing this problem?

And by the way, thanks for such a wonderful tool...

libpng on Arch Linux

Compiling on Arch Linux fails because of libpng not being found.

/home/rosi/AirSane/imageformats/pngencoder.cpp:20:10: fatal error: libpng/png.h: No such file or directory
#include <libpng/png.h>
^~~~~~~~~~~~~~
compilation terminated.

Turns out libpng is available as 1.16 and 1.12 Version in two different packages and put in renamed subfolders to allow for parallel installation

/usr/include/libpng16/
/usr/include/libpng16/png.h

So creating a symlink fixed my build problem:
ln -s /usr/include/libpng16/ /usr/include/libpng/

segfault on unavailable USB scanner

My server running AirSane is a KVM VM. When I power-on my Brother scanner, the device is attached to the VM via a udev rule.
When I power-off the scanner, the device is currently NOT detached from the VM (issue with udev remove rule).

That's why the device is still shown in lsusb output and AirSane thinks that it's still available.

As soon as e.g. AirSane tries to access the scanner because AIC requests a preview scan, AirSane segfaults.

Here's the gdb backtrace (first part is a successful preview scan after powering on the device, the second is the one causing the segfault as device is powered off):
gdb-backtrace.txt

Robustness Improvement: AirSane service will hang after backend have an error, any further operations will cause an "session in use" error in the log, until manually restart the AirSane service using systemctl. An auto recovery or other proper ways of handling this session problem is better.

Hi SimulPiscator,

Your software is awesome and it really does the job like expected.
After several successful scans, I noticed in some scenario the AirSane service is easily hanged, so I make this report hope to help improve this software.

The problem is, when something goes wrong in the backend, the AirSane service will not handle them properly, and will hang and not respond to any further operations, until a manual restart of AirSane service through systemctl.

When the service is hanged, I can still use the "imagescan" command to scan image directly on the server, so it's not the backend/scanner problem. Any further oprations to the hanged AirSane service will cause an "session in use" error in the log.

So it's maybe the AirSane's session management part thing, and it may be improved.

Details of the problem and how to reproduce the hang:

  1. Do something that can cause the backend report some error. In my case, it's the "Auto Selection" feature with multiple selections, or manually select multiple selections, especially with overlapped selections or out of range selections.

Screen Shot 2019-07-09 at 3 15 02 PM

  1. The first scan will succeed, and then it is hanged, any further attempts will not respond. Click "Overview" or "Cancel" then "Scan" will all cause the server side "Session in use" error log.

Now it just hang there forever:
Screen Shot 2019-07-09 at 3 15 31 PM

The "session in use" error:
Screen Shot 2019-07-09 at 3 43 02 PM

  1. The "scanimage" command on the server side can execute correctly, it's the AirSane service that hangs.

Screen Shot 2019-07-09 at 3 44 55 PM

  1. Restart the AirSane service using systemctl, and everything is back on.

After my several tweaking, I think there are maybe two problems to be solved:

1. Some session management/check mechanism can be added, when it detects an error in the session, it can be auto-recovered, instead of a manual restart of the service from the server console.

So if something wrong with the backend in the session, this session should be destroyed or closed or reset or something and should be recovered by itself, other than just hang. And it's better to have an error report to the App side, so the App can know it's failed and can take its reaction.

This will solve most of the problem, because an ordinary user don't know how to log on to the server and restart it, as for them the wireless scanner is just broken and they just have nothing to do with it.

In my experience, such an error in the backend can be easily triggered even if you don't do anything strange, just open the Scanner App, everything default, click "Scan", with some specific document layout and it will just broken.

To solve every possible error is one thing, get recovered from it is another.
This auto-recovery mechanism can hugely improve the robustness of this service. Without solving every possible problem, it can become a real work horse.

2. Add an operation/session queue, so multiple scan area selections and/or frequent user actions will not easily cause an backend error, and cause AirSane hang.

In my experiments, multiple small selections will randomly cause an error, frequent user actions too.
For example, when the Scanner App displays "Scanner is warming up", you press "Cancel", and then press "Overview", or when the scan is in process, you "cancel" and then "overview", or just press "Overview" multiple times, it will easily hang and the console log will say "session in use".

So I think maybe it's the command is delivered while the scanner it self is not totally finished with the previous job, that causes the new job is discarded at the scanner side, and cause the session to be waiting forever, and block further actions. (That's my presumption, hope to provide some clue to this).

This may be another cause of the hang problem mentioned above.

So, If these issues are fixed, the robustness of AirSane can be improved greatly and become more error proof so ordinary users can rely on it without the mess of the console.

Hope this helps, thanks again!

A request more than an issue

I am looking for wireshark (or other) traces of successful eSCL/AirScan scans. If anyone can help please .

I am looking for all exchanges between scanner and client from scanner detection all the way through to client loading the image.

I have no eSCL devices here. I would prefer to see it from a Mac to an "officially supported" scanner but will take what I can get.

You can send them to markosjal at the email with a G.

Invalid read of size 8 - SIGSEGV with Brother DCP-L2510 (brscan4-0.4.8-1.amd64.deb)

Many thanks for this project.

I have just given Airsaned a try on Ubuntu 18.04.2.
scanimage -d "brother4:bus5;dev1" --format tiff > raw.tiff
works great every time.

On OSX Mojave the Image Capture keeps refreshing the list of shared scanners upon clicking on the the scanner. But Airsaned does not exit.
While trying to access the scanner via the web interface it crashes with "Segmentation fault (core dumped)"
I built it with debug symbols and attached the valgrind output.
This is how I run it

airsaned --local-scanners-only=true --debug=true

enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: brother4:bus5;dev1 (Brother DCP-L2510D)
sane_init(nullptr, nullptr)
sane_open(brother4:bus5;dev1) -> 0xaa96d80
sane_close(0xaa96d80)
sane_exit()
uuid: 3406f97c-f7d4-58d1-92f4-551373ed15bf
published as 'Brother DCP-L2510D'
listening on 127.0.0.1:8090
listening on 10.0.1.194:8090
listening on ::1:8090
listening on fe80::5054:ff:fe66:13cb:8090
Segmentation fault

out.txt

OpenWRT build?

Hello! Is it possible to build AirSane for OpenWRT?
I'm currently using sane, but I had to use command line to scan.
It would be great if I could use my scanner via default "Image Capture" OS X app

Avahi service won't add my scanner for Epson dx7400 series

Hello,
I tried to use your program for making my scanner in my Mac but I cannot see my scanner in add printer scanner settings page. After a little research I saw my scanner won't add in avahi service. I tried to use web client and I found my scanner as CX7400 in web and can make scan file, preview file. I look tags in git hub for find latest working version but as I see you didn't use that option can you help me?

My system Debian buster and updated latest versions in docker.

2021-01-02 11:23:23,203 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
2021-01-02 11:23:23,204 DEBG 'saned' stdout output:
sane_open(epson2:libusb:002:012) ->
2021-01-02 11:23:23,259 DEBG 'saned' stdout output:
0x7f11b8038e00
2021-01-02 11:23:23,273 DEBG 'saned' stdout output:
sane_close(0x7f11b8038e00)
2021-01-02 11:23:23,277 DEBG 'saned' stdout output:
sane_exit()
2021-01-02 11:23:23,277 DEBG 'saned' stdout output:
stable unique name: epson2:Epson CX7400:1
uuid: d956892e-4077-52a9-bc2d-fba035adaa30
2021-01-02 11:23:23,763 DEBG 'saned' stdout output:
getaddrinfo() error: Name or service not known
2021-01-02 11:23:23,764 DEBG 'saned' stdout output:
airsaned: entrygroup.c:108: avahi_entry_group_new: Assertion 'client' failed.
2021-01-02 11:23:23,765 DEBG fd 15 closed, stopped monitoring <POutputDispatcher at 139696539178048 for <Subprocess at 139696539578024 with name saned in state RUNNING> (stdout)>

2021-01-02 11:23:23,765 INFO exited: saned (terminated by SIGABRT; not expected)
2021-01-02 11:23:23,765 DEBG received SIGCLD indicating a child quit
2021-01-02 11:23:24,768 INFO spawned: 'saned' with pid 21
2021-01-02 11:23:24,809 DEBG 'saned' stdout output:
reading device options from '/etc/airsane/options.conf'
enumerating devices...
2021-01-02 11:23:24,810 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
sane_get_devices() ...
2021-01-02 11:23:25,811 INFO success: saned entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-02 11:23:34,400 DEBG 'saned' stdout output:
... sane_get_devices() -> SANE_Status Success
sane_exit()
2021-01-02 11:23:34,404 DEBG 'saned' stdout output:
found: epson2:libusb:002:012 (Epson CX7400)
2021-01-02 11:23:34,404 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
2021-01-02 11:23:34,405 DEBG 'saned' stdout output:
sane_open(epson2:libusb:002:012) ->
2021-01-02 11:23:34,425 DEBG 'saned' stdout output:
0x7f96240144d0
2021-01-02 11:23:34,426 DEBG 'saned' stdout output:
sane_close(0x7f96240144d0)
2021-01-02 11:23:34,431 DEBG 'saned' stdout output:
sane_exit()
2021-01-02 11:23:34,432 DEBG 'saned' stdout output:
stable unique name: epson2:Epson CX7400:1
uuid: d956892e-4077-52a9-bc2d-fba035adaa30
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
getaddrinfo() error: Name or service not known
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
Avahi error when adding service: Bad state (-2)
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
listening on 127.0.0.1:8090
listening on 192.168.1.106:8090

error at make install

I also tried this after su root and it is the same. Can you offer any advice?

Ubuntu 16.04_x86

sudo make install
Scanning dependencies of target airsaned
[ 5%] Building CXX object CMakeFiles/airsaned.dir/server/main.cpp.o
In file included from /usr/include/c++/5/thread:35:0,
from /usr/src/AirSane/server/main.cpp:19:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
^
In file included from /usr/src/AirSane/server/scanner.h:26:0,
from /usr/src/AirSane/server/scanserver.h:22,
from /usr/src/AirSane/server/main.cpp:21:
/usr/src/AirSane/./sanecpp/sanecpp.h:45:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr device_handle;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:47:1: error: ‘device_handle’ does not name a type
device_handle open(const std::string&, SANE_Status* = nullptr);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:48:1: error: ‘device_handle’ does not name a type
device_handle open(const device_info&, SANE_Status* = nullptr);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:109:5: error: ‘device_handle’ does not name a type
device_handle m_device;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:115:29: error: field ‘device_handle’ has incomplete type ‘sanecpp::option_set’
option_set(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:106:7: note: definition of ‘class sanecpp::option_set’ is not complete until the closing brace
class option_set
^
/usr/src/AirSane/./sanecpp/sanecpp.h:116:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
option_set(const option_set&) = delete;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:117:48: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
option_set& operator=(const option_set&) = delete;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:119:15: error: ‘device_handle’ is not a type
void init(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:144:35: error: only declarations of constructors and conversion operators can be ‘explicit’
explicit session(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:144:35: error: field ‘device_handle’ has incomplete type ‘sanecpp::session’
/usr/src/AirSane/./sanecpp/sanecpp.h:140:7: note: definition of ‘class sanecpp::session’ is not complete until the closing brace
class session
^
/usr/src/AirSane/./sanecpp/sanecpp.h:157:5: error: ‘device_handle’ does not name a type
device_handle m_device;
^
In file included from /usr/src/AirSane/server/scanserver.h:22:0,
from /usr/src/AirSane/server/main.cpp:21:
/usr/src/AirSane/server/scanner.h:35:31: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
Scanner(const Scanner&) = delete;
^
/usr/src/AirSane/server/scanner.h:36:42: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
Scanner& operator=(const Scanner&) = delete;
^
/usr/src/AirSane/server/scanner.h:62:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr createJobFromScanSettingsXml(const std::string&, bool autoselectFormat = false);
^
/usr/src/AirSane/server/scanner.h:63:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr getJob(const std::string& uuid);
^
/usr/src/AirSane/server/scanner.h:66:25: error: ‘shared_ptr’ is not a member of ‘std’
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:66:25: error: ‘shared_ptr’ is not a member of ‘std’
/usr/src/AirSane/server/scanner.h:66:51: error: ‘JobList’ was not declared in this scope
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:66:51: error: template argument 1 is invalid
/usr/src/AirSane/server/scanner.h:66:51: error: template argument 2 is invalid
/usr/src/AirSane/server/scanner.h:66:18: warning: ‘typedef’ was ignored in this declaration
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:67:5: error: ‘JobList’ does not name a type
JobList jobs() const;
^
/usr/src/AirSane/server/scanner.h:69:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptrsanecpp::session open();
^

No real issue, just to express my gratitude, this piece of software is really something, everyone messing with SANE should give it a try!

This AirSane is really something, it should be added to the SANE's project page, and recommend everyone give it a try.

Other remote frontend of SANE is either outdated(TwainSane) or have problems here or there (phpsane, scanserv and it's updated version scanservjs, some java frontends.....).
Before I found this, I have already give up searching, and prepared my self to write something similar myself, to get this simple scan functionality just work through my Lan...

Everything in AirSane works just like expected, and beyond!
The Apple's AirScan protocol works fairly well without any further mess, open the image capture app in my iMac and the scanner is just there, everything just works.

Even the installation guide's quality is the best, with great clarity, I don't get a single error during the process, just copy and paste your command and it's just built and work fine. I really hope all the other software programmer's can do just the same, then we can save a lot time and cheer.

Anyway, thank you man, you got me saved. Keep moving on, make AirSane the best SANE frontend up to date!

Synology application stop working

When open Capture Application on MacOS Catalina 10.15, selecting "sharing" scanner (this scanner connecting to Synology NAS and shares by AirSane application running on NAS) and trying to receive preview picture, scanner start to scan but at the end of scanning it shows that connection to shared scanner is lost and it does not appear in "shared" list. In NAS AirSane application appears as stopped and needs to be restarted. This continues every time when trying to scan from Capture Application.

plustek backend is limited to 50dpi in Image Capture, but is fine via 8090

Hi,

After a lot of wrestling with cmake I finally managed to get this cross-compiled for Synology NAS Linux. Some time ago I built a sane-backends package for these devices and their very diverse CPU architectures (7 targets). Ideally I aim to include your software with that package so that sane-supported scanners connected to the NAS work seamlessly with modern Macs.

Using the latest source I encountered an error compiling pdfencoder.cpp: 'runtime_error' is not a member of 'std' which I resolved by adding an include for stdexcept to that source file. I linked to sane-backends version 1.0.28.

AirSane works as described, however I notice that the plustek backend which my own scanner uses (Canon LiDE 20) seems to be limited to 50dpi in macOS Image Capture. The GUI only shows that one value in the resolution dropdown. I notice however that the airsaned local web server does offer resolutions of 50, 300, 600, and 1200dpi. I have verified that acquisition via this method does function correctly all the way to 1200dpi. Typical values 75 and 150 are missing.

Test system:
Mac OS High Sierra 10.13.6, Image Capture 7.0 (1106)

The same behaviour persists using:
Mac OS Mojave 10.14.6, Image Capture 8.0 (1106)

Since the web acquisition method on TCP8090 works, this does suggest the available resolutions are perhaps not being communicated correctly to Image Capture.

Please can you take a look?

Thanks

Patters

Please clarify reverse engineering

Hi,

For including your software in debian, we should have a statement of the reverse engineering.

I suppose you have done a clean room implementation.

Could you certify that you have done correctyl and legally the reverse engineering ?

Thanks
[email protected]

AirScan documentation

I'm interested in basically writing the reverse of this code - a SANE backend that talks to AirScan/eSCL devices on the network, and allows existing SANE frontends (e.g. xsane) to scan from them.

You say this in your README:

AirSane has been developed by reverse-engineering the communication protocol implemented in Apple's AirScanScanner client

Would you be willing to share your reverse-engineering notes? Or any resources you may have found that documents this protocol?

VueScan does not detect Scanner

VueScan, I believe should detect the scanner from the Avahi advertisement as it does with tested eSCL Scanners and this project https://github.com/markosjal/AirScanning.

Vuescan simply is looking for something it is not seeing or understanding in the Avahi/Bonjour advertisement . This was tested on Localhost and over LAN with current VueScan Version

SOLVED! Clean Linux Mint 19.1 install error running

I just did a clean install of Mint 19.1 after seeing that ubuntu 16.04 has issues with PNG support.

I can get all the way through building and installing then I get the following at sudo systemctl ststus airsand (full status pasted below)

io/hpmud/pp.c 627: unable to read device-id ret=-1

I am currently using the SANE test back-end tester but as far as I can see it works in Simple Scan . I then reduced the number of virtual scanners to 1 (default is 2)

Also I tried to access http://localhost:8090/eSCL/ScannerStatus and get a page not found but as I understand it an AirScan Scanner (AirSANE in this case) should respond to that URL.

sudo systemctl status airsaned
● airsaned.service - AirSane Imaging Service
Loaded: loaded (/lib/systemd/system/airsaned.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-06-06 14:19:47 CDT; 8min ago
Main PID: 2722 (airsaned)
Tasks: 6 (limit: 4464)
CGroup: /system.slice/airsaned.service
└─2722 /usr/local/bin/airsaned --interface=* --listen-port=8090 --access-log= --hotplug=true --mdns-announce=true -

Jun 06 14:19:47 mark-HP-EliteBook-6930p systemd[1]: Started AirSane Imaging Service.
Jun 06 14:19:47 mark-HP-EliteBook-6930p airsaned[2722]: io/hpmud/pp.c 627: unable to read device-id ret=-1
lines 1-10/10 (END)

Unable to locate package libusb-1.*-dev

When following the README.md instructions, I got the following error:

$ sudo apt install libusb-1.*-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libusb-1.*-dev

I forget how I got it to work when I was initially running through the instructions. This is what I currently have installed:

$ apt list --installed | grep libusb

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libusb-0.1-4/focal,now 2:0.1.12-32 amd64 [installed,automatic]
libusb-1.0-0-dev/focal,now 2:1.0.23-2build1 amd64 [installed]
libusb-1.0-0/focal,now 2:1.0.23-2build1 amd64 [installed,automatic]
libusb-1.0-0/focal,now 2:1.0.23-2build1 i386 [installed,automatic]
libusb-1.0-doc/focal,focal,now 2:1.0.23-2build1 all [installed,automatic]
libusb-dev/focal,now 2:0.1.12-32 amd64 [installed]
libusbmuxd6/focal,now 2.0.1-2 amd64 [installed,automatic]

Judging by what's installed, it looks like this is what I did that ended up working:

$ sudo apt install libusb-1.0-0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libusb-1.0-0-dev is already the newest version (2:1.0.23-2build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

(IIRC I tried installing just libusb-dev, since that is indeed also manually installed on my system, but the make script didn't like that and insisted I use libusb-1.0-0-dev instead.)

So, I guess, if it's okay to specify libusb-1.0-0-dev rather than libusb-1.*-dev, you could just update that in the instructions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.