Author Message

<  Device Information  ~  HP LaserJet Professional P1102

PostPosted: Sat Nov 06, 2010 11:45 pm
Posts: 4Joined: Sat Nov 06, 2010 11:10 pm
Hi,

I’ve recently bought a HP printer, and it looks like their newest models could get some help from usb_modeswitch.

Do you have any idea where I could start looking for the correct data stream to send? Unfortunately I don’t have a Windoze installation to sniff the data that needs to be passed. I’ve tried looking for such data in the Win32 binary they use to disable the “feature”, but with no success so far.

Does anyone has advice for this case? Do you know whether by chance someone would have started working on a similar model?


Offline Profile WWW
PostPosted: Sun Nov 07, 2010 12:28 pm
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
If the printer driver is using a custom switch command, it will be almost impossible to figure it out without a Windows installation.

But as a first step please post the output of "lsusb -v -d <your_usb_id>". You get the USB ID by calling "lsusb" without parameters and noting the line pointing to the printer. (If not sure, compare with printer unplugged.)



Offline Profile
PostPosted: Sun Nov 07, 2010 2:04 pm
Posts: 4Joined: Sat Nov 06, 2010 11:10 pm
Here you go:
Code:
Bus 001 Device 007: ID 03f0:002a Hewlett-Packard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x03f0 Hewlett-Packard
  idProduct          0x002a
  bcdDevice            1.00
  iManufacturer           1 Hewlett-Packard
  iProduct                2 HP LaserJet Professional P1102
  iSerial                 3 000000000Q80DVVRSI1c
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower               98mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              5 HP MS
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled

I’m going to borrow a Windows laptop to see how it switches the thing. Apparently there’s a tool that can disable the mass storage mode once and for all.

I’ll also pester HP so that they provide the relevant information. They claim this model has “full support” under Linux, which is an outright lie in this state.


Offline Profile WWW
PostPosted: Mon Nov 08, 2010 5:12 pm
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
You can try some wide-spread known methods with the printer.

I'd start with trying to "eject" the pseudo CD-ROM if it pops up on your desktop (usually with a right click).
If that works we can set up a usb_modeswitch configuration which does the same basically but is doing so fully automatic, without you noticing.

You have to decide of course if you want the permanent or the automatic switching. But mind that the printer might have to be connected to a Windows machine at some later occasion.




Offline Profile
PostPosted: Mon Nov 08, 2010 6:09 pm
Posts: 4Joined: Sat Nov 06, 2010 11:10 pm
Josh wrote:
I'd start with trying to "eject" the pseudo CD-ROM if it pops up on your desktop (usually with a right click).

That was my first reflex too.

Since I needed the printer badly, I ended up finding a Windows machine to unlock it, but I didn’t have the occasion to spy on what the utility does.

I’ve asked news from HP since they are supposed to provide open source drivers. Without reply from them I’ll try again and this time will sniff what happens on the bus.

Josh wrote:
You have to decide of course if you want the permanent or the automatic switching. But mind that the printer might have to be connected to a Windows machine at some later occasion.

It’s not a real problem. The printer works fine on Windows without the “feature”, you just need the driver CD.


Offline Profile WWW
PostPosted: Mon Nov 08, 2010 8:01 pm
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
So, ejecting did not achieve anything?

Anyway, it would be great to "master" this device for Linux; I'm looking forward to your sniffing ...


Offline Profile
PostPosted: Mon Nov 08, 2010 9:17 pm
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
On a side note:

Did you have a look at the HPLIP package? Your printer is explicitly listed in there. I assume they also do the mode switch with it.


Offline Profile
PostPosted: Tue Nov 09, 2010 10:36 am
Posts: 4Joined: Sat Nov 06, 2010 11:10 pm
Josh wrote:
Did you have a look at the HPLIP package? Your printer is explicitly listed in there. I assume they also do the mode switch with it.
HPLIP is the driver for that printer. It works great… once you have disabled the Smart Install stupidity.

HP indeed claims the printer is “fully supported” by HPLIP, but that’s an outright lie.


Offline Profile WWW
PostPosted: Thu Mar 10, 2011 6:47 pm
Posts: 6Joined: Thu Mar 10, 2011 5:12 pm
I had the same problem with my P1102. I did some USB sniffing and I've managed to disable the Smart Install 'feature' using the usb_modeswitch utility instead of the windows SIUtility.exe tool. After issuing the command you need to power cycle the printer, usb reset isn't enough.

usb_modeswitch -m 2 -r 2 -v 0x03f0 -p 0x002a -M 505554202F6465762F666561747572655374617475732E786D6C20485454502F312E310D0A434F4E54454E542D4C454E4754483A203232320D0A555345522D4147454E543A68702050726F78792F332E300D0A484F53543A6C6F63616C686F73743A333931300D0A0D0A3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D38223F3E0D0A3C6665617475726553746174757320786D6C6E733A7873693D22687474703A2F2F7777772E77332E6F72672F323030312F584D4C536368656D612D696E7374616E636522207873693A6E6F4E616D657370616365536368656D614C6F636174696F6E3D22666561747572655374617475732E787364223E0D0A20203C736D617274496E7374616C6C3E64697361626C65643C2F736D617274496E7374616C6C3E0D0A3C2F666561747572655374617475733E0D0A0D0A -n -2 474554202F6465762F666561747572655374617475732E786D6C20485454502F312E310D0A434F4E54454E542D4C454E4754483A20300D0A555345522D4147454E543A68702050726F78792F332E300D0A484F53543A6C6F63616C686F73743A333931300D0A0D0A -n -R

Reverse operation is possible as well:
usb_modeswitch -m 2 -r 2 -v 0x03f0 -p 0x002a -M 505554202F6465762F666561747572655374617475732E786D6C20485454502F312E310D0A434F4E54454E542D4C454E4754483A203232310D0A555345522D4147454E543A68702050726F78792F332E300D0A484F53543A6C6F63616C686F73743A333931300D0A0D0A3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D38223F3E0D0A3C6665617475726553746174757320786D6C6E733A7873693D22687474703A2F2F7777772E77332E6F72672F323030312F584D4C536368656D612D696E7374616E636522207873693A6E6F4E616D657370616365536368656D614C6F636174696F6E3D22666561747572655374617475732E787364223E0D0A20203C736D617274496E7374616C6C3E656E61626C65643C2F736D617274496E7374616C6C3E0D0A3C2F666561747572655374617475733E0D0A0D0A -n -2 474554202F6465762F666561747572655374617475732E786D6C20485454502F312E310D0A434F4E54454E542D4C454E4754483A20300D0A555345522D4147454E543A68702050726F78792F332E300D0A484F53543A6C6F63616C686F73743A333931300D0A0D0A -n -R

If you decode those byte sequences, you'll see HTTP requests with xml content going over USB.

I still haven't figured out how to make the fake CD go away automatically, as the windows driver does. It is not as easy as with the SIUtility.exe tool. The driver does not seem to use the same protocol as the utility.


Offline Profile
PostPosted: Sun Mar 20, 2011 9:25 am
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
Wow, that is an outstanding job!

Let me wrap it up and see if I get it right:
The switching method you found is "permanent", meaning it will survive a power cycle. The Windows tool "SIUtility.exe" does also make the setting permanent. The Windows driver will switch too, but this switch is not permanent.

Please correct me if I'm wrong.



Offline Profile
PostPosted: Sun Mar 20, 2011 3:22 pm
Posts: 6Joined: Thu Mar 10, 2011 5:12 pm
Yes, you've got it perfectly right.


Offline Profile
PostPosted: Sun Mar 20, 2011 7:01 pm
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
I assume you tried to spy out what the Windows driver is doing, right?


Offline Profile
PostPosted: Sun Mar 20, 2011 8:12 pm
Posts: 6Joined: Thu Mar 10, 2011 5:12 pm
In fact I've tried spying both the Windows driver and the utility (the driver doesn't have to be installed for the utility to work).

I was able to figure out what the utility was doing and reproduce it using usb_modeswitch.

But I could not figure out the specific usb command that the driver uses for switching the device. For me it looked like windows was doing it's routine checks for mass storage device readiness, then the storage device suddenly got disconnected and printer appeared in it's place.

If you are interested I can send you the traces. You're an expert in that field and probably you'll be able to figure out right away what was going on :-)


Offline Profile
PostPosted: Wed Mar 23, 2011 9:31 am
Site AdminPosts: 4830Joined: Sat Nov 03, 2007 12:30 am
Yes, I'd like to see at least the sniffing log of the storage (install) device.

If the printer shows up as a composite device before switching ( = more than one interface), the switching command from the driver may of course be issued via different interfaces than the one for the storage device. In that case it would help to have the logs of the other initial interfaces as well.

Can you make the logs available on some server?
If not, send them via mail - but please don't forget to zip/compress ...



Offline Profile
PostPosted: Wed Mar 23, 2011 5:40 pm
Posts: 6Joined: Thu Mar 10, 2011 5:12 pm
Here you are, please see README.txt inside the archive

http://dudinea.org/misc/hp-p1102-smartinstall.tgz


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 2
21 posts
Go to page 1, 2  Next
Users browsing this forum: Bing [Bot] and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum