Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bridge for TWAIN scanner: Image Capture → SaneNetScanner → localhost/saned → Scanner #13

Open
m-urban opened this issue Mar 3, 2016 · 8 comments

Comments

@m-urban
Copy link

m-urban commented Mar 3, 2016

Hi there,

I am curious, if this project could solve my problem: I have got an older Canon CanoScan LiDE 35 scanner which I managed to get working under 10.11 El Capitan with the sane-backend. Now I am able to performs scans from the command line with scanimage and friends. This works fine but just isn't the greatest experience in the world since there is no GUI to configure a scan job.

Now I am wondering, if I could use SaneNetScanner to connect to the local saned daemon on my Mac, which handles the scan and reports it back to SaneNetScanner/Image Capture. Does anyone have experience with such a setup? Does SaneNetScanner still run under 10.11 at all?

Thanks a lot!

@kleinweby
Copy link
Owner

I'm sill running SaneNetScanner on a 10.11 installation without any problems.

To your actual question:

I'm not completely sure whether this would work. Without testing it I would guess, bonjour might be in your war. (As it advertises the scanner, but by default ignores scanners it advertises when showing them).

But no way of being sure, so give it a try :)

@m-urban
Copy link
Author

m-urban commented Mar 3, 2016

Sounds great, I'll give it a try. The installation routine hasn't changed, right? Compile Xcode project, and copy SaneNetScanner.app into /Library/Image Capture/Devices/. I don't need to make any adjustments to the code or some config file, right?

@kleinweby
Copy link
Owner

The installation stayed the same.

@m-urban
Copy link
Author

m-urban commented Mar 6, 2016

After toying around with your tool for a couple of hours, I am afraid I still didn't get it to scan properly. Here is what I tried:

  • I followed the installation instructions
  • I am able to announce my scanner on the network via Bonjour.
  • Adding the scanner in OS X' system settings works, too
  • Using Preview.app or Image Capture.app, I can initialize a scan job, which results in a gray box in the preview window that keeps saying "Waiting for Scanner …" ("Auf Scanner warten …") — and that's it. Nothing else happens anymore.

According to the NSLogger log, SaneNetScanner successfully opens the connection and queries the scanner's parameters. However, I have a feeling that it fails somewhere in there because it throws a fair amount of "Failed get <SaneOption: … Invalid argument" errors.

This happens both in the case that the scanner is directly connected to my Mac (the desired scenario) but also when it's connected to my Linux machine. A manual scanimage via the net backend from the command line does work in both cases.

Would you mind taking a look at my log file? Thank you very much!

@kleinweby
Copy link
Owner

Sad to hear that it does not work.

Please follow the following steps to produce more debug output:

  • Terminate SaneNetScanner via Activity Monitor (if running)
  • open a Terminal
  • run SANE_DEBUG_NET=128 <your/path/to/SaneNetScanner.app>/Contents/MacOS/SaneNetScanner
  • attempt to scan via Image Capture

You should see additional log output in the terminal now. (If not, it may end up in the system log accessible via the Console app)

@m-urban
Copy link
Author

m-urban commented Mar 15, 2016

I am happy to report that I finally got SaneNetScanner running under 10.11. Turns out that I needed to disable NSAssert in the build settings for the Release target. Otherwise, the code would get stuck in the non-implemented addToDeviceDictionary: of the CSSaneOptionConstraint -base class. Possibly related to my more recent version of Xcode (7.2).

Currently, this bridge via the saned server to a local device might in fact be the only solution to get TWAIN scanners to show up in recent versions of OS X, after Apple decided to remove Image Capture's TwainBridge.app device in 10.8 or so.

Two features I haven't quite gotten to work yet:

bildschirmfoto 2016-03-15 um 15 47 04

@m-urban m-urban changed the title Image Capture → SaneNetScanner → localhost/saned → Scanner Possible bridge for TWAIN scanner: Image Capture → SaneNetScanner → localhost/saned → Scanner Mar 15, 2016
@mklein-de
Copy link

The resolution list is empty because CSSaneOptionEnumConstraint::addToDeviceDictionary is not implemented. Resolution list looks good with mklein-de@6fab63f (Epson GT-7000, epson backend). Having the NSAssert in the base class is perfectly ok.

@runninghead
Copy link

Looks like this branch is getting a little advanced for mere mortals who just want to get their scanner fixed ;)
I too can report that it does not work, which is disappointing after downloading and installing several items. I believe m-urban has resolved the issue successfully but I'm not a coder the explanation lost me.
Can anyone point to a resolution walkthrough that gets us the rest of the way? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants