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]

Share over network

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

Airscan

  • Note the relevant device: airscan-discover

Net

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

Network connection

Enable network on device.

SystemD-NetworkD

Create a network configuration. For example:

lan-ether-name.network

[Match]
Name=<network device>

[Link]
RequiredForOnline=false

[Network]
ConfigureWithoutCarrier=false

DHCP=yes
DHCPServer=true

IPv4Forwarding=true
IPv6Forwarding=true

IPMasquerade=both

Address=<IP for DHCP Server>

[Link]
RequiredForOnline=false

[DHCP]
UseDNS=true

The command airscan-discover should return devices served on 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

Client

Network

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

Brother

x86

  1. Download "scanner driver"
  2. Extract the package
  3. Copy the driver
    • brscan4-0.4.11-1_amd64/usr/lib64/sane/libsane-brother4.so.1.0.7
    • to /usr/lib/sane/
    • and version links:
      • ln -s libsane-brother4.so.1.0.7 libsane-brother4.so.1.0
      • ln -s libsane-brother4.so.1.0.7 libsane-brother4.so
⚠️ **GitHub.com Fallback** ⚠️