Tiny Core Linux

General TC => General TC Talk => Topic started by: nixmonkey on August 19, 2020, 09:56:04 PM

Title: USB scanner problem
Post by: nixmonkey on August 19, 2020, 09:56:04 PM
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?
Title: Re: USB scanner problem
Post by: Juanito on August 19, 2020, 10:09:29 PM
I’ve had a similar problem with simple-scan, but in my case if I use the uri provided by hplip, simple-scan works.
Title: Re: USB scanner problem
Post by: nixmonkey on August 20, 2020, 02: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.
Title: Re: USB scanner problem
Post by: Juanito on August 20, 2020, 03: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?
Title: Re: USB scanner problem
Post by: aus9 on August 20, 2020, 05: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

Title: Re: USB scanner problem
Post by: nixmonkey on August 20, 2020, 11:21:35 AM
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.
Title: Re: USB scanner problem
Post by: nixmonkey on August 20, 2020, 06: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.
Title: Re: USB scanner problem
Post by: nixmonkey on August 21, 2020, 04: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.
Title: Re: USB scanner problem
Post by: Juanito on August 22, 2020, 05:16:34 AM
sane-backends updated - I don't have a stand-alone scanner, so maybe you could test?
Title: Re: USB scanner problem
Post by: nixmonkey on August 22, 2020, 03: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.
Title: Re: USB scanner problem
Post by: nixmonkey on August 22, 2020, 03: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.
Title: Re: USB scanner problem
Post by: nixmonkey on August 22, 2020, 08:03:06 PM
I suppose it also says "Invalid argument" if I run "scanimage -d plustek" with no scanner plugged in.
Title: Re: USB scanner problem
Post by: nixmonkey on August 22, 2020, 10:37:01 PM
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.

Title: Re: USB scanner problem
Post by: Juanito on August 22, 2020, 11:21:56 PM
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.
Title: Re: USB scanner problem
Post by: nixmonkey on August 22, 2020, 11:25:53 PM
Sorry it sould have been:

"find . > ../list"

Then

"cat list | cut -c2- > sane-backends.tcz.list"
Title: Re: USB scanner problem
Post by: nixmonkey on August 23, 2020, 12:27:58 AM
[link removed]
Title: Re: USB scanner problem
Post by: Juanito on August 23, 2020, 12:34:22 AM
Thanks (that's not what I meant by "submit", but OK)

Can you confirm the version and that it was compiled with "-march=i486 -mtune=i686"?

btw, your copying removed all of the lib symlinks...

Edit: It hasn't been compiled against libxml2, libv4l2, net-snmp or libtiff?
Title: Re: USB scanner problem
Post by: nixmonkey on August 23, 2020, 08:30:03 AM
It was version 1.0.30

Compiled with CFPAGS -march=i486 -mtune=i686

The only dependency was libtool.

Which lib symlinks, the same ones I pointed out? It worked for me on a fresh load.
Title: Re: USB scanner problem
Post by: nixmonkey on August 23, 2020, 08:40:43 AM
Eh, I ment libusb not libtool (just woke up). But it actually needed libieee1284 too.

I've never submitted anything before, what did you mean?