OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Pete on April 19, 2019, 05:00:33 am

Title: Using a scanner with hplip?
Post by: Pete on April 19, 2019, 05:00:33 am
Hi All

Had my Canon MG7550 pack up and decided to replace rather than repair.

As HP seem to be well supported by cups with hplip I settled on a HP Envy 6234 "all in one".
I then discovered that I needed a later build of hplip than was available from the ecups wiki... However, Paul is looking into building an update at the moment.

I did discover that a suitable version of hplip is available as an rpm and having already installed cups from rpm on my laptop I soon had a cups test page printed followed by some output from OpenOffice.

Great! Printing working, now for the question: Anybody using a scanner with hplip? - I see the rpm hplip has the scanner support files and am looking for advice/instructions on how to get this working; ideally with Tame/2 but just from the command line would be a start.


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 19, 2019, 11:08:09 am
Hey Pete,

I found this in my tmp folder - http://smedley.id.au/tmp/hpaio-3.18.12-os2-20190114.zip

I can't remember what's involved to install this, and note that it's not tested. See https://www.os2world.com/forum/index.php?topic=118.0 for details on older builds

From memory, conf file needs to be copied to where all the other sane conf files are, and DLL can be anywhere, just needs to be loaded in dll.conf (with a path)

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: Doug Bissett on April 19, 2019, 04:36:37 pm
If your HP printer can use network attachment (TCP/IP, wired, or WiFi), you can scan using the built in web page (doesn't work with USB attachment). Simply use a browser to open the address that the printer got (I don't have the details at the moment, but it is described in the manual). This also works with Brother printers (at least the one that I have).
Title: Re: Using a scanner with hplip?
Post by: Pete2 on April 19, 2019, 07:09:21 pm
Hi Pete. I think you should be able to use hpaio.

I have a HP deskjet 2510 usb all-in-one. On  eCS 2.2b2 I've got the 'old' type standard CUPS installation in the root of the boot drive. I'm using hpaio 3.15.11 with hplip 3.15.11, both installed in the root of the boot drive. With this setup printing doesn't work, but following Paul's instructions I have scanning working. I've set SANE_DEFAULT_DEVICE to the value obtained by hp-mkuri, so if I type in (e.g.)

scanimage --resolution 300 >foo.jpg

it works as intended. I'm not sure how to make things work in Tame - IIRC you must add a key to scanner.dat, which can be done with an INI file editor - but I don't know what values to use, or how one is supposed to determine them.

On ArcaOS I installed CUPS via anpm into my usr tree, which isn't on the boot drive, and created a printer using Alex Taylor's printer manager. Printing worked fine (until the last upgrade, when it mysteriously stopped working.)  I'm using the same hpaio and have hplip in the root of the boot drive, but if I run hp-mkuri or scanimage - not a sausage. But YMMV.

I hope this helps a bit - and if anyone has any idea why scanimage &co won't start, any suggestions would be welcome.
Title: Re: Using a scanner with hplip?
Post by: ivan on April 19, 2019, 07:38:08 pm
Hi Pete,

Past experience with HP Envy series printers shows that they are almost all win printers with all that entails.

If you can get to a web based setup and it allows scanning to FTP on a local network you might be able to do something and all it requires is setting up Peter's FTP server on your computer, that is what I do with scanning on my Brother DCP-9020cdw laser printer.
Title: Re: Using a scanner with hplip?
Post by: Pete on April 19, 2019, 08:10:01 pm
Hi Doug

Scanning from the browser interface requires "web services" to be enabled which means automatic updates whether you want them of not. I think I would rather leave that disabled than suddenly find 1 day that printing does not work any more due to an irreversible update. However, if all else fails...


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: Pete on April 19, 2019, 08:22:47 pm
Hi ivan

Yes, definitely a "win printer" - most cheap inkjets are - but that is why we have cups, Thanks to Paul, Silvan, Alex and others involved in porting the software needed.

So, No problems with getting this printing using the current rpm installed cups/hplip/other bits involved.

In fact, had the printer working with ArcaOS long before I could get it installed in WindowsXP running in VirtualPC or Windows7 running in VirtualBox - the HP Installer/Setup craps out and fails to complete install/setup. Having tested with Windows7 32bit on real hardware where there is no problem I can only guess that running in a virtual machine screws up the HP Installer.

I found where the driver pack had been extracted to in WindowsXP and managed to get most of the driver side installed - can now print but trying to scan results in a "no scanner found" message. Not really needed but nice if I can eventually get it to work.

As for scanning via browser interface Please see response to Doug - Basically I dislike automatic updates.


Regards

Pete




Title: Re: Using a scanner with hplip?
Post by: Pete on April 19, 2019, 08:48:31 pm
Hi Pete2

Reading your post I am encouraged but currently stuck between a rock and a hard place  :-)

Explanation:

I have cups installed on my Desktop from zip files as per your eCS2.2b2 installation.

I have cups and hplip installed from rpm on my Laptop as per your ArcaOS installation.

The current hplip zip package is too old a version to support the printer so is not installed on my Desktop.

Pauls just built hpaio zip package will not work on my Desktop due to lack of hplip. I am currently trying to work out if I can add the files from the hpaio zip package to the "*nixy tree" used for rpm installed packages on my Laptop.

So, stuck between waiting for a later hplip zip package and a hpaio rpm package...

It seems hp-mkuri has been mentioned a few times much to my interest as there is no hp-mkuri file among the hplip or hpaio files...

There is a makeuri data file supplied with hplip the contents of which refer to makeuri.py - looks suspiciously like a replacement for hp-mkuri based on name similarity.

And the final problem: How would I run makeuri.py? - I suspect it is a python file?


Regards

Pete




Title: Re: Using a scanner with hplip?
Post by: Doug Bissett on April 19, 2019, 08:55:08 pm
Quote
Past experience with HP Envy series printers shows that they are almost all win printers with all that entails.

My brother has an HP Envy 4520. It works pretty much the same as my HP OfficeJet 3830. CUPS support seems to be excellent, and the printing is very good.

My previous printer was an HP <something> that worked almost the same. It had excellent CUPS support too. I never did get USB to work with it, because the printer was used, when I got it, and the USB connector was badly damaged.

In the newer machines, there is access to the internet, plus an open built in WiFi access point. You do have to either password that stuff, or better, just turn it off, which is easy enough from the built in web page.

The web page support (built into the printer) works very well for all of that (plus scanning), but that doesn't work if you use the USB interface.

FWIW, I also obtained a Brother <something>, which has a huge footprint. It also works with WiFi, and has a broken RJ45 connector, as well as USB. It works well over WiFi, with it's own web page support for things like setup and scanning. Not nearly as user friendly as the HP devices though. For a B/W laser printer, it does a good job, but you might need the BRLASER support package to use it with CUPS. I never bothered trying without that.

For HP printers, that are too new, you can probably get one of the older CUPS setups to work, although they may not support all of the features. HP seems to be pretty consistent in how their hardware works. I definitely can't say that for some other brands.
Title: Re: Using a scanner with hplip?
Post by: ivan on April 19, 2019, 10:20:02 pm
Hi Doug,

If your Brother printer has built in postscript (brScript) you should be able to add its ppd to the PSPRINT driver and print directly to it.  I have both my Brother colour laser printers (DCP-9020cdw and HL-3170cdw) setup that way - all functions on both printers work including double sided printing and scanning with the 9020.

Regarding HP win printers, I have friends that bought a couple of them and could never get them to work with win 7, the installer insisted that the OS needed updating to win 8 or 10.  They ended up selling them and getting Brother printers that just worked.
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 19, 2019, 11:43:44 pm
Hey Pete,

Pauls just built hpaio zip package will not work on my Desktop due to lack of hplip. I am currently trying to work out if I can add the files from the hpaio zip package to the "*nixy tree" used for rpm installed packages on my Laptop.

So, stuck between waiting for a later hplip zip package and a hpaio rpm package...

It seems hp-mkuri has been mentioned a few times much to my interest as there is no hp-mkuri file among the hplip or hpaio files...

There is a makeuri data file supplied with hplip the contents of which refer to makeuri.py - looks suspiciously like a replacement for hp-mkuri based on name similarity.

And the final problem: How would I run makeuri.py? - I suspect it is a python file?

As promised whilst I was away, http://smedley.id.au/tmp/hplip-3.18.12-os2-20190416.zip - this is missing (I think) some raw PPD files due to makefile issues with os2, but might be enough to get a test print running... For some reason, this doesn't include makeuri.py :(

makeuri.py is definitely python - looks like running "python makeuri.py aaa.bbb.ccc.ddd" will generate the uri you need for sane - where aaa.bbb.ccc.ddd = the IP of your printer

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: Dave Yeo on April 20, 2019, 01:49:53 am
Hi Doug

Scanning from the browser interface requires "web services" to be enabled which means automatic updates whether you want them of not. I think I would rather leave that disabled than suddenly find 1 day that printing does not work any more due to an irreversible update. However, if all else fails...

You should be able to isolate the printer from the internet, just allowing it on your local network depending on your router.
Title: Re: Using a scanner with hplip?
Post by: Pete on April 20, 2019, 02:31:45 am
Hi Dave

I suspect my (cheap) ISP supplied router may not have the capability to isolate the printer - a quick look suggests that is not possible but will look into it a little more.


Regards

Pete


Title: Re: Using a scanner with hplip?
Post by: Pete on April 20, 2019, 02:40:39 am
Hi Paul

hplip 3.18.12 feedback

Various files need for cups to work with hplip are missing from the zip file - there are no files for putting into the cups directory tree at all.

I tried using the (obviously missing) files supplied with hplip3.17.11 (rpm) but that results in no print output and the "filter failed" message being displayed.

Checking the log this line could indicate a/the problem:-

  D [20/Apr/2019:01:07:29 +0000] [Job 1] PID 297 (/cups/lib/cups/filter/hpcups.exe) stopped with status 102 (No such file or directory)

A few lines above that I see that the filter started successfully:-

  I [20/Apr/2019:01:07:29 +0000] [Job 1] Started filter /cups/lib/cups/filter/hpcups.exe (PID 297)

And a few lines after the "stopped" line I see:-

  D [20/Apr/2019:01:07:29 +0000] [Job 1] execv failed: No such file or directory

My guess is that hpcups.exe calls another program which is either missing - or in the wrong place.

As hpcups.exe is "lifted" from the rpm package so there is a possible version mismatch but, more likely, I have missed something needed when copying files from the hplip(rpm). Also this hpcups.exe probably expects to use the "*nixy tree" which could explain why it cannot find whatever it is looking for.


Regards

Pete


Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 20, 2019, 04:18:27 am
Hey Pete, there should be a hpcups.exe in that zip in /cups/lib/cups/filter

Run chkdll32 or pmdll to ensure you have the write dll's and/or try running it from a command line....
Title: Re: Using a scanner with hplip?
Post by: Pete on April 20, 2019, 06:11:31 am
Hi Paul

Sorry to report the zip contains only /hplip directories and files - no mention of /cups directories and files.

These are what seem to be missing - compared to the hplip 3.15.11 zip file:-

\cups\lib\cups\backend\hp.exe
cups\lib\cups\filter\hpcups.exe
\cups\lib\cups\filter\hpcupsfax.exe
\cups\lib\cups\filter\pstotiff

I did think the hpcups.drv file was missing as well but found that in
\hplip\share\cups\drv\hp\hpcups.drv
and copied it to
\cups\share\cups\drv\hp\hpcups.drv


Dropping hpcups.exe onto PMdll shows that the problem is really that you cannot mix'n'match cups and hplip files from rpm installs with with those from zip file installs . PMdll reveals that hpcups.exe cannot run because cups.dll and cupsim.dll are missing. This is correct: cups 2.1.0 installed from zip file does not include those files - uses cups20.dll instead of cups.dll and there are probably a few other differences.

At least we now have an idea of why printing failed with the "filter failed" message.

A question about hplip.conf: This file has to live in %ETC% which is on a different drive to cups/hplip. Being a *nix configuration file how happy is it about having drive letters involved?  eg home=J:/hplip/lib/sane


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 20, 2019, 10:15:26 am
Hey mate, can you try http://smedley.id.au/tmp/hplip-3.18.12-os2-20190420.zip - this should only have a /cups directory
Title: Re: Using a scanner with hplip?
Post by: Pete on April 20, 2019, 07:56:36 pm
Hi Paul

Bingo!

Yes, getting rid of the files borrowed from the rpm installation and unzipping the hplip cups files into placemakes a difference.

Successfully printed the cups test page - purloined the ppd file from the rpm installation on my laptop as the ppd files are not included in the zip.

To save a bit of faffing around I will also purloin the laptops psprint.drv + support files which already has the printer added to make for a quick OS/2 printer creation on my desktop system.


While you are feeling pleased with yourself  :-) I am going to bring the discussion back to scanning...

I tried the command "python makeuri.py aaa.bbb.ccc.ddd" with the correct ip address on the laptop with the rpm installed cups/hplip.

The result is a "Warning: python-dbus not installed" followed by "rror: Device not found" - Yes, it is not my typo.

I have no idea if python-dbus is a requirement that will make the command work - does not seem to be available as an rpm. Guess I'd better ask Silvan about the rpm hplip and scanning but at the moment I think I am stuck without the device uri

Out of interest I tried the command "scanimage -L" on my desktop system (cups/hplip installed from zip files) and had a strange result:-

[bjnp] udp_command: ERROR - no data received (timeout = 5000)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this scanner
[bjnp] udp_command: ERROR - no data received (timeout = 5000)
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: bjnp://192.168.1.252:8612/timeout=5000
device `test:0' is a Noname frontend-tester virtual device
device `test:1' is a Noname frontend-tester virtual device


Looks like scanimage is trying to find my now dead, definitely not connected Canon MG7550...
Could it be simply that scanimage detects a wireless connected device and tries to use the bjnp backend?


I also tried a guess at the possible uri:-

[J:\PROGRAMS\SANE]scanimage -d hpaio:/net/HP_ENVY_Photo_6200_series?ip=192.168.1.252
scanimage: open of device hpaio:/net/HP_ENVY_Photo_6200_series?ip=192.168.1.252 failed: Operation not supported

Probably the wrong uri although it is more than possible I have something in the wrong place...


Regards

Pete


Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 20, 2019, 10:53:15 pm
Hey Pete,

I don't believe python-dbus is a requirement, but I could be mistaken :) Try using hp-makeuri.exe from an older release to generate the URI

re: PPD files - my thoughts were that with hpcups.drv included, that would list all the available devices in the CUPS gui, which after selecting your printer, would install a localised PPD which could be used for psprint?

re: scanimage -L results, sounds like you still have pixma.conf in place with the IP of your old device, so scanimage is still looking for it?

I would enable sane logging to make sure hpaio is being loaded:
set SANE_DEBUG_DLL=255
scanimage -L

This should at least prove that hpaio is being loaded. From memory, hpaio logs to syslog, so if syslogd is running, you might get some logging there.

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: ivan on April 20, 2019, 11:31:32 pm
Hi Pete,

I think you need something like 'Net Scan' (an Android app I have on my Samsung tablet - I think it also works on an Android phone) to find the IP address of the printer, once you have that you should be able to talk to it.
Title: Re: Using a scanner with hplip?
Post by: Dave Yeo on April 21, 2019, 01:01:21 am
Hi Pete,

I think you need something like 'Net Scan' (an Android app I have on my Samsung tablet - I think it also works on an Android phone) to find the IP address of the printer, once you have that you should be able to talk to it.

I have "Who's on my WiFi" which does similar and even my crappy ISP supplied router thingy lists all the devices connected. I will note that the IP addresses vary a bit depending on order that things connect. A better router should support always assigning the same address to a device.
Title: Re: Using a scanner with hplip?
Post by: Pete on April 23, 2019, 12:12:44 am
Hi Paul

I'll investigate hpcups.drv in the near future and report back- I have to setup the printer on another OS/2 Desktop so will go the install route rather than simply copying required bits from working Desktop.


This hp-makeuri/hp-mkuri is not something easily found. The version supplied with the rpm hplip does not find the printer or scanner when run (see previous post) and does not work with the installed-from-zip hplip - probably a few support files missing.


Correct, I had not commented out the pixma.conf connection line. That solves that mystery  :-)


I started syslogd.exe and then ran this cmd file

  set SANE_DEBUG_HPAIO=255
  set SANE_DEBUG_DLL=255
  set sane_config_dir=j:\programs\sane\etc\sane.d
  rem scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 1>ENVY.pnm 2>debugENVY.log
  scanimage -L 2> debug-L.log

then stopped syslogd.

The syslogd output file contains:-

  [localhost] Apr 22 22:44:32 scanimage: io/hpmud/model.c 538: no envy_photo_6200_series attributes found in   J:/hplip/lib/sane /data/models/models.dat

  [localhost] Apr 22 22:44:32 scanimage: io/hpmud/model.c 549: no envy_photo_6200_series attributes found in J:/hplip/lib/sane/data/models/unreleased/unreleased.dat

  [localhost] Apr 22 22:44:32 scanimage: io/hpmud/model.c 538: no hp_envy_photo_6200_series attributes found in J:/hplip/lib/sane/data/models/models.dat

  [localhost] Apr 22 22:44:32 scanimage: io/hpmud/model.c 549: no hp_envy_photo_6200_series attributes found in J:/hplip/lib/sane/data/models/unreleased/unreleased.dat

The above J:/hplip/lib/sane/data/models/models.dat file does not exist, in fact, the directory structures below J:/hplip/lib/sane/ do not exist.

Found J:/hplip/share/hplip/data/models/models.dat and copied to J:/hplip/lib/sane/data/models/models.dat then retested with the same syslogd output.

Looking through models.dat there is no mention of my device.
Checking the rpm hplip on my laptop /hplip/lib/sane/data/models/models.dat does contain my device so copied that into J:/hplip/lib/sane/data/models/models.dat

I then retested but syslogd still gives the same output.

Could this be a "red herring"? The file exists in the location mentioned in the above syslogd output - J:/hplip/lib/sane/data/models - and contains a section "[envy_photo_6200_series]" which lists my exact model as "model4=HP ENVY Photo 6234 All-in-One".

I guess it is possible that whatever is used to parse models.dat either fails or is missing?


The debug-L.log mentions hpaio a few times:-

  [dll] add_backend: adding backend `hpaio'


  [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_get_devices(local=0): scan/sane/hpaio.c 369
  [hpaio] scantype=0 hp:/net/hp_envy_photo_6200_series?ip=192.168.1.252&queue=false
  [hpaio] unsupported scantype=0 hp:/net/hp_envy_photo_6200_series?ip=192.168.1.252&queue=false

  [dll] sane_exit: calling backend `hpaio's exit function
  [hpaio] sane_hpaio_exit(): scan/sane/hpaio.c 363

The lines that include "scantype=0" may be confirming the output of syslogd as the models.dat entry for this model is "scan-type=7".

So, looks like hpaio starts but cannot access/read the scanner settings from models.dat...


Do you want the complete debug-L.log emailed?


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: ivan on April 23, 2019, 02:03:31 am
Hi Pete,

Are you sure that the ip address of the printer is 192.168.1.252?  Since the standard way for the printer to get an IP address is from the router DHCP server pool and I haven't seen a router that uses the x.x.x.252 unless it is its own ip (default gateway).  If that is the case you are asking the router to do the scanning.
Title: Re: Using a scanner with hplip?
Post by: Pete on April 23, 2019, 04:17:59 am
Hi ivan

Very sure of the ip address as I assigned it  :-)

I use static ip addresses for "static" equipment - Desktop systems and printer/scanner - and allocate a range of ip addresses for DHCP to be used by laptops/tvs/pvrs/mobiles/visiting devices.

When printing from cups the device uri is socket://192.168.1.252:9100 but think a port number is not needed for the scanner device uri - I could be wrong which is why it would be handy to find a version of hp-mkuri/hp-makeruri that works with the installed hplip to check that.

Come to think of it "scanimage -L" returns what it finds, it is not given an ip address to look at. From previous log extract:-
  hp_envy_photo_6200_series?ip=192.168.1.252
so, no port number needed and confirms the ip address.


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 24, 2019, 07:34:58 am
So, looks like hpaio starts but cannot access/read the scanner settings from models.dat...


Do you want the complete debug-L.log emailed?

Not yet, I'll see if I can test locally first...

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: ivan on April 24, 2019, 05:52:37 pm
Hi Pete,

Your network setup makes sense when explained, I have the same here except that end of the range is reserved for ADSL modem, managed switches and other network hardware.

Since there was trouble with the forums yesterday I borrowed the manual for the printer from a friend that has one.  I think you may be limited to scanning using the webscan built in interface because anything else requires windows specific drivers to work.  I hope I'm wrong and the CUPS people have managed to get round that. 
Title: Re: Using a scanner with hplip?
Post by: Pete on April 24, 2019, 06:37:12 pm
Hi ivan

I count a network printer as network hardware in this instance  :-)

As for whether the scanner can be used from an OS/2 based system: That is what we are trying to achieve.

In theory it should be possible as this device works well in linux using the hplip printer/scanner support from HP for linux and hplip is open source - see https://developers.hp.com/hp-linux-imaging-and-printing - and ported to OS/2.

The printing side seems to work fine - must admit I have not tried photo output yet, hope that works - and Paul is trying to figure out what goes wrong with scanning; Could be a case of "Operator error - Replace Operator!" as I may have setting wrong somewhere, possibly in hplip.conf...

However, the syslogd output "no envy_photo_6200_series attributes found in   J:/hplip/lib/sane /data/models/models.dat" indicates a problem reading the settings for the scanner from the models.dat file - so it may not be my fault  :-)


Regards

Pete

Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 24, 2019, 11:31:36 pm
Hey Pete,

You need a models.dat from hplip 3.18.12 - try http://smedley.id.au/tmp/hpaio-3.18.12-os2-20190425.zip

With that, and:
scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 1>ENVY.PNM

I finish with:
[localhost] Apr 25 06:57:47 scanimage.exe: io/hpmud/jd.c 93: unable to read device-id

Which is not unexpected as I don't have a HP Envy on that IP :)

Hopefully this gets you further

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: Pete on April 25, 2019, 01:06:57 am
Hi Paul

Sorry to report no change. Looking at models.dat it does not seem to be restricted to working with a specific version.

Trying to scan with syslogd running adds identical entries to syslog.msg and this in the debug log:-

[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=1556145112
scanimage: open of device hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 failed: Operation not supported
[dll] sane_exit: exiting


The syslogd entries seem to suggest that the models.dat file is not being read/read correctly for some reason.

If I have this right the "scan_type=0" in the above log snippet means that the device does not have a scanner which seems to support the syslogd entries about no attributes found for the device.

 
Should there have been an updated hpaio.dll somewhere in the http://smedley.id.au/tmp/hpaio-3.18.12-os2-20190425.zip package?


Regards

Pete
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 25, 2019, 01:41:28 am
Hey Pete,

This is with:
 Directory of  U:\hplip\share\hplip\data\models\models.dat
 3/12/18  17:40       1,203,541    124   ___A_  models.dat

?

Here, when running 'scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 1>ENVY.pnm'

I only get the following in syslog.msg:
[localhost] Apr 25 09:08:51 scanimage.exe: io/hpmud/jd.c 93: unable to read device-id

Scanimage output is:
{1}[u:\sane] scanimage -d hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 1>ENVY.pnm
[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
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-U
SER-BASED-SM-MIB:SNMP-FRAMEWORK-MIB:SNMP-VIEW-BASED-ACM-MIB:SNMP-COMMUNITY-MIB:N
ET-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
[hpaio] sane_hpaio_exit(): scan/sane/hpaio.c 330

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: Pete 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



Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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
Title: Re: Using a scanner with hplip?
Post by: Pete 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





Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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
Title: Re: Using a scanner with hplip?
Post by: Pete 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
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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.
Title: Re: Using a scanner with hplip?
Post by: Pete 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
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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
Title: Re: Using a scanner with hplip?
Post by: Pete 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



Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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
Title: Re: Using a scanner with hplip?
Post by: Pete 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
Title: Re: Using a scanner with hplip?
Post by: Dave Yeo 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.
Title: Re: Using a scanner with hplip?
Post by: Pete 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
Title: Re: Using a scanner with hplip?
Post by: Paul Smedley 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
Title: Re: Using a scanner with hplip?
Post by: Pete 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
Title: Re: Using a scanner with hplip?
Post by: Dave Yeo on April 29, 2019, 12:11:13 am
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.

That's actually a form feed (FF) rather then line ending character. Always a good idea to look with a hex editor.
Title: Re: Using a scanner with hplip?
Post by: Pete on April 29, 2019, 03:37:24 am
Hi Dave

Yes, I stand corrected - although it is usually found towards the end of the line  :-)

Certainly worth remembering to look at data and .conf files ported from *nix using a hex editor if ported software is known to work but does not when unzipped/installed on a system. In this case it would have prevented a lot of "circular tail chasing"  ;-)


Regards

Pete



Title: Re: Using a scanner with hplip?
Post by: Paul Smedley on April 29, 2019, 11:33:56 am
Hey Pete,

No need to send any logs, just glad it helped diagnose the problem!

Cheers,

Paul
Title: Re: Using a scanner with hplip?
Post by: Jochen Schäfer on April 29, 2019, 01:52:24 pm
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.

That's actually a form feed (FF) rather then line ending character. Always a good idea to look with a hex editor.
Actually, 0X0D = 13 is Carriage Return. Form Feed is 0X0C = 12.
Title: Re: Using a scanner with hplip?
Post by: Dave Yeo on April 29, 2019, 04:24:17 pm
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.

That's actually a form feed (FF) rather then line ending character. Always a good idea to look with a hex editor.
Actually, 0X0D = 13 ist Carriage Return. Form Feed is 0X0C = 12.

I must of been tired :) You're correct.