OS2World OLD-STATIC-BACKUP Forum

OS/2 - Technical => Hardware => Topic started by: Paul Smedley on 2012.02.09, 12:46:09

Title: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.09, 12:46:09
Hi,

In order to help hplip-os2 development, I need some test results from hp-mkuri from usb connected HP printers or MFPs.

Please download http://smedley.id.au/hp-mkuri.zip and execute:
hp-mkuri.exe -o

Send me the screen output (if any) and also libusb.log

My HP MFP gives no screen output, and libusb.log shows 'unable to send control message - rc= 280'

Thanks,

Paul
Title: Re: Test results needed from USB connected HP Printers
Post by: ivan on 2012.02.09, 18:31:36
Hi Paul,

Will this work with USB printers attached to a print server or must they be direct connected?

ivan
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.09, 21:49:09
Hi Paul,

Will this work with USB printers attached to a print server or must they be direct connected?

ivan

Hi Ivan,

I have hplip working over a network connection for both printing and scanning.

The purpose of the above testing is to determine if my printer detection issue when directly connected via USB is local or more widespread.

So to be more specific - no, I don't need results when tested over a connection using a print server.

It would be interesting though to see if hp-mkuri can detect the printer, using the following syntax:
hp-mkuri -i aaa.bbb.ccc.ddd

Where aaa.bbb.ccc.ddd is the IP address of the print server

Cheers,

Paul
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.10, 03:43:54
Unfortunately it seems there are some issues with usbresmg.sys

With most of my USB devices, usbres reports a string error and in the device report, under strings, shows things like:
GetString Error -225 for Manufacturer Name, Product Name and Serial number.

An older Canon Lide scanner works ok and displays the correct information.

Unless I can get the source to usbresmg, it seems unlikely I'll be able to get hplip to work with USB devices :(
Title: Re: Test results needed from USB connected HP Printers
Post by: wimpie on 2012.02.10, 10:49:37
Unfortunately it seems there are some issues with usbresmg.sys

With most of my USB devices, usbres reports a string error and in the device report, under strings, shows things like:
GetString Error -225 for Manufacturer Name, Product Name and Serial number.

An older Canon Lide scanner works ok and displays the correct information.

Unless I can get the source to usbresmg, it seems unlikely I'll be able to get hplip to work with USB devices :(
Hi Paul,

Is it possible that these strings (iManufacturer, iProduct, iSerialNumber) are not present in these devices? A lot of USB devices don't contain these strings. Or may be you used an improper language code?

It is most likely that you did not use the language code. I have done some testing obtaining these strings with my usbecd.sys device driver and some devices always return these strings even when the language code has not been specified in the setup packet. Others return an error to my device driver when the language code has not been specified. This language code must first have been obtained from the device and then subsequently be provided in the wIndex field of the setup packet when you query the device for the length of the string and when you obtain the string.

Can you see these with usbres.exe  "View device Report" (use right mouse button followed by left mouse button)? Or did you do just that? I get "Manufacturer Name : Not implemented" when that string is not there.

Wim.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.10, 22:27:20
Hi Wim,

Sorry if I wasn't clear.

The devices I'm testing definitely have the string present for at least some of the fields - lspci on linux confirms that.

At first I thought the problem was related to libusb/usbcalls however the device report from usbresmg.sys also shows the string error

You are probably right about the language code - perhaps usbresmg.sys needs to be modified to support this.

Cheers

Paul
Title: Re: Test results needed from USB connected HP Printers
Post by: rudi on 2012.02.11, 01:07:03
The devices I'm testing definitely have the string present for at least some of the fields - lspci on linux confirms that.
At first I thought the problem was related to libusb/usbcalls however the device report from usbresmg.sys also shows the string error

I've seen that before. I seem to remember, that it happened on some devices, that were already claimed/initialized by other drivers (USBKBD, USBMOUSE). Could it be that you have USBPRT loaded and that this driver feels responsible for your printer ? Or is the printer in reality a multifunction device that is partially handled by existing device drivers ?

Title: Re: Test results needed from USB connected HP Printers
Post by: Radek on 2012.02.11, 09:26:05
HP LJ1200 connected to USB here:

LIBUSB: unable to query number of USB devices - rc= 1b58

Well, Sony Vaio: Everything connected to USB that should work also works (printer, all three mouses, CD drive, USB sticks) but usbres complains "no USB driver found". usbcfg works, 6 UHCI, 2 EHCI, 1 mass storage, 1 printer. The printer is connected to LPT1 redirected to USB and it was on line while testing. Also, I made sure that it really works by printing some nonsense. RC6a.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.11, 10:07:15
HP LJ1200 connected to USB here:

LIBUSB: unable to query number of USB devices - rc= 1b58

Well, Sony Vaio: Everything connected to USB that should work also works (printer, all three mouses, CD drive, USB sticks) but usbres complains "no USB driver found". usbcfg works, 6 UHCI, 2 EHCI, 1 mass storage, 1 printer. The printer is connected to LPT1 redirected to USB and it was on line while testing. Also, I made sure that it really works by printing some nonsense. RC6a.

Is usbresmg.sys installed?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.11, 10:08:32
Hi Rudi,

The devices I'm testing definitely have the string present for at least some of the fields - lspci on linux confirms that.
At first I thought the problem was related to libusb/usbcalls however the device report from usbresmg.sys also shows the string error

I've seen that before. I seem to remember, that it happened on some devices, that were already claimed/initialized by other drivers (USBKBD, USBMOUSE). Could it be that you have USBPRT loaded and that this driver feels responsible for your printer ? Or is the printer in reality a multifunction device that is partially handled by existing device drivers ?

I liked your idea a lot - however even after removing the OS/2 drivers for msd, printers, mice and keyboards, the behaviour of usbres in terms of string failure are the same.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.11, 10:19:50
You are probably right about the language code - perhaps usbresmg.sys needs to be modified to support this.

An addition - usbres.exe shows the HP MFP has 0 # Languages, and LangIds is empty....

A device that works shows 1 as # Languages, and LangIds = 1033

So it looks like Wim is 100% correct...

Now to work out why and fix it :)
Title: Re: Test results needed from USB connected HP Printers
Post by: wimpie on 2012.02.11, 14:58:00
You are probably right about the language code - perhaps usbresmg.sys needs to be modified to support this.

An addition - usbres.exe shows the HP MFP has 0 # Languages, and LangIds is empty....

A device that works shows 1 as # Languages, and LangIds = 1033

So it looks like Wim is 100% correct...

Now to work out why and fix it :)

Hi Paul,

From USB 1.1 spec chapter 9.6.5:  String descriptors are optional. A device that does not support string descriptors within device, configuration and interface descriptors must have all references to string descriptors be set to zero. USB devices that omit all string descriptors shall not return an array of LANGID codes.

So to me it is valid what the HP MFP (whatever that is?) does. However it is not clear to me what you want to fix. I suppose it is in your own code (that you are porting) that you encountered this problem. I don't think that usbresmg.sys needs to be fixed. It must be done at application level. May be usbres.exe needs to fixed as well.

Wim.
Title: Re: Test results needed from USB connected HP Printers
Post by: Radek on 2012.02.11, 16:37:28
Oops, usbresmg wasn't installed. Now it is
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.11, 22:18:59
Hi Wim,

You are probably right about the language code - perhaps usbresmg.sys needs to be modified to support this.

An addition - usbres.exe shows the HP MFP has 0 # Languages, and LangIds is empty....

A device that works shows 1 as # Languages, and LangIds = 1033

So it looks like Wim is 100% correct...

Now to work out why and fix it :)

Hi Paul,

From USB 1.1 spec chapter 9.6.5:  String descriptors are optional. A device that does not support string descriptors within device, configuration and interface descriptors must have all references to string descriptors be set to zero. USB devices that omit all string descriptors shall not return an array of LANGID codes.

So to me it is valid what the HP MFP (whatever that is?) does. However it is not clear to me what you want to fix. I suppose it is in your own code (that you are porting) that you encountered this problem. I don't think that usbresmg.sys needs to be fixed. It must be done at application level. May be usbres.exe needs to fixed as well.

Yes I know the langid string is optional, but in this case, even in the absence (or inability to detect it) of the language string, the strings ARE present.

For the device, usbres shows:
Has Index 1|Getstring Error -225

linux can see the device strings

usbres shows 'Not Implemented' for devices with no strings present
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.11, 22:49:58
Oops, usbresmg wasn't installed. Now it is

I'm wondering if hp-mkuri needs some files from hplip in order to correctly detect the printer... there are no obvious errors in your log, but I'm presuming hp-mkuri showed no output?

what about trying:
hp-mkuri -b 1 -d 4

This tells it to look on usb bus 1, and at device 4 (your HP device appears to be device #4)

Also, please start syslogd before testing - I think this is part of at least eCS 2.0.

After running hp-mkuri, close syslogd and check %ETC%\syslog.msg for debug messages.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.12, 02:19:14
Interestingly, the HP USB code specifies a language of 0x409 (aka US English) when calling usb_control_msg.... and there's still an error from usbcalls's UsbCtrlMessage of rc=280
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.12, 10:28:58
Also interesting - I got some hp-mkuri logs from some other users, they fail slightly differently, in that they don't get the same return codes from libusb, but same net result, ie:
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 151: invalid get_string_descriptor size act=66 exp=0

[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 2050: invalid product id string ret=-27

Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.12, 10:57:44
Also interesting - I got some hp-mkuri logs from some other users, they fail slightly differently, in that they don't get the same return codes from libusb, but same net result, ie:
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 131: get_string_descriptor zero result, retrying...
[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 151: invalid get_string_descriptor size act=66 exp=0

[localhost] Feb 12 09:22:51 hp-mkuri.exe: io/hpmud/musb.c 2050: invalid product id string ret=-27

OK found a bug in our libusb port that explains this - usb_ctrl_message was always reporting 0 for success, it should return the amount of data transferred...
Title: Re: Test results needed from USB connected HP Printers
Post by: Radek on 2012.02.12, 17:00:12
No results on the screen, only the logfile. Both with -o and with -b 1 -d 4. The logfiles are the same in both cases. As far as syslogd is concerned, my eCS isn't on the network - I was unable to make my network card work (Marwell Semiconductors, genmac should know it but not on my Vaio most likely). I don't know how to use syslogd without a network.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.13, 09:16:33
No results on the screen, only the logfile. Both with -o and with -b 1 -d 4. The logfiles are the same in both cases. As far as syslogd is concerned, my eCS isn't on the network - I was unable to make my network card work (Marwell Semiconductors, genmac should know it but not on my Vaio most likely). I don't know how to use syslogd without a network.

syslogd will probably start OK provided localhost is available.... what does it say if you start syslogd from a command line?

Either way, it seems you'll need the full hplip package as once the device is detected, it seems it checks the details against some file that ship with hplip.

http://smedley.id.au/hplip-3.12.2-os2-20120212.zip

Once it detects the USB device it goes looking for some files in \hplip

Note if you have the klibc rewriter installed, you might need to move \etc\hp\hplip.conf into %ETC%\hp\hplip.conf
Title: Re: Test results needed from USB connected HP Printers
Post by: Radek on 2012.02.15, 19:13:13
I have tried the "full install" but the result was the same as with the "only hp-mkuri". The same logfile, no output on the screen. syslogd starts and creates a log file (empty file). While running hp-mkuri, no messages (the file is still empty after quitting syslogd). As far as the rewriter is concerned, "%ETC%" is "/etc" on my machine. I tried to copy hp\plip.conf (including the directory) into c:\etc (c: is the boot drive)  and d:\etc (hp-mkuri is on d: ). No changes.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.16, 09:30:08
I have tried the "full install" but the result was the same as with the "only hp-mkuri". The same logfile, no output on the screen. syslogd starts and creates a log file (empty file). While running hp-mkuri, no messages (the file is still empty after quitting syslogd). As far as the rewriter is concerned, "%ETC%" is "/etc" on my machine. I tried to copy hp\plip.conf (including the directory) into c:\etc (c: is the boot drive)  and d:\etc (hp-mkuri is on d: ). No changes.

Sounds like syslog isn't doing what's required...  Does 'ping localhost' work?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.02.18, 07:01:52
Oh and if anyone else wants to test the above package with a USB device, they'll need an update hp-mkuri.exe from http://smedley.id.au/hp-mkuri.zip
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.13, 10:10:12
Yay - Lars Erdmann sent me a fixed usbehcd.sys and string detection now works for me on my T60 with my HP devices.

This will help me get usb scanning working, as previously I had to use my 8 year old laptop which isn't the most reliable in terms of hardware :)
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.16, 21:15:42
I have a HP CP1025nw printer that is not yet attached to eCS.  If CUPS printing can use either USB or Wired Network connectivity to allow me to print to this printer, I'd be happy to try this one too.  Other forums do suggest that HPLIP v3.11.7 is needed to support this printer.

If you would like for me to test, what would it take?  Connect via USB and run the test program mentioned here?  Or would I need to install CUPS and HPLIP first?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.17, 02:05:17
Hi Mark,

I have a HP CP1025nw printer that is not yet attached to eCS.  If CUPS printing can use either USB or Wired Network connectivity to allow me to print to this printer, I'd be happy to try this one too.  Other forums do suggest that HPLIP v3.11.7 is needed to support this printer.

If you would like for me to test, what would it take?  Connect via USB and run the test program mentioned here?  Or would I need to install CUPS and HPLIP first?

Let me get together a CUPS package for HPLIP 3.12.2 for you to test - USB and network should both work....
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.17, 03:59:47
I'll keep an eye out for the new HPLIP release.  Thanks.
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.17, 09:26:09
I'll keep an eye out for the new HPLIP release.  Thanks.

try http://sourceforge.net/projects/ecsports/files/CUPS/hplip-3.12.2-os2-20120317.zip/download

Needs Ghostscript and CUPS as well to be useful....
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.17, 17:17:49
Your documentation suggests GhostScript (GS) 8.71. is required.  It would appear that different GS versions can be installed along with each other.  Can you confirm or deny that assumption?

I have gs8.71, gs9.00, gs9.02, & gs9.04 installed in the same named subfolders. (different folders each)

I will assume that unless you tell me differently that the GS prereq is already available on my system and that there is no need to install it in the CUPS directory.  And that the CUPS system will find and use the proper GS release.

Would CUPS work just as well with the later GS releases?  Or is that a matter of testing at this point?

I'm moving forward with the test based on my limited understanding, and will post my results here.

Thanks for working with me on this.
Title: Re: Test results needed from USB connected HP Printers
Post by: Pete on 2012.03.17, 21:35:28
Hi

If you already have several versions of gs installed then you do not need to install another build - the gs installations do need to be on the same drive as cups but not in the same directory as cups eg j:\cups, j:\gs

You have to specify which build of gs to use in the \cups\lib\cups\filter\pstoraster file.

To save you a little time and trouble: No gs build later than 8.71 works properly with cups.


Regards

Pete
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.17, 22:56:40
If you already have several versions of gs installed then you do not need to install another build - the gs installations do need to be on the same drive as cups but not in the same directory as cups eg j:\cups, j:\gs

You have to specify which build of gs to use in the \cups\lib\cups\filter\pstoraster file.

To save you a little time and trouble: No gs build later than 8.71 works properly with cups.

Actually, I'll bet a drive letter could be used in pstoraster - just ensure forward slashes are used...

But Pete is correct that 8.71 is the most reliable build of ghostscript for CUPS on OS/2
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.17, 23:51:44
I've gotten all installed I think.  I've been able to select my printer. And find all related things in CUPS for the CP1025nw.  Test page print fails.  In Linux I don't have to go setup desktop printers.  Will this test page print work without the next step?

However, when I go to create a desktop printer that I can use with my applications, the ecupshp-pdr from 2010 appears to be the latest available.  And it does not have the CP1025nw in it.

Anyone know where I can find a newer ecupshp-pdr file?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.18, 00:12:42
I've gotten all installed I think.  I've been able to select my printer. And find all related things in CUPS for the CP1025nw.  Test page print fails.  In Linux I don't have to go setup desktop printers.  Will this test page print work without the next step?

However, when I go to create a desktop printer that I can use with my applications, the ecupshp-pdr from 2010 appears to be the latest available.  And it does not have the CP1025nw in it.

Anyone know where I can find a newer ecupshp-pdr file?

There is no point proceeding until the test print works - what is the error?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.18, 00:24:52
Anyone know where I can find a newer ecupshp-pdr file?

Oh and on this, the best method is to use Alex Taylor's instpdr to add the installed ppd from /cups/etc/cups/ppd into the installed postscript driver.

The monolithic ecupshp is a PITA the maintain, and due to limitations in the IBM code, it's capped at around ~700 printers - hplip has more than that available....
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.18, 00:33:13
I've gotten all installed I think.  I've been able to select my printer. And find all related things in CUPS for the CP1025nw.  Test page print fails.  In Linux I don't have to go setup desktop printers.  Will this test page print work without the next step?

However, when I go to create a desktop printer that I can use with my applications, the ecupshp-pdr from 2010 appears to be the latest available.  And it does not have the CP1025nw in it.

Anyone know where I can find a newer ecupshp-pdr file?

There is no point proceeding until the test print works - what is the error?

Paused - "/cups/lib/cups/filter/hpcups.exe failed"
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.18, 00:37:31
There is no point proceeding until the test print works - what is the error?
Paused - "/cups/lib/cups/filter/hpcups.exe failed"

Try running hpcups from a command line - I'll guess it's missing gcc446.dll
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.18, 00:40:32
There is no point proceeding until the test print works - what is the error?
Paused - "/cups/lib/cups/filter/hpcups.exe failed"

Try running hpcups from a command line - I'll guess it's missing gcc446.dll
Actually, that can't be it:

chkdll32 \cups\lib\cups\filter\hpcups.exe
Loading DLL 'libc064' --> C:\ECS\DLL\LIBC064.DLL.
Loading DLL 'tcpip32' --> C:\MPTN\DLL\TCPIP32.DLL.
Loading DLL 'doscalls' --> loaded.
All DLL's used by '\cups\lib\cups\filter\hpcups.exe' could be loaded.

try:
- closing cupsd.exe
- edit \cups\etc\cups\cupsd.conf and change LogLevel from info to debug
- restart cupsd.exe
- try the test print
- close cupsd
- send me \cups\var\log\cups\error_log to paul at smedley dot id dot au
Title: Re: Test results needed from USB connected HP Printers
Post by: mwizard on 2012.03.18, 00:57:07
[C:\cups\lib\cups\filter]hpcups
prnt/hpcups/HPCupsFilter.cpp 68: ERROR: hpcups job-id user title copies options
[file]

I think this suggests that its running fine.

As for stopping cupsd, I'm not seeing how to do that.  It doesn't show in my task list.  And I'm not seeing any commads in the locahost/admin UI to shut it down.  Would you please give me a hint?

As for InstPDR, I have no idea where to find the PPD files.  I've searched and can't find any files *.ppd.  Any ideas where I should be looking for these?
Title: Re: Test results needed from USB connected HP Printers
Post by: Paul Smedley on 2012.03.18, 02:27:43
OK hpcups fails due to a missing plugin.

From http://hplipopensource.com/hplip-web/models/laserjet/hp_laserjet_cp1025nw.html

Driver plug-in   Required   See note8.

8 ("Required") A downloadable driver plug-in is required for printing support. ("Optional") A downloadable driver plug-in is optional for printing support and may increase the speed, quality, or other aspect of printed output. ("No" or "None") A driver plug-in is not required nor available. Driver plug-ins are released under a proprietary (non-open) license and are not part of the HPLIP tarball release. For more information, please refer to this KB article
Title: Re: Test results needed from USB connected HP Printers
Post by: ALT on 2012.03.18, 12:52:46
It doesn't really help Paul with his HPLIP testing, but according to the Linux Printing database, the CP1025nw works work the foo2zjs driver, so HPLIP may not be necessary for it:
http://www.openprinting.org/printer/HP/HP-LaserJet_Pro_CP1025nw (http://www.openprinting.org/printer/HP/HP-LaserJet_Pro_CP1025nw)