Author Topic: Epson L4150 Scanner - USB  (Read 11039 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2528
  • Karma: +193/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #15 on: December 22, 2024, 09:04:57 pm »
OK, from debugoutput2.txt:
Code: [Select]
[epsonds] ** sane_epsonds_open: name = ''
[epsonds] probe_devices
[epsonds] attach_one_config: len = 3, line = usb
[epsonds]  probing usb devices
[epsonds] attach_one_config: len = 17, line = net autodiscovery
[epsonds] e2_network_discovery, sent discovery packet
[epsonds]  response from 192.168.10.200
[epsonds] attach_one_net: dev = 192.168.10.200
[epsonds] attach: devname = net:192.168.10.200, type = 2
[epsonds] device_detect, net:192.168.10.200, type: 2
[epsonds] open_scanner: net:192.168.10.200
[epsonds] awaiting welcome message
[epsonds] eds_recv: size = 3, buf = 0x12f503
[epsonds] epsonds_net_read: wanted = 3, available = 5
[epsonds] epsonds_net_read: long tail
[epsonds] eds_recv: expected = 3, got = 0, canceling: 0
[epsonds] e2_network_discovery, end
[epsonds] no devices detected
[epsonds] ** sane_epsonds_exit

I would be reading up on epsonds.conf and trying to add the device id to that to help it locate it. Other than that, no real ideas..

Sandra Asja Eickel

  • Newbie
  • *
  • Posts: 33
  • Karma: +2/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #16 on: December 22, 2024, 11:06:36 pm »
Hello Paul, Martin and others!

Even under Linux Mint the original scanner drivers for my Epson WorkForce WF-7840DTWF usually just don't work. But as this big A3 multi-function printer can send the scan to SMB shares on my QNAP NAS, it didn't bothered me.

Printing was also suboptimal at best, older drivers didn't support multiple copies (it ignored that setting), and printing an odd-paged job with duplex enabled, the driver adds a completely blank sheet (not just a blank backside) at the end. I have to check if there is a newer driver with less annoying bugs available.

The Epson Print Enabler for Android has similar issues.
As Epson is member of the Mobile Printing Alliance (Mopria), I tried their Apps, and they work better with my printer.
The printer companies want Apple users to be happy, so most modern printing/scanning devices are compatible to this standard.

Recently I discovered sane-airscan, and scanning now just works under Linux, implementing Apple's scan functionality of AirPrint and also M$ WSD:

https://github.com/alexpevzner/sane-airscan

If this could be ported to OS/2, this could be very helpful and perhaps even require less human resources in the end.

AirPrint/AirScan uses Apple's Bonjour (mDNS) protocol for auto discovery, so either this has to be implemented, too, or be hacked to read from a kind of HOSTS file instead.

A corresponding printer driver for cups would also enable many modern printers at once.

Greetings,
Sandra-Asja

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1434
  • Karma: +28/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #17 on: December 23, 2024, 01:58:46 am »
...following up on what Paul suggested.

So your logs shows TWO devices being found:

[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x04b8/0x1135) interface 0 at libusb:001:002
[sanei_usb] store_device: add dn 0 with libusb:001:002
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x147e/0x1002) interface 0 at libusb:000:003
[sanei_usb] store_device: add dn 1 with libusb:000:003

Why are there TWO devices? Are you expecting this?

1) go to \etc\sane.d directory and check for the presence of dll.conf

2) if found, edit dll.conf and remove the '#' (comment) from the following epson backend names:
...
#epson
#epson2
#epsonds
...

While here you can comment out any other backend names that you simply do not use. In my dll.conf I only have the hp showing active, everything else is commented out.

Re: network access, I would comment this out to start off with and just focus on getting your USB piece working first.

3) now get back to \etc\sane.d and find the following epson backend conf files:

Directory of G:\etc\sane.d

 9-07-20 10:23a           819    124 a---  epson.conf
 9-07-20 10:23a           400    124 a---  epson2.conf
 9-07-20 10:23a           287    124 a---  epsonds.conf

(that's just my install, so yours of course may vary)

You most likely need to edit these files by inserting the device specific info.

On my system I have the following in hp.conf:

Code: [Select]
#scsi HP
# Uncomment the following if you have "Error during device I/O" on SCSI
#   option dumb-read
#
# The usual place for a SCSI-scanner on Linux
#/dev/scanner
#
# USB-scanners supported by the hp-backend
# HP ScanJet 4100C
#usb 0x03f0 0x0101
# HP ScanJet 5200C
#usb 0x03f0 0x0401
# HP ScanJet 62X0C
#usb 0x03f0 0x0201
# HP ScanJet 63X0C
usb 0x03f0 0x0601
#
# Uncomment the following if your scanner is connected by USB,
# but you are not using libusb
# /dev/usb/scanner0
#   option connect-device

...see that "usb 0x03f0 0x0601" line? That's what your sane-find-scanner will return if I remember correctly, although that doesn't matter so much b/c your logs alredy show these for your device.

In fact, before we move further here is what a typical scan job on my side produces as far as the debug messages go:

Code: [Select]
[sanei_debug] Setting debug level of dll to 4.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.28
[dll] sane_init/read_dlld: attempting to open directory `g:\etc\sane.d/dll.d'
[dll] sane_init/read_dlld: using config directory `g:\etc\sane.d/dll.d'
[dll] add_backend: adding backend `hp'
[dll] sane_open: trying to open `hp:libusb:003:001'
[dll] load: searching backend `hp' in `/@unixroot/usr/lib/sane'
[dll] load: trying to load `/@unixroot/usr/lib/sane/hp1.dll'
[dll] load: dlopen()ing `/@unixroot/usr/lib/sane/hp1.dll'
[dll] init: initializing backend `hp'
[sanei_debug] Setting debug level of hp to 4.
[hp] sane_init called
[hp] hp_init: global.is_up = 1
[hp] sane_init will finish with Success
[dll] init: backend `hp' is version 1.0.8
[hp] sane_open called
[hp] hp_read_config: hp backend v1.06/$Revision$ starts reading config file
[hp] hp_read_config: processing line <#scsi HP>
[hp] hp_read_config: processing line <# Uncomment the following if you have "Error during device I/O" on SCSI>
[hp] hp_read_config: processing line <#   option dumb-read>
[hp] hp_read_config: processing line <#>
[hp] hp_read_config: processing line <# The usual place for a SCSI-scanner on Linux>
[hp] hp_read_config: processing line <#/dev/scanner>
[hp] hp_read_config: processing line <#>
[hp] hp_read_config: processing line <# USB-scanners supported by the hp-backend>
[hp] hp_read_config: processing line <# HP ScanJet 4100C>
[hp] hp_read_config: processing line <#usb 0x03f0 0x0101>
[hp] hp_read_config: processing line <# HP ScanJet 5200C>
[hp] hp_read_config: processing line <#usb 0x03f0 0x0401>
[hp] hp_read_config: processing line <# HP ScanJet 62X0C>
[hp] hp_read_config: processing line <#usb 0x03f0 0x0201>
[hp] hp_read_config: processing line <# HP ScanJet 63X0C>
[hp] hp_read_config: processing line <usb 0x03f0 0x0601>
[hp] hp_read_config: processing line <#>
[hp] hp_read_config: processing line <# Uncomment the following if your scanner is connected by USB,>
[hp] hp_read_config: processing line <# but you are not using libusb>
[hp] hp_read_config: processing line <# /dev/usb/scanner0>
[hp] hp_read_config: processing line <#   option connect-device>
[hp] hp_read_config: attach usb 0x03f0 0x0601
[hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0601"
[sanei_debug] Setting debug level of sanei_usb to 4.
[sanei_usb] sanei_usb_init: initializing libusb-1.0
[sanei_usb] sanei_usb_scan_devices: marking existing devices
[sanei_usb] libusb_scan_devices: Looking for libusb-1.0 devices
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x03f0/0x0601) interface 0 at libusb:003:001
[sanei_usb] store_device: add dn 0 with libusb:003:001
[sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0601
[hp] hp_get_dev: New device libusb:003:001, connect-usb, scsi-request=0
[hp] sanei_hp_device_new: libusb:003:001
[hp] hp_GetOpenDevice: device libusb:003:001 not open
[sanei_usb] sanei_usb_open: opened usb device `libusb:003:001' (*dn=0)
[hp] hp_AddOpenDevice: added device libusb:003:001 with fd=0
[hp] probe_scanner: Probing libusb:003:001
[hp] probing ScanJet Plus
[hp] probe_scanner: ScanJet Plus compatible (9195A)

What I recall being a key to getting all this working was setting the environment up, which are those two previous SET statments I shared:
Code: [Select]
REM Line below is specific to RPM install
SET SANE_CONFIG_DIR=g:\etc\sane.d
SET SANE_DEFAULT_DEVICE=hp:libusb:003:001

If you choose to use the SANE_DEFAULT_DEVICE pick one of the two you have an test them out one at a time. For your machine with the "epson" backend that would be:

epson:libusb:001:002

OR

epson:libusb:000:003

4) OK, so now onto your epson backend setups

4a - QUESTION - why do you think it is the epsonds that we need?

I will stick to epson.conf, here is what I would do, see the stuff in BOLD:

=== START ===
# epson.conf
#
# here are some examples for how to configure the EPSON backend
#
# SCSI scanner:
scsi EPSON
# for the GT-6500:
scsi "EPSON SC"
#
# Parallel port scanner:
#pio 0x278
#pio 0x378
#pio 0x3BC
#
# USB scanner:
# There are two different methods of configuring a USB scanner: libusb and the k
ernel module
# For any system with libusb support (which is pretty much any recent Linux dist
ribution) the
# following line is sufficient. This however assumes that the connected scanner
(or to be more
# accurate, it's device ID) is known to the backend.
usb
# For libusb support for unknown scanners use the following command
# usb <product ID> <device ID>
# e.g.:
# usb 0x4b8 0x110

usb 0x04b8 0x1135
usb 0x147e 0x1002

# And for the scanner module, use the following configuration:
#usb /dev/usbscanner0
#usb /dev/usb/scanner0
=== STOP ===

Once all that is done you should be able to simply issue a scan command w/o the "-d" parameter a the above setups would be already defaulting this for you.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5256
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Epson L4150 Scanner - USB
« Reply #18 on: December 23, 2024, 02:57:50 pm »
So your logs shows TWO devices being found:

[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x04b8/0x1135) interface 0 at libusb:001:002
[sanei_usb] store_device: add dn 0 with libusb:001:002
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x147e/0x1002) interface 0 at libusb:000:003
[sanei_usb] store_device: add dn 1 with libusb:000:003

Why are there TWO devices? Are you expecting this?

I guess no.

- 0x04b8/0x1135 is the Epson Printer / Scanner
- 0x147e/0x1002 is the " Upek Biometric Touchstrip / Touchstrip Fingerprint Sensor", the finger print USB scanner. I don't want to use that one.

I will check the rest and let you know.

Thanks. 
« Last Edit: December 23, 2024, 09:58:53 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1434
  • Karma: +28/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #19 on: December 23, 2024, 04:17:32 pm »
Martin!

So your logs shows TWO devices being found:

[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x04b8/0x1135) interface 0 at libusb:001:002
[sanei_usb] store_device: add dn 0 with libusb:001:002
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x147e/0x1002) interface 0 at libusb:000:003
[sanei_usb] store_device: add dn 1 with libusb:000:003

Why are there TWO devices? Are you expecting this?

I guess no.

- 0x04b8/0x1135 is the Epson Printer / Scanner
- 0x147e/0x1002 is the " Upek Biometric Touchstrip / Touchstrip Fingerprint Sensor", the finger print USB scanner. I don't want to use the one...

OK, nice, that actually makes it easier, you just work with that single device (by adding only that one to your epson.conf file), and to simplify you can literally issue this SET at CLI:

SET SANE_DEFAULT_DEVICE=epson:libusb:001:002

...and run scanimage right after.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5256
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Epson L4150 Scanner - USB
« Reply #20 on: December 25, 2024, 04:13:11 pm »
Here it goes one more try.

1) go to \etc\sane.d directory and check for the presence of dll.conf
Confirmed: in my case it is on x:\etc\sane.d
 
2) if found, edit dll.conf and remove the '#' (comment) from the following epson backend names:
...
#epson
#epson2
#epsonds
...
Confirmed: only #epson had #, I removed, the other two didn't have the #.

Re: network access, I would comment this out to start off with and just focus on getting your USB piece working first.
. I guess it is done by setting #net , it is done now.

3) now get back to \etc\sane.d and find the following epson backend conf files:

Directory of G:\etc\sane.d

 9-07-20 10:23a           819    124 a---  epson.conf
 9-07-20 10:23a           400    124 a---  epson2.conf
 9-07-20 10:23a           287    124 a---  epsonds.conf
On those three files I had added

#Epson L4150
usb 0x04b8 0x1135

Code: [Select]
REM Line below is specific to RPM install
SET SANE_CONFIG_DIR=g:\etc\sane.d
SET SANE_DEFAULT_DEVICE=hp:libusb:003:001

If you choose to use the SANE_DEFAULT_DEVICE pick one of the two you have an test them out one at a time. For your machine with the "epson" backend that would be:

epson:libusb:001:002
I run:

 SET SANE_CONFIG_DIR=s:\etc\sane.d
 SET SANE_DEFAULT_DEVICE=epson:libusb:001:002
 scanimage -v  1>output.pnm 2>debugoutput.txt

Got no scanner activity and:

 Output format is not set, using pnm as default
 scanimage: open of device epson:libusb:001:002 failed: Invalid argument

I think I may use epsonds since the Epson L4150 is on that list:
If I try 
 SET SANE_DEFAULT_DEVICE=epsonds:libusb:001:002
I got a different error:
Code: [Select]
Output format is not set, using pnm as a default.
scanimage: open of device epsonds:libusb:001:002 failed: Error during device I/O

Killed by SIGSEGV
pid=0x0059 ppid=0x0044 tid=0x0002 slot=0x008f pri=0x041f mc=0x0001 ps=0x0016
X:\USR\BIN\SCANIMAGE.EXE
LIBCN0 ffffffff:ffffffff
cs:eip=200434f8:20036560      ss:esp=ffffffff:ffffffff      ebp=ffff0053
 ds=0000      es=0000      fs=ffffffff      gs=0000     efl=ffffffff
eax=024efd74 ebx=1ffc9d7c ecx=024efd88 edx=024efdac edi=ffffffff esi=024effd4
Creating 0059_02.TRP
Moved 0059_02.TRP to X:\var\log\app\676bde1d-0059_02-SCANIMAGE-exceptq.txt

I tried another one will the SANE DEBUG stuff:

Quote
SET SANE_DEBUG_EPSONDS=255
SET SANE_DEBUG_SANEI_USB=255
SET SANE_DEBUG_DLL=255
SET SANE_CONFIG_DIR=x:\etc\sane.d
SET SANE_DEFAULT_DEVICE=epsonds:libusb:001:002
scanimage -v 1>output.pnm 2>debugoutput2.txt
Attached is debugoutput2.txt

Regards
« Last Edit: December 25, 2024, 04:33:03 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1434
  • Karma: +28/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #21 on: December 25, 2024, 10:39:37 pm »
Hi Martin!

...
2) if found, edit dll.conf and remove the '#' (comment) from the following epson backend names:
...
#epson
#epson2
#epsonds
...
Confirmed: only #epson had #, I removed, the other two didn't have the #.

Not sure if this has any bearing on your results - it should NOT - but your LOG shows all the other backends still enabled in the dll.conf, so I would say comment everything OUT but that single epsonds.

...I run:

 SET SANE_CONFIG_DIR=s:\etc\sane.d
 SET SANE_DEFAULT_DEVICE=epson:libusb:001:002
 scanimage -v  1>output.pnm 2>debugoutput.txt

Got no scanner activity and:

 Output format is not set, using pnm as default
 scanimage: open of device epson:libusb:001:002 failed: Invalid argument

I think I may use epsonds since the Epson L4150 is on that list:

OK, I didn't realize L4150 belonged on that list, in the case you are of coure quite correct to pick that!

If I try 
 SET SANE_DEFAULT_DEVICE=epsonds:libusb:001:002
I got a different error:
Code: [Select]
Output format is not set, using pnm as a default.
scanimage: open of device epsonds:libusb:001:002 failed: Error during device I/O
...

So what I see in that LOG is that the device you set is recognized as a SCANNER:

Code: [Select]
[sanei_usb] sanei_usb_init: initializing libusb-1.0
[sanei_usb] sanei_usb_scan_devices: marking existing devices
[sanei_usb] libusb_scan_devices: Looking for libusb-1.0 devices
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x04b8/0x1135) interface 0 at libusb:001:002
[sanei_usb] store_device: add dn 0 with libusb:001:002
...
[sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x147e/0x1002) interface 0 at libusb:000:003
[sanei_usb] store_device: add dn 1 with libusb:000:003
[sanei_usb] sanei_usb_scan_devices: device 00 is libusb:001:002
[sanei_usb] sanei_usb_scan_devices: device 01 is libusb:000:003
[sanei_usb] sanei_usb_scan_devices: found 2 devices
[dll] init: backend `epsonds' is version 1.0.0

...and the epsonds backend then shows:

Code: [Select]
[epsonds] ** sane_epsonds_open: name = 'libusb:001:002'
[epsonds] device_detect, libusb:001:002, type: 1
[epsonds] open_scanner: libusb:001:002

BUT...there is that "SANE_USB_WORKAROUND" remark in there, and that sande-usb MAN page claims to deal with scanners being plugged into a USB3 port:

SANE_USB_WORKAROUND
If your scanner does not work when plugged into a USB3 port, try
setting the environment variable SANE_USB_WORKAROUND to 1. This
may work around issues which happen with particular kernel ver-
sions. Example: export SANE_USB_WORKAROUND=1.

Soooo....for what its worth, add this 'SANE_USB_WORKAROUND=1' and re-run, assuming of course that you are in fact plugged into USB3...are you?

I have absolutely no idea what that whole USB3 thing looks like no our platform given that in the above remark they reference "...particular kernel versions...".

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5256
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Epson L4150 Scanner - USB
« Reply #22 on: December 25, 2024, 11:53:21 pm »
Hello

Thanks for the feedback.

I tried removing the rest from dll.conf and with the SET_SANE_WORKAROUND, but I didn't get any results yet.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1434
  • Karma: +28/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #23 on: December 26, 2024, 01:14:36 am »
Martin,
...I tried removing the rest from dll.conf and with the SET_SANE_WORKAROUND, but I didn't get any results yet...

Hmm...sorry to hear that, and this is about as far as I can take SANE troubleshooting (limit of my capabilities)...looks to me like the scanner end-point simply isn't responding to the epsonds backends' calls:

Code: [Select]
[epsonds]  opened correctly
[epsonds] eds_lock
[epsonds] eds_control: size = 2
[epsonds] eds_send: size = 2
[epsonds] eds_send: FS X
[sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
[sanei_usb] 000 1C 58                                           .X             
[sanei_usb] sanei_usb_write_bulk: wanted 2 bytes, wrote 2 bytes
[epsonds] eds_recv: size = 1, buf = 0x12f90f
[sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes
[sanei_usb] sanei_usb_read_bulk: read failed (still got 0 bytes): Operation timed out
[epsonds] eds_recv: expected = 1, got = 0, canceling: 0
[epsonds] eds_txrx: rx err, Error during device I/O
[epsonds] eds_control: failed, Error during device I/O
[epsonds]  failed
[epsonds] close_scanner: fd = 0

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5256
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Epson L4150 Scanner - USB
« Reply #24 on: December 26, 2024, 04:01:10 pm »
Thanks Dariusz, I apreciate the help and time invested.

This will help me to test other scanners in the future. Maybe, on this case, since the Epson L4150 is a multifunction Printer/Scanner with one USB HardwareID, maybe causes confusion on the software.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Pete

  • Hero Member
  • *****
  • Posts: 1405
  • Karma: +13/-0
    • View Profile
Re: Epson L4150 Scanner - USB
« Reply #25 on: December 27, 2024, 07:53:04 am »
Hi Martin

If "SET_SANE_WORKAROUND" is not a typo it is incorrect and should be
   SET SANE_USB_WORKAROUND=1


Regards

Pete

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5256
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Epson L4150 Scanner - USB
« Reply #26 on: December 27, 2024, 10:06:18 pm »
If "SET_SANE_WORKAROUND" is not a typo it is incorrect and should be
   SET SANE_USB_WORKAROUND=1
Thanks Pete. It is a typo on the forum post, but on scan2.cmd I have it fine.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.