Adding scanning (and ScanTo) support for HP LaserJet M2727nf MFP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
Fix Released
|
High
|
Unassigned |
Bug Description
My parents recently went out to the store and bought themselves a network-connected HP LaserJet M2727nf MFP multifunction device. They carted it home, all proud of themselves, and promptly called me over to set it up on their windows desktops. Naturally I set them up to print to it via Samba+CUPS instead of trying to install the printer drivers on each system, but when it came to scanning support I ran into a wee problem... there was none.
Being an enterprising Linux geek, I decided I'd reverse-engineer or improve the drivers to the point where it would work. After lots of trial and error and more than a few tears, I was able to get minimal "scanimage" functionality (although the page boundaries are occasionally a bit off) by editing the models.dat file for [hp_laserjet_
* changed "io-mfp-mode" from "1" to "6"
* changed "scan-type" from "-1" to "5"
* changed "status-type" from "6" to "9"
All three changes seem to be required for it to work. The top of the generated /usr/share/
After tinkering a bit and using wireshark from a linux box between my parents' Windows desktop and the M2727nf MFP, I determined that the hplip driver also doesn't seem to be willing to turn on the auto-contrast adjustment, and as a result the images are a bit bright and low-contrast.
Once I had minimal functionality working, I tried to get the "Scan To" button on the front of the system to work. With more wireshark-ing and some help from this URL:
http://
I was able to reverse-engineer the HTTP+XML-based ScanTo protocol for my printer. I ended up going quite a bit further than the guy at that URL in that I wrote a fully-featured Perl daemon to monitor and control the scanner. Said Perl daemon (hpscantod) is attached to this bugreport as a plain text file.
Unfortunately, while the "scanimage" command(s) in the script work just fine when the scanner is idle, they don't work at all when it's waiting for a computer connection in ScanTo mode. In that case I get an IO error during communication with the scanner:
[hpaio] scan/sane/soapht.c 1986: unable to start dime document:
hp:/net/
scanimage: sane_start: Error during device I/O
Comparing the traffic dumps from the windows client with what SANE is sending, I seem to be missing the value for the <ScanIdentifier/> field in the <wscn:CreateSca
Since I couldn't get my head around the soapht.c option-handling code, I did the next best thing and added a horribly ugly dirty hack by way of (getenv(
The "hpscantod" daemon I wrote still needs some proper support for a config file (currently all the configuration is directly in the script itself), but other than that it seems to coexist peaceably with windows clients doing SendTo on the same scanner.
I look forward to your replies and comments. If I am unresponsive for some reason, please send me an email at <email address hidden>; this is my first bug reported through this tracking system and I'm not entirely familiar with how it works yet.
Cheers,
Kyle Moffett
I found and fixed several miscellaneous bugs in the ScanTo daemon, attached is the updated version.
Cheers,
Kyle Moffett