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

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #15 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
« Last Edit: April 20, 2019, 06:18:29 am by Pete »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2245
  • Karma: +170/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #16 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

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #17 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



Paul Smedley

  • Hero Member
  • *****
  • Posts: 2245
  • Karma: +170/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #18 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
« Last Edit: April 20, 2019, 10:57:56 pm by Paul Smedley »

ivan

  • Hero Member
  • *****
  • Posts: 1588
  • Karma: +19/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #19 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.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4986
  • Karma: +110/-1
    • View Profile
Re: Using a scanner with hplip?
« Reply #20 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.

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #21 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

ivan

  • Hero Member
  • *****
  • Posts: 1588
  • Karma: +19/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #22 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.

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #23 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
« Last Edit: April 23, 2019, 05:04:54 am by Pete »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2245
  • Karma: +170/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #24 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

ivan

  • Hero Member
  • *****
  • Posts: 1588
  • Karma: +19/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #25 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. 

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #26 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


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2245
  • Karma: +170/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #27 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

Pete

  • Hero Member
  • *****
  • Posts: 1333
  • Karma: +9/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #28 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

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2245
  • Karma: +170/-0
    • View Profile
Re: Using a scanner with hplip?
« Reply #29 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