Author Topic: Using a scanner with hplip?  (Read 28516 times)

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #30 on: April 25, 2019, 05:58:41 am »
Hi Paul

From your log output

"[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 351 scan_type=7 scansrc=1"

it seems this should work...

Obviously no problem reading the device attributes from models.dat in your setup as "scan_type=7 scansrc=1" are correct for the scanner.

Now to figure out what I have mis-configured...

Just in case I had left any traces of the rpm hplip files within the /hplip directory tree I deleted the tree and reinstalled files. No, that did not resolve the problem.

Not sure what to use in hplip.conf for the "bin= setting" which is currently set as m:/user/bin where the rpm installed *nixy programs live.

Another thought: Does hpaio.dll parse the models.dat file directly or does it call an external program?


Regards

Pete




Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #31 on: April 25, 2019, 07:57:46 am »
Hey Pete,

Obviously no problem reading the device attributes from models.dat in your setup as "scan_type=7 scansrc=1" are correct for the scanner.

Now to figure out what I have mis-configured...

Just in case I had left any traces of the rpm hplip files within the /hplip directory tree I deleted the tree and reinstalled files. No, that did not resolve the problem.

Not sure what to use in hplip.conf for the "bin= setting" which is currently set as m:/user/bin where the rpm installed *nixy programs live.

Another thought: Does hpaio.dll parse the models.dat file directly or does it call an external program?

I don't believe hpaio calls any external programs. My hpaio.conf is at http://smedley.id.au/tmp/hplip.conf

I'll be lurking in #netlabs on IRC in freenode on and off for the next few hours if you want to debug live...

Cheers,

Paul

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #32 on: April 25, 2019, 05:00:02 pm »
Hi Paul

The problem with the approximate 12 hour time difference is that I am - or should be - in bed while you are on freenode. Guess I'll have to stay up very late or get up very early to do some live debugging  ;-)

Checking your hplip.conf I do not see anything obviously wrong with mine.

Had a look at hpaio.dll using PMdll and checked ANPM for possible *nixy updates; installed latest pthread and libcx from netlabs-exp.  No change.

Comparing your log output to mine I see some differences that raise a question.

Your log snippet

[sanei_debug] Setting debug level of dll to 0.
[sanei_debug] Setting debug level of hpaio to 255.
[hpaio] sane_hpaio_init(): scan/sane/hpaio.c 317
[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 351 scan_type=7 scansrc=1


My log snippet

[sanei_debug] Setting debug level of hpaio to 255.
[hpaio] sane_hpaio_init(): scan/sane/hpaio.c 348
[dll] init: backend `hpaio' is version 1.0.0
[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 387 scan_type=0 scansrc=1556202374
scanimage: open of device hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 failed: Operation not supported


My log does not have this line:  [sanei_debug] Setting debug level of dll to 0.
What debug values have you set before scanning?
I have these settings

  set SANE_DEBUG_HPAIO=255
  set SANE_DEBUG_DLL=255
  set sane_config_dir=j:\programs\sane\etc\sane.d

The hpaio] sane_hpaio_init(): scan/sane/hpaio.c lines have different values at the end; yours is 317, mine is 348
Are those values reflecting the line number of the code involved?

Following that line my log has: [dll] init: backend `hpaio' is version 1.0.0
Not shown in your log snippet.

I do have to ask: Are we using the same hpaio.dll ?
Mine is:

Directory of J:\PROGRAMS\SANE\LIB\SANE

19-04-19  3:07p         <DIR>    551 a---  .
21-03-19  5:13p         <DIR>    630 a---  ..
14-01-19  9:53a     2,334,352    223 a---  hpaio.dll


Regards

Pete






Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #33 on: April 25, 2019, 11:56:31 pm »
Hi Pete,

I'm in Adelaide - which is GMT+8.5 - so not quite 12 hours :)

Can I suggest you keep things simple, and not bring Tame into the mix until things are known to be working?

For my testing, I had the /hplip directory from my post yesterday; and /sane from the Sane 1.0.27 package on my site.

I copied hpaio.dll to \sane\lib\sane ; added hpaio to  \sane\etc\sane.d\dll.conf and copied hpaio.conf to %ETC%

Then started scanimage with the command line provided.

I ran with:
set SANE_DEBUG_HPAIO=255
set SANE_DEBUG_DLL=0

I had DLL at 255 initially, but once I knew hpaio was being loaded, set it back to 0.

Yes, I believe the numbers in:
[hpaio] sane_hpaio_init(): scan/sane/hpaio.c 317

Are line numbers in the code. So one of us is running a different hpaio - it's just a matter of which one of us :)

PS - my setup appears to be working :P

Cheers,

Paul

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #34 on: April 26, 2019, 12:39:19 am »
Hi Paul

I notice that you do not mention where you got the hpaio.dll involved from - presumably an updated build as it appears to work.

Having spent a few hours trying to understand why hpaio.dll cannot get the data from models.dat here regardless of how I tweaked the hplip.conf file and noticing the different code line numbers in our logs I suspected that you could be using a different build of hpaio.dll - Yes, seems I currently have the naff one...  ;-)

Getting Tame working with the scanner is an adventure I can put off until hpaio is sorted and reasonably stable - although I seem to recall a useful discussion about adding scanners to Tame on these forums recently  :-)

 
Regards

Pete

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #35 on: April 26, 2019, 01:30:52 am »
Hey Pete,

I notice that you do not mention where you got the hpaio.dll involved from - presumably an updated build as it appears to work.

Having spent a few hours trying to understand why hpaio.dll cannot get the data from models.dat here regardless of how I tweaked the hplip.conf file and noticing the different code line numbers in our logs I suspected that you could be using a different build of hpaio.dll - Yes, seems I currently have the naff one...  ;-)

I'm at work right now, so can't confirm the hpaio.dll in use - I should be able to do this when I get home tonight, ie in 8 hours or so - assuming I get to this before I go out for dinner with some ex-Holden colleagues :)

Cheers,

Paul.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #36 on: April 26, 2019, 05:11:26 am »
Hi Paul

Thought I'd spend a few minutes testing the cups printer setup re: the hplip hpcups.drv.

I started by deleting existing cups and gutenprint directories and unzipping cups2.1.0, gutenprint5.2.12, cups-filters1.0.71 and the 2 hplip3.18.12 packages into place. Created the gs.exe link in \cups\bin, started cupsd.exe and pointed seamonkey to localhost:631 - had to reload the page to clear the cache and get the correct page to appear.

Ran through the Add Printer routine without problems; printer found on the network and identified correctly, offered the correct driver/ppd file, completed the setup and printed the Test Page.

Only took a few minutes, maybe 6, and that included copying zip files down the network and unzipping them into place.

So, looks like hpcups.drv works. I would expect the ppd file generated to work fine with psprint.drv after the necessary cleanppd, ppdenc and pin processes - it looks identical to the ppd file I "borrowed" from the rpm hplip 3.17.11 package except for version numbers - and that works fine with psprint.


Regards

Pete

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #37 on: April 26, 2019, 05:21:55 am »
Mea Culpa - I had an old hpaio.dll in place.  However, similar results to what I had previously:

[dll] sane_open: trying to open `hpaio:/net/envy_photo_6200_series?ip=192.168.1.252'
[dll] load: searching backend `hpaio' in `./lib/sane;/sane/lib/sane'
[dll] load: trying to load `./lib/sane/hpaio.dll'
[dll] load: dlopen()ing `./lib/sane/hpaio.dll'
[dll] init: initializing backend `hpaio'
[sanei_debug] Setting debug level of hpaio to 255.
[hpaio] sane_hpaio_init(): scan/sane/hpaio.c 348
[dll] init: backend `hpaio' is version 1.0.0
[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 387 scan_type=7 scansrc=1
MIB search path: C:\Home/.snmp/mibs;/net-snmp/share/snmp/mibs
Cannot find module (:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:HOST-RESOURCES-MIB:NOTIFICATION-LOG-MIB:DISMAN-EVENT-MIB:DISMAN-SCHEDULE-MIB:UCD-SNMP-MIB:UCD-DEMO-MIB:SNMP-TARGET-MIB:NET-SNMP-AGENT-MIB:HOST-RESOURCES-TYPES:SNMP-MPD-MIB:SNMP-USER-BASED-SM-MIB:SNMP-FRAMEWORK-MIB:SNMP-VIEW-BASED-ACM-MIB:SNMP-COMMUNITY-MIB:NET-SNMP-PASS-MIB:NET-SNMP-EXTEND-MIB:UCD-DLMOD-MIB:SNMP-NOTIFICATION-MIB:SNMPv2-TM:NET-SNMP-VACM-MIB): At line 0 in (none)
U:\sane\scanimage.exe: open of device hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 failed: Error during device I/O
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `hpaio's exit function
[hpaio] sane_hpaio_exit(): scan/sane/hpaio.c 363
[dll] sane_exit: finished

Cheers,

Paul
« Last Edit: April 26, 2019, 05:26:59 am by Paul Smedley »

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #38 on: April 26, 2019, 11:52:37 pm »
Hi Paul

So far no matter what I try I cannot get past the error shown in the syslogd hpaio output "no envy_photo_6200_series attributes found in /hplip/share/hplip/data/models/models.dat"

Of possible interest is that I deleted the file models.dat and still get the same message - not a "File not found!" message. That could indicate the problem is not reading the file but locating it. However:-

[J:\]dir models.dat /s

The volume label in drive J is Apps.
The Volume Serial Number is C642:65BE.

Directory of J:\hplip\share\hplip\data\models

 3-12-18  8:10a     1,203,541    328 a---  models.dat
        1 file(s)   1,203,541 bytes used


If I put hplip.conf in %ETC% - that is M:\MPTN\ETC - I prefix the drive letter "J:" - the drive hplip,cups,sane are installed to - to the paths in hplip.conf which will respond with "no envy_photo_6200_series attributes found in J:/hplip/share/hplip/data/models/models.dat"

If I copy the original hplip.conf to J:\cups\etc and use "set etc= \cups\etc" in a cmd file run from J:\programs\sane to start a scan I get the above message without the drive letter "J:".

Seems to me that hpaio cannot find the file despite it existing where hpaio expects it to be - hpaio adds the "/data/models/models.dat" string to the "home=/hplip/share/hplip" setting in hplip.conf...

The only way to test whether this is a drive letter issue is to move /etc/, /usr /var - the rpm-*nixy directories - on to drive J: adjust the config.sys and reboot.

Done! - with no change in the hpaio problem. So, does not seem to be a drive letter issue.

I can only guess that there is something missing - or, possibly a wrong version - on my system that hpaio requires to locate/read the models.dat file.


On the brighter side: No problem importing the hplip 3.18.12 ppd file into psprint.drv and creating an OS/2 printer. I did have a minor glitch where the first print output, from OpenOffice, failed with a filter error. I set the log to debug and had another go followed by a look through the log. I spotted a complaint about bc not being found, checked with ANPM, installed the bc package and retried printing. Works fine  :-)


Regards

Pete




Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #39 on: April 27, 2019, 12:15:25 am »
If I put hplip.conf in %ETC% - that is M:\MPTN\ETC - I prefix the drive letter "J:" - the drive hplip,cups,sane are installed to - to the paths in hplip.conf which will respond with "no envy_photo_6200_series attributes found in J:/hplip/share/hplip/data/models/models.dat"

Can I suggest you *don't* modify paths in hplip.conf ?

Provided sane and /hplip are on the same drive, drive letters won't be required. It's possible that hplip needs to be educated on drive letters, and that because you have a drive letter, it's considering that path to be a relative path, and pre-pending the current working directory, resulting in the path not being found.

Good news on the printing!

Cheers,

Paul

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #40 on: April 27, 2019, 05:24:47 am »
Hi Paul

Whether using a drive letter or not the models.dat file is not found/read. The only obvious difference when using a drive letter is that the drive letter occurs in the syslogd hpaio output.

Note: Your advice about not using a drive letter is heeded  :-)


Regards

Pete

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Using a scanner with hplip?
« Reply #41 on: April 27, 2019, 06:18:59 am »
Could it be a line ending issue? eg a nix program expecting nix line endings and getting screwed up by DOS line endings.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #42 on: April 27, 2019, 08:47:54 am »
Hi Dave

Paul has the same software installed and, judging by his log snippet, it has no problem reading the file so probably not line endings.

In fact I am not convinced that the file is found and think this is the underlying reason that the file is not read.
Reason: I deleted the file but still got the same error message - which includes the correct full /path/filename.

What we cannot work out is why the file is not found on 2 systems (now) here but is found and accessed successfully on Pauls system. I tend to suspect that somewhere in the *nixy support chain I have something that is not at the right version - or is missing completely.


Regards

Pete

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #43 on: April 27, 2019, 08:53:07 am »
Hey Pete,

Paul has the same software installed and, judging by his log snippet, it has no problem reading the file so probably not line endings.

In fact I am not convinced that the file is found and think this is the underlying reason that the file is not read.
Reason: I deleted the file but still got the same error message - which includes the correct full /path/filename.

What we cannot work out is why the file is not found on 2 systems (now) here but is found and accessed successfully on Pauls system. I tend to suspect that somewhere in the *nixy support chain I have something that is not at the right version - or is missing completely.

My best idea to move forwards is for you to install the logging version of libc066.dll - which should be in ftp://ftp.netlabs.org/pub/libc/GCC-3.3.5-csd6.zip as libc066.logchk

Copy libc066.logchk to the same directory as scanimage.exe and save it as libc066.dll

Start scanimage with libpathstrict=t or copy c:\programs\firefox!.exe to the same folder as scanimage.exe but calling it scanimage!l.exe to use run! to set libpathstrict=t for you

Send me the resulting libc*.log file - within it, it should show the full path that's being used to open models.dat

edit: I also think you're using models.dat from rpm still? Try unzipping http://smedley.id.au/tmp/models.zip

Cheers,

Paul
« Last Edit: April 27, 2019, 11:15:48 am by Paul Smedley »

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #44 on: April 28, 2019, 10:40:21 pm »
Hi Paul

Yes, that is the models.dat file in use - and it was not the models.dat file with the problem.

For libc logging I referred to this page and followed instructions there http://trac.netlabs.org/ports/wiki/PortingTips#Debuggingtechniques

I used this cmd file

  SET LIBC_LOGGING=+ALL
  set beginlibpath=j:\programs\sane\lib;
  set SANE_DEBUG_HPAIO=255
  set SANE_DEBUG_DLL=255
  set sane_config_dir=/programs/sane/etc/sane.d
  scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 1>ENVY_01.pnm 2>debugENVY02.log

and generated libc_0036.log

I then reset my system to use the non-debug libc066.dll and rebooted - there seemed to be a problem starting Seamonkey with the debug build installed.

I may have cracked this...

I opened the libc_0036.log with e.exe and tried searching for "models" with a "Not found" result which surprised me.
However, looking through the generated log I see:-

0004fc19 01 01 0004 Entr 0002 _vsopen: pszName=0x00e0e3f0:{/hplip/share/hplip
/data/models/models.dat} fOpen=0x0 fShare=0x40 ...
0004fc19 01 02 001a Entr 0002 __libc_Back_ioFileOpen: pszFile=0x00e0e3f0:{/hplip/share/hplip
/data/models/models.dat} fLibc=0x20000 fShare=0x40 cbInitial=0 Mode=00 ppFH=0x00e0ce24
0004fc1b 01 03 0017 Entr 0002 fsResolveUnix: pszUserPath=0x00e0e3f0:{/hplip/share/hplip
/data/models/models.dat} pszNativePath=0x00e0cca0 *pfInUnixTree=0x00e0cc28
0004fc1b 01 04 001a Entr 0002 __libc_PathRewrite: pszPath=/hplip/share/hplip
/data/models/models.dat pszBuf=0x00e0cca0 cchBuf=260
0004fc1b 01 04 001a Leav 0002 __libc_PathRewrite (0 ms): ret 0 (0x0)


Except I do not actually see what I have copied and pasted above. The 1st line above containing "vsopen: pszName=" should show the path/filename as a continuous string. Instead there is a line break that is invisible in an OS/2 editor and Seamonkey.

So the line in hplip.conf "home=/hplip/share/hplip" gets "/data/models/models.dat" appended, by hpaio.dll, to locate the data file. However, it seems that either hpaio.dll introduces a line break or it already exists resulting in the path for the data file becoming:-

/hplip/share/hplip?/data/models/models.dat - where ? is used to represent the musical note.

Guess I could look at this using kon.

Yes, the "musical note", hex value 0d, shows clearly, it exists at the end of all the hplip.conf lines.
Removed using kon and saved modified file.

Scanning retested.
No problems with "no envy_photo_6200_series attributes found in /hplip/share/hplip/data/models/models.dat", scan works - sort of...


So, Dave Yeo was right as it was a *nix line end problem - but for the wrong file  :-)


A bit of log showing a message that I have not seen before

[dll] init: backend `hpaio' is version 1.0.0
[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 387 scan_type=7 scansrc=1
MIB search path: I:\USERS\PETER\HOME/.snmp/mibs;/net-snmp/share/snmp/mibs
Cannot find module (:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:HOST-RESOURCES-MIB:NOTIFICATION-LOG-MIB:DISMAN-EVENT-MIB:DISMAN-SCHEDULE-MIB:UCD-SNMP-MIB:UCD-DEMO-MIB:SNMP-TARGET-MIB:NET-SNMP-AGENT-MIB:HOST-RESOURCES-TYPES:SNMP-MPD-MIB:SNMP-USER-BASED-SM-MIB:SNMP-FRAMEWORK-MIB:SNMP-VIEW-BASED-ACM-MIB:SNMP-COMMUNITY-MIB:NET-SNMP-PASS-MIB:NET-SNMP-EXTEND-MIB:UCD-DLMOD-MIB:SNMP-NOTIFICATION-MIB:SNMPv2-TM:NET-SNMP-VACM-MIB): At line 0 in (none)
[dll] sane_open: open successful


I seem to be missing something to do with MIBS... does not seem to prevent scanning though.


There is still a problem: While the scanner performed a scan the results are rather poor - and only black has been scanned, no colour.

Some fine tuning needed, somewhere...

Used the scanimage -A switch to get scan options for this scanner and as a result tried this command:-

scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 --mode Color --resolution 300 1>ENVY_options.pnm 2>ENVY_options.log

Much better result - and in colour.

Do you want the libc debug log and scanning log emailed? - probably no point as we seem to have this sorted.


Thanks Paul - from unsupported printer/scanner to all working within a couple of weeks  :-)


Pete
« Last Edit: April 29, 2019, 03:24:56 am by Pete »