WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: USB scanner problem  (Read 6188 times)

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
USB scanner problem
« on: August 20, 2020, 12:56:04 AM »
I'm am trying to use a USB scanner with TC 11.1 x86. I'm checking here first before digging any deeper. Just maybe there is something I am missing or perhaps it actually is something else.

The scanner is fine. It has been tested with another linux system, using the same cable.

"sane-find-scanner" detects the scanner just fine. "scanimage -L" does not. It simply says there are no scanners found. This is just a simple scanner, not a printer/copier. "hplip" is not being used.

The scanner uses the "plustek" backend.

I tried scanimage -d plustek:libusb:004:002 > test.pnm, and got an I/O error. I didn't think that would work anyway, since "-L" finds nothing.

I did try making a plustek.conf file, but it didn't do anything. Permissions are fine and udev rules are good.

All dependencies installed fine.

Any Ideas?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14803
Re: USB scanner problem
« Reply #1 on: August 20, 2020, 01:09:29 AM »
I’ve had a similar problem with simple-scan, but in my case if I use the uri provided by hplip, simple-scan works.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #2 on: August 20, 2020, 05:58:08 AM »
Thanks for the reply, Juanito.

For me "hp-makeuri 004:002" returns "error: Device not found".
Could this just be since hplip doesn't have a plugin for my scanner?

The scanner is "Bus 004 Device 002: ID 04a9:220e Canon, Inc. CanoScan N1240/LiDE 30.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14803
Re: USB scanner problem
« Reply #3 on: August 20, 2020, 06:24:38 AM »
I think hp-makeuri will only work with hp hardware - what I meant was did you try using "plustek:libusb:004:002" or similar with simple-scan?

aus9

  • Guest
Re: USB scanner problem
« Reply #4 on: August 20, 2020, 08:52:20 AM »
Quote
The scanner is "Bus 004 Device 002: ID 04a9:220e Canon, Inc. CanoScan N1240/LiDE 30

me thinks you did not use the actual usb ids.04a9:220e

then you may need a config as per
https://www.systutorials.com/docs/linux/man/5-sane-plustek/#lbAD

2) if that fails you could try
https://www.hamrick.com/vuescan/canon.html

However my web browser takes me to a 64 bit download that unpacks to
Code: [Select]
ls
README.txt  vuescan  vuescan.rul  vuescan.svg
gordon@box:/tmp/VueScan$ file vuescan
vuescan: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d14c0ca979d023f22d3b5d58233643ce11b04527, stripped

« Last Edit: August 20, 2020, 08:56:20 AM by aus9 »

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #5 on: August 20, 2020, 02:21:35 PM »
Juanito, doing that with simple-scan results in "Unable to connect to scanner". With "-d" debug "simple-scan -d libusb:004:002" Unable to open device: Invalid argument. That got me thinking, since the error before was an I/O error. So I ran "simple-scan -d plustek:libusb:004:002" and "Error durning device I/O" returns. For some reason if I have anything in plustek.conf, I get "Invalid argument". This happens even if nothing is in there. The I/O error becomes normal if you delete the plustek.conf file. At a minimum you need these in plustek.conf

[usb]
device auto

I've tried many combinations. They all come back as Invalid arument.

[usb] 0x04A9 0x220E
device libusb:004:002 or device /dev/bus/usb/004/002

Thats where I'm at now. Adding plustek:libusb:004:002 seems to bypass plustek.conf. And something is wierd with plustek.conf.

aus9, thanks for your reply. I used the vendor and chipset IDs in the plustek.conf file; if thats what you mean.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #6 on: August 20, 2020, 09:04:25 PM »
Well, I went all the way back to TC ver 6. Same behaviour there. So I'm probably just out of luck. It doesn't look like a very missed feature. It is probably something simple. But who knows?

Just to make sure it wasn't that laptop, I tried TC with another (different make). Works fine with Devuan. If I figure anything out I'll post it here. There are plenty of dev files provided with TC, so that helps.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #7 on: August 21, 2020, 07:21:44 AM »
Building sane-backends-1.0.29 seemed to fix it. I built sane-backends-1.0.24 as a test. It produced the same error. With the 1.0.24 rebuild, sane-find-scanner found nothing. But the rebuild had no issues with plustek.conf (it provided its own). Both of the provided plustek.conf files included some preset options. But [usb] is left without vendor or chip ID (auto) and device is "device auto".

So there is a good chance this issue will clear up for me in a future TC release.

The version in the Devaun distro I tested against eariler is 1.0.25.

Makes it look like 1.0.24 is the problem.

Anyway, this is more or less solved.

Since I tested all the way back to TC 6.4.1, I wondered if something TC specific might still cause a problem; in the future. I checked and it also used version 1.0.24.
« Last Edit: August 21, 2020, 07:38:18 AM by nixmonkey »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14803
Re: USB scanner problem
« Reply #8 on: August 22, 2020, 08:16:34 AM »
sane-backends updated - I don't have a stand-alone scanner, so maybe you could test?

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #9 on: August 22, 2020, 06:19:54 PM »
Thanks,

So "scanimage -L" too quickly gives up and says it can't find anything.

Then "scanimage -d plustek" says Error during device I/O

Throw a symlink /usr/etc/sane.d > /usr/local/share/sane-backends/files and "scanimage -L" takes some time to look, but still can't find anything.

Then "scanimage -d plustek" says "Invalid argument".

On my build deleting the /usr/local/etc/sane.d and "scanimage -L" immediately finds nothing.

With the it still deleted, scanimage -d plustek > test.pnm" works as expected.

If I delete all libsane-plustek files from /usr/local/lib/sane then run "scanimage -d plustek" it returns "Invalid argument".

The difference seems to be that the linking to libs in /usr/local/lib/sane is lost in the extension.

I could have just said that right away, but I was writing this as I tested.

Also I noticed that the new extensions has no script in /usr/local/tce.installed/. The old one ran something to update udev rules. I'm not sure if that is needed anymore.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #10 on: August 22, 2020, 06:37:59 PM »
If I "export DESTDIR=" to some temp folder before "make install", I see a handful of libtool warnings.

I don't have enough experience to say if this is related at all.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #11 on: August 22, 2020, 11:03:06 PM »
I suppose it also says "Invalid argument" if I run "scanimage -d plustek" with no scanner plugged in.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #12 on: August 23, 2020, 01:37:01 AM »
There is probably a better way of doing this. But this is what I did to make an extension that works.
Since it was for testing, I didn't seperate out doc and dev.

After compiling I "make install" into a exported DESTDIR "sane-backends".

Then inside "sane-backends" "find . > ../sane-backends.tcz.list"
"make install" onto live system (no defined DESTDIR).
delete contents of the sane-backends directory
cp -p --parent $(cat list.txt) sane-backends
mksquashfs sane-backends sane-backends.tcz

Ofcourse you would split it up and maybe find some shortcuts to my hack job.
But you get the point.

I tested it and it works.


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14803
Re: USB scanner problem
« Reply #13 on: August 23, 2020, 02:21:56 AM »
Using the extension as-is works for me:
Code: [Select]
$ scanimage -L
device `hpaio:/net/hp_officejet_pro_9010_series?ip=192.168.1.170&queue=false' is a Hewlett-Packard hp_officejet_pro_9010_series all-in-one
..except that I cannot scan without an hp firmware plug-in

As long as you compiled with "-march=i486 -mtune=i686", we can use your extension - if you submit it, I can tidy it up.

Offline nixmonkey

  • Newbie
  • *
  • Posts: 14
Re: USB scanner problem
« Reply #14 on: August 23, 2020, 02:25:53 AM »
Sorry it sould have been:

"find . > ../list"

Then

"cat list | cut -c2- > sane-backends.tcz.list"