sane - bunnyamin/bunnix GitHub Wiki

Overview

Distribution Package
Arch Linux sane
Arch Linux sane-airscan
Arch Linux xsane-gimp

USB connection requires the IPP protocol, normally designed for network printers, and can be used for USB printers.

  • Arch Linux IPP-USB systemctl enable --now ipp-usb

Common configuration

Command Example Comment
List devices scanimage -L -> device `xerox_mfp:tcp 192.168.0.109' is a Samsung C460 Series multi-function peripheral
List device options scanimage -A -> All options specific to device `xerox_mfp:tcp 192.168.0.109': ...

Server

  • SystemD systemctl status saned.socket

USB connection

  • sane-find-scanner and note the libusb:000:000
  • Note the permission ls -la /dev/bus/usb/007/008
  • The device ID 0000:0000: lsusb
  • Test if device is defined in configuration files: grep '0000.*0000' /etc/sane.d/*.conf

Udev

/etc/udev/rules.d/40-sane.rules ATTRS{idVendor}=="0000", ATTRS{idProduct}=="0000", ENV{libsane_matched}="yes", MODE="0664", GROUP="scanner"

/etc/ipp-usb/ipp-usb.conf

  • Expose network interface to local network: interface = all
  • systemctl restart ipp-usb

Driver

  • /etc/sane.d/dll.conf

Enable

  • airscan or
  • `"backend"

Determine backend support for hardware model: SANE: Supported Devices. For example, the backend for CanoScan LiDE 100 is genesys. ensure that it is present, and not commented out, in /etc/sane.d/dll.conf.

Configuration file to identify scanner:

  • echo usb 0x00000 0x0000 > /etc/sane.d/name.conf
  • Attempts to open library /usr/lib/sane/libsane-<name>.so[.version]

Network connection

Enable either

  • net, escl in /etc/sane.d/dll.conf or disable them and use
  • airscan

Airscan

  1. Ensure the device is connected to network.
  2. Scan for devices: airscan-discover
  • If any devices are found it returns their IPv4 and IPv6.
  • Note the relevant device: airscan-discover
  • The device should be shared on network. For example:
    • "Device name (WSD)" = http://1.2.3.4:80/WebServices/Device, WSD

Net, escl

  • Add host names, IP or subnets to "Access list": /etc/sane.d/saned.conf
  • Enable "localhost": /etc/sane.d/net.conf

Client

Network

Enable either

  • airscan
  • backend

Airscan

  • Install "airscan"
  • Add the relevant device noted on server to client configuration section [device] in /etc/sane.d/airscan.conf
    • The device should be found on access. For example: xsane or scanimage -L
  • What scanner capabilities: http://<SERVER IP:PORT>/<eSCL, WSD>/ScannerCapabilities

Backend

Manual connect to server:

  • Add server IP: /etc/sane.d/net.conf
  • xsane [driver]:net:<SERVER IP>

Debug, errors, troubleshooting

  • If scanner not found after setup, try unplugging and re-plugging the USB.
  • Is the SANE port open on server? nmap <SERVER IP>
  • export SANE_DEBUG_DLL=255 && scanimage -L
  • scanimage -d "net:<SERVER IP>" --output-file test.png
  • scanimage -d "airscan:e0:<SCANNER>" --output-file test.png
  • systemctl status saned.socket provides information on number of connections that have been "Accepted" "Connected" "Refused".
Event Error Cause Consequence Remedy
scanimage -d ... Failed to open device net:<SERVER IP><br />Invalid argument.
scanimage -d ... Failed to open device net:<SERVER IP><br />Error during device I/O. scanner capabilities query: Internal Server Error

Enable debug for airscan /etc/sane.d/airscan.conf

[debug]
trace   = ~/airscan/trace
enable  = true
⚠️ **GitHub.com Fallback** ⚠️