SANE Backends network scanning package for Synology NAS

UPDATE – SANE version 1.0.28, new frontend AirSane package, and updated frontend software info below

SANE-package

Many scanners last considerably longer than they enjoy driver updates for. Manufacturers are seldom willing to update drivers for new operating systems. The transition to 64bit was a similar obstacle. Furthermore Microsoft dropped support for the TWAIN scanning API in favour of the WIA (Windows Image Acquisition) for 64bit versions of its OS, and Apple removed TWAIN in macOS 10.9 Mavericks, superseded by ICA (Image Capture Architecture). These conditions have resulted in a mountain of perfectly good hardware being thrown away unnecessarily. I recently found myself without any modern drivers for my own Canon CanoScan LiDE 20, so I decided to do something about the problem. Now you can use this package to share your obsolete scanner from your Synology NAS.

SANE is an open source scanning API which has a fantastic wealth of device support. SANE’s differentiator is that it separates the drivers (backend) from the presentation and the scanning (frontend). This is ideal for a headless device like a NAS, and it also frees the frontend to be quite generic rather than highly customized to each device.

 

Device Support

HP all-in-one models are not supported by the package since their backend hpaio is not part of a standard SANE build, and it requires significant additional dependencies. Scanner backends which require libieee1284 are not supported by the package (canon_pp, hpsj5s, and mustek_pp), neither is backend dell1600n_net which needed a TIFF library and in fact only supports one device. You can verify which backend is required for your model of scanner using the SANE Project search engine. Expand below for the full list of backends which this Synology package supports:

Backend support in Synology package as of version 1.0.28-003
------------------------------------------------------------

Note that some backends default to disabled in /var/packages/sane-backends/target/etc/sane.d/dll.conf
This can be because they may slow down detection routines
This is a default SANE config unrelated to the Synology pacakge
Detection is faster if unused backends are commented out in this file

abaton
agfafocus
apple
artec
artec_eplus48u
as6e
avision
bh
canon
canon630u
canon_dr
cardscan
coolscan
coolscan2
coolscan3
dc25
dc210
dc240
dmc
epjitsu
epson
epson2
epsonds
fujitsu
genesys (except on armv5tel which lacks C++11 toolchain support)
gt68xx
hp
hp3500
hp3900
hp4200
hp5400
hp5590
hpljm1005
hs2p
ibm
kodak
kodakaio
kvs1025
kvs20xx
kvs40xx
leo
lexmark
ma1509
magicolor
matsushita
microtek
microtek2
mustek
mustek_usb
mustek_usb2
nec
net
niash
p5
pie
pieusb
pixma
plustek
plustek_pp
qcam
ricoh
ricoh2
rts8891
s9036
sceptre
sharp
sm3600
sm3840
snapscan
sp15c
st400
stv680
tamarack
teco1
teco2
teco3
test
u12
umax
umax_pp
umax1220u
xerox_mfp
 

Synology Package Installation

  • In Synology DSM’s Package Center, click Settings and add my package repository:
    Add Package Repository
  • The repository will push its certificate automatically to the NAS, which is used to validate package integrity. Set the Trust Level to Synology Inc. and trusted publishers:
    Trust Level
  • Now browse the Community section in Package Center to install SANE Backends.
    Community-packages
    The repository only displays packages which are compatible with your specific model of NAS. If you don’t see SANE Backends in the list, then either your NAS model or your DSM version are not supported at this time. DSM 6.0 is the minimum supported version for this package.
  • When the package is started it will attempt to detect a scanner and output the results to the package log. If your scanner is listed in the log, that is all that is required at the backend.
  •  

    SANE Frontend for the Computer

    Since I have a variety of systems at home I spent some time investigating the various options. I list them in order of quality of experience below (updated in September 2019). You will need to manually specify the IP address of your NAS when setting up the scanner. Be aware that the scanner will need redefining on the computer if you change USB port later for instance. No credentials are needed for connection by default.

    • AirSane (macOS Mojave and earlier) – Hands down the most elegant SANE frontend solution, and one which I have now packaged separately for Synology. AirSane will autodetect any available SANE scanner and will advertise it via Bonjour to the macOS Image Capture application as a shared AirScan device. No configuration is required – it just works! Even if you don’t have a Mac it offers a simple WebUI for scanning.
      AirSane is in active development at the time of writing in September 2019, in fact its author SimulPiscator fixed a few issues I discovered while testing prior to packaging it.
    • WiaSane (Windows 10 and earlier) – Marc Hoersken has developed a SANE to WIA bridge which works very well, presenting the remote device to Windows Device Manager as if it is locally attached. Scanning using the Windows Fax and Scan application is seamless (preview, partial selections etc.), and other software with WIA support can be used, for instance NAPS2 (Not Another PDF Scanner 2) which offers OCR, and Paint.net, both of which are free. Although the latest version of WiaSane does now include a signed device driver which works in Windows 10, the device configuration wizard only seems to work at install time, and each time the scanner changes USB ID it has to be removed and reinstalled.
      WiaSane was last updated in February 2017
    • SwingSane As a Java application SwingSane will run on most operating systems. It is full-featured but it has some rough edges which caused me to think it was broken when I first evaluated it. This explanatory video by SwingSane’s author Roland Quast explains some of the non-obvious aspects.
      The most confusing thing is that the Settings tab was not offering me the appropriate settings for my scanner – for instance I could not set the resolution or the page size. Roland explains in the video that these main settings were specifically targeting Epson scanners, and that for all other models Custom Settings should be used, in particular he recommends to select Check Options which queries the backend driver for its parameters. The next problem is that with custom settings SwingSane will not select the whole bed of the scanner by default, only a small selection. If you export the settings and inspect the XML file you can discover the constraint values (maxima) for the br-x and br-y values in millimetres (bottom right of the selection rectangle), set those and save the settings. This is far too counter-intuitive when surely these values can be determined automatically by the software.
      One strength of SwingSane however, is that all the scans produced in the current session are stored in the preview tab and can be output to the same multi-page PDF (AirSane and Image Capture also permits this). Finally, the file requestor confused me on macOS (more so than on Windows). There is a dropdown for File Format which is blank (why show this?). I was expecting to specify the filename, but this is determined by the scan batch so really the file requestor is asking for a destination folder only. This should be stated in the window title. Furthermore on macOS you cannot save once you have browsed inside a folder – you have to navigate to the parent and select the destination folder without navigating to its contents! This is really not obvious and leads you to suspect the software is broken.
      SwingSane was last updated in April 2015.
    • SaneWinDS (Windows 10 and earlier) – This frontend does not hook into WIA so you will have to use it for the scan acquisition rather than acquiring from inside applications. It does a good job of presenting the available options, and will send the scans directly to the default application for the destination file type. There is no driver component – it’s just a software application so it works fine even on Windows 10.
      Author Alec Skelly last updated SaneWinDS in April 2015.
     

    Notes

    • The package can be stopped and started in Package Center but really this is to launch and provide the log output of sane-find-scanner and scanimage -L in the easiest way for non-technical users. saned uses the inetd super-server daemon so it is only loaded and invoked when a SANE frontend makes contact on port 6566. This means that really there is no performance nor memory penalty for leaving the package running all the time, even on very resource limited systems.
    • Unfortunately Synology decided to remove the ability to view package log files via the DSM 6.2 GUI and they’ve provided no information in the Developer Guide on how to integrate with the new Log Center apps. I lack the motivation to reverse engineer functionality the company significantly alters with each DSM release, so troubleshooting this package does now require some familiarity with SSH or SCP. The package log file is /var/packages/sane-backends/target/var/sane-find-scanner.log
    • Now that I have built the package with libusb 1.0 rather than using DSM’s version 0.1, it does automatically detect scanners that have been hot-plugged.
    • By default access is granted to SANE frontends originating from any IP address (0.0.0.0/0 and ::/0 for IPv6). This can be restricted by modifying /var/packages/sane-backends/target/etc/sane.d/saned.conf, or by configuring the DSM Firewall.
    • By default connections to the SANE backends do not require credentials. If you would like to secure devices, create the text file /var/packages/sane-backends/target/etc/sane.d/saned.users, specifying credentials in the format “user:password:backend”, e.g.:
      swingsane:fqkg3h328rge:plustek
    • The DSM 6.0 toolchains provide pre-built development libraries for certain components such as avahi and dbus which are complex to build. Although I did not build sane-backends with support for avahi (due to stability issues), these libraries are needed by the AirSane package hence the new requirement for DSM 6.0 at a minimum. Some much older macOS SANE frontends make the assumption that avahi will be used and so do not allow you to statically define a target IP address, so they cannot be used with this package.
    • Although most of the library search path behaviour can be controlled at compilation time, unfortunately the backend drivers are searched for using a static path, and sane-backends insists on saving its configuration in a static location. I am always careful that my packages do not damage the system they are installed on so I have kept all of this contained within /var/packages/sane-backends/target by cross-compiling in this same location on my development Linux VM. My build steps are documented on GitHub.
     

    Package scripts

    For information, here are the package scripts so you can see what it’s going to do. You can get more information about how packages work by reading the Synology 3rd Party Developer Guide.

    installer.sh

    #!/bin/sh
    
    #--------SANE Backends installer script
    #--------package maintained at pcloadletter.co.uk
    
    
    SYNO_CPU_ARCH="`uname -m`"
    [ "${SYNOPKG_DSM_ARCH}" == "comcerto2k" ] && SYNO_CPU_ARCH="armneon"
    [ "${SYNOPKG_DSM_ARCH}" == "armada375" ] && SYNO_CPU_ARCH="armneon"
    [ "${SYNOPKG_DSM_ARCH}" == "armada38x" ] && SYNO_CPU_ARCH="armneon"
    [ "${SYNOPKG_DSM_ARCH}" == "alpine" ] && SYNO_CPU_ARCH="armneon"
    [ "${SYNOPKG_DSM_ARCH}" == "alpine4k" ] && SYNO_CPU_ARCH="armneon"
    [ "${SYNOPKG_DSM_ARCH}" == "monaco" ] && SYNO_CPU_ARCH="armneon"
    NATIVE_BINS_URL="https://syno.pcloadletter.co.uk/bin/sane1.0.28-native-${SYNO_CPU_ARCH}.tar.xz"   
    NATIVE_BINS_FILE="`echo ${NATIVE_BINS_URL} | sed -r "s%^.*/(.*)%\1%"`"
    INSTALL_FILES="${NATIVE_BINS_URL}"
    COMMENT="# Synology SANE Backends Package"
    TEMP_FOLDER="`find / -maxdepth 2 -path '/volume?/@tmp' | head -n 1`"
    PUBLIC_FOLDER="`synoshare --get public | sed -r "/Path/!d;s/^.*\[(.*)\].*$/\1/"`"
    source /etc/profile
    
    
    preinst ()
    {
      cd ${TEMP_FOLDER}
      for WGET_URL in ${INSTALL_FILES}
      do
        WGET_FILENAME="`echo ${WGET_URL} | sed -r "s%^.*/(.*)%\1%"`"
        [ -f ${TEMP_FOLDER}/${WGET_FILENAME} ] && rm ${TEMP_FOLDER}/${WGET_FILENAME}
        wget ${WGET_URL}
        if [ $? != 0 ]; then
          if [ -d ${PUBLIC_FOLDER} ] && [ -f ${PUBLIC_FOLDER}/${WGET_FILENAME} ]; then
            cp ${PUBLIC_FOLDER}/${WGET_FILENAME} ${TEMP_FOLDER}
          else
            echo "There was a problem downloading ${WGET_FILENAME} from the official download link, " >> $SYNOPKG_TEMP_LOGFILE
            echo "which was \"${WGET_URL}\" " >> $SYNOPKG_TEMP_LOGFILE
            echo "Alternatively, you may download this file manually and place it in the 'public' shared folder. " >> $SYNOPKG_TEMP_LOGFILE
            exit 1
          fi
        fi
      done
    
      exit 0
    }
    
    
    postinst ()
    {
      #extract CPU-specific binaries
      cd ${SYNOPKG_PKGDEST}
      tar xJf ${TEMP_FOLDER}/${NATIVE_BINS_FILE} && rm ${TEMP_FOLDER}/${NATIVE_BINS_FILE}
    
      #allow access to saned by default (this can be restricted by IP/subnet)
      echo 0.0.0.0/0 >> /var/packages/${SYNOPKG_PKGNAME}/target/etc/sane.d/saned.conf
      echo ::/0 >> /var/packages/${SYNOPKG_PKGNAME}/target/etc/sane.d/saned.conf
    
      #add firewall config
      /usr/syno/bin/servicetool --install-configure-file --package /var/packages/${SYNOPKG_PKGNAME}/conf/${SYNOPKG_PKGNAME}.sc > /dev/null
    
      exit 0
    }
    
    
    preuninst ()
    {
      `dirname $0`/stop-start-status stop
    
      exit 0
    }
    
    
    postuninst ()
    {
      #remove system configuration changes
      sed -i "/${COMMENT}/d" /etc/services
      sed -i "/${COMMENT}/d" /etc/inetd.conf
    
      #remove firewall config
      if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ]; then
        /usr/syno/bin/servicetool --remove-configure-file --package ${SYNOPKG_PKGNAME}.sc > /dev/null
      fi
    
      exit 0
    }
    
    
    preupgrade ()
    {
      `dirname $0`/stop-start-status stop
    
      exit 0
    }
    
    
    postupgrade ()
    {
      exit 0
    }
    
     

    start-stop-status.sh

    #!/bin/sh
    
    #--------SANE Backends start-stop-status script
    #--------package maintained at pcloadletter.co.uk
    
    PKG_FOLDER="/var/packages/sane-backends"
    DLOG="${PKG_FOLDER}/target/var/sane-find-scanner.log"
    COMMENT="# Synology SANE Backends Package"
    source /etc/profile
    source /root/.profile
    
    
    EnvCheck ()
    #updates to DSM will reset these changes so check them each startup
    {
      #/etc/services should contain 1 line added by this package tagged with trailing comments
      COUNT=`grep -c "${COMMENT}$" /etc/services`
      if [ $COUNT != 1 ]; then
    
        #remove any existing mods
        sed -i "/${COMMENT}/d" /etc/services
    
        #make the required changes
        echo "sane-port       6566/tcp                        ${COMMENT}" >> /etc/services
      fi
      #/etc/inetd.conf should contain 1 line added by this package tagged with trailing comments
      COUNT=`grep -c "${COMMENT}$" /etc/inetd.conf`
      if [ $COUNT != 1 ]; then
    
        #remove any existing mods
        sed -i "/${COMMENT}/d" /etc/inetd.conf
    
        #make the required changes      
        echo "sane-port stream tcp    nowait  root    ${PKG_FOLDER}/target/sbin/saned    saned  ${COMMENT}" >> /etc/inetd.conf
      fi
      #/usr/syno/etc/synoservice.d/pkgctl-sane-backends.cfg should contain an upstart entry for inetd
      COUNT=`grep -c "inetd" /usr/syno/etc/synoservice.d/pkgctl-sane-backends.cfg`
      if [ $COUNT != 1 ]; then
        sed -i -r "s/(\"pkgctl-sane-backends\")/\1,\"inetd\"/" /usr/syno/etc/synoservice.d/pkgctl-sane-backends.cfg
      fi
    }
    
    case $1 in
      start)
        EnvCheck
        reload inetd
        echo `date "+%F %R"` startup. `${PKG_FOLDER}/target/bin/sane-find-scanner -q` > ${PKG_FOLDER}/target/var/sane-find-scanner.log
        echo `date "+%F %R"` `${PKG_FOLDER}/target/bin/scanimage -L` >> ${PKG_FOLDER}/target/var/sane-find-scanner.log
        exit 0
      ;;
    
      stop)
        #remove any existing config changes
        sed -i "/${COMMENT}/d" /etc/services
        sed -i "/${COMMENT}/d" /etc/inetd.conf
        killall -q saned
        reload inetd
        exit 0
      ;;
    
      status)
        grep -q "${COMMENT}" /etc/inetd.conf && exit 0 || exit 1
      ;;
    
      log)
        echo "${DLOG}"
        exit 0
      ;;
    
    esac
    
     

    Changelog:

    • 0003 15/Sep/19 – Updated to SANE 1.0.28 and libusb 1.0.23 (DSM still uses libusb 0.1), fixed inetd start issue, allowed connections on IPv6 interfaces by default, added support for new Synology product models, added aarch64 build for 64bit ARM CPUs, published a separate package AirSane to automatically present SANE scanners to the macOS Image Capture application, updated the section on frontends in this page. Old package version available here for DSM 5.0 users.
    • 0002 20/Jul/16 – Added support for Marvell Armada 385 SoC
    • 0001 16/Dec/15 – Initial public release
     
     
    Advertisements

64 thoughts on “SANE Backends network scanning package for Synology NAS

  1. Dattel

    Hi… before i tried to install sane several times manual. it works but i was frustrated because it only worked with xsane-frontend for windows and since windows 10-1511 xsane stucks…

    so today i googled around to find a working solution and here i am.
    first of all, i am a DS215j user with an attached Canon Pixma MX310 Device.
    The installation works like charm. sane seems to be configured correctly because i managed to scan from the shell:
    /var/packaged/sane-backends/target/bin/scanimage –format jpeg > /volumne1/test.jpeg

    but i can’t find the device neighter from sanewin (windows10) nor sanedroid…
    the saned.conf allows 0.0.0.0/0
    the inetd.conf includes:
    sane-port stream tcp nowait root /var/packages/sane-backends/target/sbin/saned saned # Synology SANE Backends Package

    maybe you can assist a bit…

    Reply
  2. Dattel

    okay it works!!!
    I restarted the diskstation and i think it restarts the firewall to support the ports for the sane-backend… thanks for the description

    Reply
  3. tonycpsu

    So glad you put this package together, as I had no luck using ipkg.

    Unfortunately, it’s not detecting my scanner, an HP v40xi. The device shows up in /proc/bus/usb/devices, but the sane-finds-scanner log says:

    No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages).

    If I run the sane-find-scanner util with -v, it shows all the devices it’s trying to open, but says “failed to open” with various errors for all of them. If I try to run it by pointing it at the specific /dev entry, it says:

    searching for USB scanners:
    checking /dev/usb/03f0:1011:[serialnumber]… failed to open (Invalid argument)

    Any ideas on what to try next?

    Reply
    1. patters Post author

      Having looked a little further into this, HP all-in-one model support is not included in a standard compile of sane-backends. These would need a separate backend called hpaio which is distributed by HP as part of the HPLIP toolkit (HP Linux Imaging and Printing):
      http://hplipopensource.com/node/128

      However, as you can see from the diagram this requires D-Bus, CUPS and other HP-specific components. D-Bus alone was sufficiently difficult to compile that I abandoned trying to include Avahi support in my build of SANE. Unfortunately this will make it difficult for me to include hpaio in the package. I have updated the main post with a Device Support section to make this clear.

      Reply
  4. Richard

    works nice with sanesroid and sees my scanner.
    But if i try to install phpsane i can’t get it to work it keeps on saying not scanner any thoughts on this?

    Reply
    1. patters Post author

      I did try to install phpsane on my Syno briefly because it would have been useful to include that in the package but I got the same result as you. I couldn’t figure it out. Sorry.

      Reply
  5. Kir C

    Hi !
    I successfully installed Sane. There was information about founded printer and scanimage -l result in the log.
    But SaneWinDS and SaneTwain can’t do something – I get “expired time to access the socket” problem.
    When i scan from shell (/var/packaged/sane-backends/target/bin/scanimage –format jpeg > /volumne1/test.jpeg) I get empty test.jpeg (0 kb).

    Printer Epson L210/DSM 5/2

    What can iI do to make it working?

    Reply
  6. Chris Parsons

    Installed this on my DS413 and to my delight my Canon Pixma MP460 is now visible and scanning again – seamless install and detection, 10/10 – thank you very much!

    I use SaneWinDS on W7 which is excellent but might also try some of the other front ends you mention.

    Reply
  7. Chris Mullins

    Successfully installed SANE, which recognizes my ScanSnap 510M that went dark when I upgraded my Mac to El Capitan. (Thanks Fujitsu!)

    Installed SingSane to my Mac. Nothing auto-detected. When attempting to connect manually I get:
    192.168.1.49:6566 – Connection refused

    I have restarted both devices, checked firewall and permissions, all to no avail.

    Any hints or guidance would be appreciated.

    Reply
    1. Mike

      Hi I have the same issue. Installed on my Synology DS3615xs, running DSM 6.0.2-8451 Update 8, Log reports:
      2017-06-03 18:30 startup. found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x1705 [hp scanjet scanner], chip=HP4500C/4570C/5500C/5550C/5590/7650) at libusb:003:003
      2017-06-03 18:30 device `hp5590:libusb:003:003′ is a HP 5590 Workgroup scanner

      from Mac client:
      telenet {hostip} 6566
      Connection refused
      telnet: Unable to connect to remote host

      SwingSane from Mac – Connection Refused.
      Window 10 Laptop – SaneWinDS – Connection Refused

      Checked firewall – 6566 open
      checked sand.conf
      ##Access list
      0.0.0.0/0

      What am I missing? Been trying to get this working for 1 week now… not sure where I’ve gone wrong, as all other feedback seems very straightforward.

      Thanks anyone for help, tips, advice…

      Reply
      1. PATATE12

        Thanks @patters, I cannot reply your 3rd level comment in WordPress.
        At first my Synology firewall was not activated (I don’t need it, my Synology is not accessible from internet).
        I activated it to add rules to allow 6566.
        Now I am deactivating it again to be in the most open setup, but still connection refused.

      2. patters Post author

        I use Wiasane 0.1.2.10 on Windows 10 and I don’t get this issue. When I connect to create the device in Windows it shows nothing unless I manipulate the dropdown (bad UI design for Wiasane) but other than that, no issues.

      3. PATATE12

        Thanks @patters for your Synology package anyway.
        Now I think that it’s my (pro.) laptop firewall that has many rule to block almost all outgoing ports.
        I tried with telnet and it just seems blocked (only 80, 443 works).
        I will try from another PC as soon as I can! :)

      4. PATATE12

        Same problem here on my Synology DS213+ where this SANE package has well identified my plugged in Canon CanoScan N1240U as I can see in /volume1/@appstore/sane-backends/var/sane-find-scanner.log:

        2019-08-18 18:36 startup. found USB scanner (vendor=0x04a9 [Canon], product=0x220e [CanoScan], chip=LM9832/3) at libusb:001:003
        2019-08-18 18:36 device `plustek:libusb:001:003′ is a Canon CanoScan N1240U/LiDE30 flatbed scanner

        But I tried 3 Windows 10 clients (wiasane, SANEWin / SANEWinDS and SwingSane) and they all cannot connect, they say the connection is explicitly refused by the server.

        I have added a rule to allow port 6566 to any IP and left the 0.0.0.0/0 default in /volume1/@appstore/sane-backends/etc/sane.d/saned.conf that is supposed to allow everyone also.

        It’s a pity as I thought I had found the solution to my no longer supported scanner.

      5. patters Post author

        Hi – I finally did get around to compiling a newer SANE for all the different Synology CPU architectures. I also believe I resolved the issue with inetd not starting correctly (which I think may have been the issue you encountered). I recommend my new AirSane package too, also on the repo. It’s for Macs mainly, but it offers a simple webUI for scanning.

  8. kyoshosan

    Hi.. I’ve successfully installed the package, and after connecting it directly to the usb port of the nas, it detects my Scanjet 6350c correctly. First tested scanning via scanimage. This works but it goes wrong when i supply option as -l -t -x or -y the scanner responds with i/o error.
    Scanning works with winsaneds and the wia driver but not without problems. Full page scanning works but only for 600dpi or lower settings. My scanner can reach 3200dpi, anything higher then 600dpi will generate i/o error (or status error). Scanning a full page @ 3200dpi works in scanimage. Same as with scanimage, changing a setting for scan area will generate a i/o error in winsaneds or wia driver. From what I could find is that it could be caused by the version 1.0.26 of the backend, is this a stable version?. Could you otherwise be so kind to create one with a stable backend version like 1.0.25?

    Reply
    1. patters Post author

      I’ll look into it – which NAS do you have? I’ll compile only the relevant CPU arch and then we can see if it fixes the issue. If it does, I’ll recompile all the builds.

      Reply
      1. jvdkyosho@gmail.com

        Hi patters…

        Sorry didn’t see your reaction sooner (forgot to enable notifications before posting..)

        I’ve got 2 nas devices, a ds411slim (arm 88f6282) and a ds214 (arm armadaxp).
        I’ve tested v002 but the same issues arise. My scanner is a HP ScanJet 6300C.

        Which OS are you using for the compiles… otherwise i’ll create a setup for the arm arch if needed. I have some time to do some test etc.. i’m trying to get the buttons in on the frontpanel to work also, sane should be 100% working with this scanner.

        Already thanks for the effort you have put into the project.

      2. jvdkyosho@gmail.com

        Hi patters..

        Sorry didn’t see your questions sooner, forgot to enable notifications..

        my 2 nas devices are the ds411slim (armv5) and a ds214 (armadaxp)..
        I’ve tried the 002 version but with the same results..
        If the armv5 works would the armadaxp not be backwards compatible? Oke.. maybe not the fastest runtime for the armadaxp but it should work not?

        Thanks for the effort so far..

      3. patters Post author

        Hi – I finally did get around to compiling a newer SANE for all the different Synology CPU architectures! I recommend my new AirSane package too, also on the repo.

  9. Alex

    Hi,

    any ideas why I cant see the SANE Backends package in my DSM 216j (DSM 6.0.1-7393 Update 1)? I execute the described steps above, but I cannot find the package in the Community section.

    Thanks,

    A.

    Reply
    1. patters Post author

      Hi Alex, that should be fixed now. Your system has a new processor type so I needed to add it to the package script.

      Reply
      1. Alex

        Hi,

        thanks for updating the script!

        I now see the package in the Community section. I can click the install button, the download starts and after some seconds it says: “SANE Backends: This packet is not supported on this DiskStation platform” (translated from German by me).

        Any ideas?

        Thanks,
        Alex

      2. Alex

        OK! Scanner detected (I have got an old Canon LIDE20). When I start a scan (via SANEWin or the WIA driver) the scanner makes a short noise (as if he would start to scan) and then stops without scanning. Any ideas?

        Thanks a million for your work,

        Alex

      3. patters Post author

        Hi Alex, that’s strange because you have the exact same model of scanner that I have. Mine doesn’t do that, but I’m on an Intel NAS and I haven’t been able to test the package on different systems. I did the cross-compile of the native binaries in a consistent way though so it should be identical. Can you get the preview scan working? Have you confirmed that the scanner still physically works (on an old system perhaps, or via a VirtualBox VM with USB support and an old OS for instance)?

        One option you could try is a little complex – but you could attempt to make the package use the regular ARMv7 binaries instead of the ones built for ARM CPUs with NEON. To do this you would need to download the SANE package file to your local computer. Then you also need to save the SANE ARMv7 native binaries file locally too. Rename that file from sane-native-armv7l.tar.xz to sane-native-armvhfneon.tar.xz and place it in the public (all lowercase) shared folder on your NAS. If it doesn’t exist, create this folder using the DSM Shared Folder control panel.

        Now manually reinstall the package, but make sure your NAS has no Internet access (disconnect your home broadband, or put a fake DNS server in your NAS network settings). It will fail to download the native binaries archive file during the install and it will use the one in public instead. See if this fixes the scanner behaviour.

  10. A.P.

    Hi,
    I cannot get the package installed. Now I looked at the installer.sh script and I found that there is a “uname -m” command for determining the CPU architecture. When I run this command on my Synology I get “armv7l” (the last letter being an L not the digit one). But there is no sane-native-armv7l.tar.xv in your download folder.

    Can you help me here?

    Thanks,

    Alex

    Reply
  11. Alex

    Hi,
    I reinstalled the package manually, same effect :(
    Just one remark: the file name had to be “sane-native-armvhfneon.tar.xz”.

    When I use SANEWin for instance the scanner makes some noise and then I get:
    “No pages were acquired. The Automatic Document Feeder may be empty or the job may have been cancelled.”
    After that the scanner does not even make any noise and I have to restart the SANE Backends service.

    Yes, the scanner works nicely on my old Windows7 32-bit machine which is only used for scanning meanwhile.

    Thanks,

    Alex

    Reply
  12. Felipe Oliveira

    HI patters, I would like to contact you but I could not find your e-mail. Would you be interested in provide me a consulting service ? If yes please contact me by e-mail and I will tell you the details.

    PS: Congratulations for your articles, they are very interesting.

    Thank you
    Regards

    Reply
  13. jvdkyosho@gmail.com

    Hi patters… sorry for the late reply.. forgot to switch on notifications..
    my 2 nas devices are the ds411slim (armv5) and a ds214 (armadaxp)
    i’ve tried v0002 but the result is the same.

    thanks for your effort so far…

    Reply
  14. Huan Nguyen

    Hi,

    I’m using DS216+II with Intel Celeron N3063 and DMS 6.0.2.8451 Update 2 (latest DSM).
    Sane packages installed ok and it’s can recognize my Kodak i1150 scanner. But I don’t know how to use Sane frontend to use the scanner. Have tried with swingsane, wiasane, and scanwinds but no luck.

    Can you pls. guide me how to troubleshoot?

    Thanks,

    Reply
  15. Martin

    Hi there,

    I installed the package with no problems on my DS416. It did not start the inetd (something I need to look into, to make sure it does start automatically). I am using oVirt and running a number of virtual machines. If the virtual machine runs Centos 6.8, all is well, it works perfectly. Oddly enough, if I am running Centos 7.2 or Fedora 24, neither of them detect the scanner. Both will allow me to telnet to the port (6566) where the scanner is running on the Synology and the port is open, but unfortunately, scanimage -L did not see the scanner. Unfortunately, I had a feeling it is probably down to something in the newer versions of Centos and Fedora. Has anyone else come across this?

    Thanks for an excellent package – I will just stick with centos 6.8 for the time being.

    Martin

    Reply
  16. Romain

    Hello there,

    First, a huge thanks for your work. I’ve been willing to share my scan on the network for so long, that finally succeeding thanks to you felt so good :)

    But I ran into a problem, that I’ll try to describe with my non specialist words :

    First, I have an EPSON Stylus DX8450 and a DS216play.
    – I followed your steps, the SANE log indicated that it found “epson2:libusb:001:002” as a Epson CX8400 flatbed scanner. Not mine, but well, it discovers something, I was happy.
    – I installed WiaSane, it found the scanner, and then successfully made a scan with the Windows Scan and Fax.
    – I went to another computer on the same network, installed WiaSane too and successfully made another scan.

    So far so great ! But I did a test : what happens if I turn off and on again the multifunction printer ? Will the config be broken ? And it appears yes…

    I restarted the SANE package with the printer on, it created another scanner “epson2:libusb:001:003”, and I add to reinstall WiaSane with this new scanner to make it works again.

    Is it normal than turning on and off the MFP but not the SANE package break everything ?

    Thanks for your help anyway :) !

    Romain

    Reply
    1. patters Post author

      I do tend to find the same thing (the USB binding changes) which is a bit annoying. I only occasionally need to use my scanner so I tolerate it.

      Reply
  17. Tonne

    Patters, you have done a great job. I have a question though. I installed the package on my synology DS214 with DSM 6.0.2-8451 Update 8.
    When i run /volume1/@appstore/sane-backends/sbin/saned -d5 (as user root) every time when a connection is needed i can get some interaction. But i can’t get inetd to let it run automaticaly. What am i doing wrong?

    Thanks in advance for any help

    Tonne

    Reply
  18. LARdT

    SANE looks very good and seems to be a grat piece of work.
    SANE Backoffice in my NAS detecs properly my Canoscan LIDE30
    I am able to execute SANE commands from my Putty console and seems fine,
    BUT I am not able to make the FROMTOFFICE WORK!
    In Windows10 with SaneWinDS or in the MAC with SwingSANE the answer is the same:
    “host 192.168.1.15 denies the conection to 192.168.1.15:6656” despite I have (to the best of my knowledge) opened the 6656 port.
    Can someone help me with this? It has to be something related to the backoffice (SANE, NAS) part because it fails just the same, from different computers, with different OS and different frontoffice programs.

    Reply
  19. rcj4747

    I found that inetd wasn’t running so I wasn’t seeing a device from my client. I ran ‘/var/packages/sane-backends/target/sbin/saned -d’ on the NAS and found that the client could connect (after adding a firewall rule to allow it).

    The problem I had was inetd was set for manual activation for init (/etc/init/inetd.override existed and contained ‘manual’). I can remove the override file, run ‘initctl start inetd’, and then the client will see a scanner when I run ‘scanimage -L’ (after adding the NAS IP to /etc/sane.d/net.conf on the client). However, once I reboot the NAS the override file is recreated and inetd is again not running. I don’t have a solution for that yet.

    Also, in /var/packages/sane-backends/target/etc/sane.d/saned.conf could you add ‘::/0’ which the IPv6 equivalent of 0.0.0.0/0?

    I’m running DSM 6.1.3-15152 Update 2 (2017/07/23) on a DS415+

    Reply
    1. rcj4747

      The only other thing in /etc/inetd.conf is telnet. I found as a workaround I can enable telnet in the UI but not enable the telnet firewall rule (because I really don’t want telnet access available). This has the side-effect of enabling inetd and keeping it enabled after reboot. With this change inetd runs, saned is available, and clients see the scanner.

      Reply
    2. patters Post author

      Also, in /var/packages/sane-backends/target/etc/sane.d/saned.conf could you add ‘::/0’ which the IPv6 equivalent of 0.0.0.0/0?
      Done!

      Reply
    1. patters Post author

      Thanks for the improvement suggestion. I’ll try to find time to update the package. Presumably I don’t see this behaviour because my syno is using some other component which depends on inetd. If you get it working as expected, do please let me know since I may find it hard to get my system to not run inetd.

      Reply
      1. paulanomaliePaul

        I confirm the behaviour described by rcj4747.
        I added a sane.cfg file with this content :
        {
        “service_name”: “sane service”,
        “auto_start”: “yes”,
        “init_job_map”: {
        “upstart”: [“inetd”]
        }
        }

        here : /usr/syno/etc/synoservice.d/

        Restarted my synology.
        And inetd is running, I can access my scanner !

        Looks like a good workaround to be added to the package install script ?

        thanks to you guys !

        Paul

      2. paulanomalie

        I confirm the problem with inetd not started described by rcj4747.
        I also confirm the solution.

        Here what I did :
        First test manually.
        syno:/$ sudo mv /etc/init/inetd.override /etc/init/inetd.override.backup
        syno:/$ sudo initctl start inetd

        At this point I could connect to my scanner from client
        Then I tested the solution mentioned to make inetd start at boot.

        Create a package config file (might need other info in this config file ?)
        syno:/$ sudo vi /usr/syno/etc/synoservice.d/sane.cfg
        {
        “service_name”: “sane service”,
        “auto_start”: “yes”,
        “init_job_map”: {
        “upstart”: [“inetd”]
        }
        }
        :x to save and exit

        Then I restarted the syno and hourra scanner can be reached.
        Indeed :
        syno:/$ sudo initctl status inetd
        Password:
        inetd start/running, process 5317

        Looks like problem solved.

        Thanks to both of you patters and rcj4747

      3. Mr.4711

        I had the same problem with a not running inetd and I can confirm the solution from paulanomalie. So I think it would be a good idea to include the file into the package.

    2. patters Post author

      I have now incorporated this fix, but rather than create a new file I have made the package start-stop-status script make the needed change to /usr/syno/etc/synoservice.d/pkgctl-sane-backends.cfg.

      Reply
  20. Daniel CLEMENT

    Hi,

    I discovered this package last week and I installed it on my Syno DS414slim. But I’m at a loss as to how I could have my good old scanner discovered on the network. Here are the details:

    – the package definitely can talk to my scanner; here is the log output (which looks good):
    2018-06-09 14:16 startup. found USB scanner (vendor=0x04a9 [Canon], product=0x220e[CanoScan], chip=LM9832/3) at libusb:003:002
    2018-06-09 14:16 device `plustek:libusb:003:002 is a Canon CanoScan N1240U/LiDE30 flatbed scanner

    – I then created the “Sane backends” firewall rule on the Syno to allow port 6566

    But even then, my usual XSane software (I’m on Linux Debian) fails to detect anything, and nor does SwingScan. Below is its log:

    Discovery complete
    fe80:0:0:0:222:19ff:feee:812c:6566 – Relais brisé (pipe) (Write failed)
    Querying saned (fe80:0:0:0:222:19ff:feee:812c:6566)
    fe80:0:0:0:222:fbff:fe4d:ff0a:6566 – Relais brisé (pipe) (Write failed)
    Querying saned (fe80:0:0:0:222:fbff:fe4d:ff0a:6566)
    Querying saned (192.168.0.187:6566)
    Querying saned (192.168.0.85:6566)
    Discovering SANE servers

    Thank you very much for any insight about what I could be missing. Best regards, Daniel

    Reply
    1. Daniel CLEMENT

      Hmm… Problem solved apparently, 1st by enabling Telnet (which started inetd) and then adding sane.cfg file, as per paulanomalie’s and rcj4747’s posts. Sorry about the noise–I wrongly assumed the sane.cfg file was already there in the latest package. Thx to all.

      Reply
  21. meyerjh2001J

    Dear All,
    just migrated to a new DS – wanted to continue my happy (and very thankful) use of SANE, but the package doesn’t appear in the repository… is it down? Did it disappear? pcloadletter is properly added as source…
    Thanks a lot for any insights!
    Best regards, jan

    Reply
  22. JP Nielsen

    Hi
    I got a DS713+ (intel atom D2700) (DSM 6.2.1-23824 Update 1) and a Hewlett Packard flatbed scanner ScanJet 5300C, but the SANE backends reports an I/O error at scan or at test (scanimage -T). The scanner makes a short noise and that’s it. After that the SANE backends doesn’t find my scanner and I have to reboot scanner and SANE backends to be back at start. Access is done both with telnet and with SaneWinDS.

    Reports are :
    sane-find-scanner:
    2018-11-04 19:18 startup. found USB scanner (vendor=0x03f0 [Hewlett Packard], product=0x0701 [Hewlett Packard ScanJet 5300C/5370C ]) at libusb:004:005
    2018-11-04 19:18 device `avision:libusb:004:005′ is a Hewlett-Packard ScanJet 5300C flatbed scanner
    Last line is also returned with scanimage -L
    The error message when scanimage -T is an I/O error or when scan from SaneWinDS (copied from the SaneWinDS log without all the trace stuff) :
    2018-11-05 17:16:56.9051 ERROR [SANEWinDS.modGlobals.ImageDataWorker_DoWork] System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. —> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    After the I/O error scanimage -T reports “No SANE devices found”

    The scannner has been tested in another old setup and 2 different USB ports on the DS713+ has been tried.
    Is there anything else to try out?
    The scanner model is listed in the SANE supported devices as working, although it mentions the version sane-backends-1.0.27, and the current is sane-backends-1.0.26 -0002

    Thank you and Brgds
    Jens

    Reply
  23. John Grantman

    SANE Backends has worked great up to DSM 6.1x. I am unable to see the package available on DSM 6.2. Is this a hard compatibility issue or possibly something that will be updated for DSM 6.2?

    Reply
  24. David

    Hi, I have added you repo but some reason it doesn’t show in the list yet I can see that the cpu check should work.

    uname -m
    x86_64

    Reply
  25. Jean-Paul

    Thank’s ! (sorry I’m french, my english is …. perfectible).
    Works fine with DS211J Synology under DSM 6.2.1, a Canon MG3650 printer usb connected under Linux Mint/LMDE (Debian), using simple-scan (& Cups for printer with LPD).
    Nothing else to do except update /etc/sane.d/net.con file with ip@ of Syno.
    Output of scanimage -L :
    `net : ip@ : pixma : ….’ is a CANON Canon PIXMA MG3600 Series multi-function peripheral

    Reply
    1. patters Post author

      Sorry should be fixed now. I recently moved everything to AWS serverless hosting. I seem to have streamlined the native binary type names at some point in the past in my source files (without updating the hosted SANE binaries), but had forgotten to rename that file to match.

      Reply
  26. D

    I tried again but still unable to install it. says same thing not support on this disk station of DSM version.

    DS3617xs
    INTEL Xeon D-1527
    DSM 6.1.5-15254

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s