ippsample icon indicating copy to clipboard operation
ippsample copied to clipboard

Create a "ipptool --ippserver" ippserver attribute text files pool for developing/debugging

Open tillkamppeter opened this issue 6 years ago • 7 comments

With the command

ipptool --ippserver attrs.txt ipp://... get-printer-attributes.test

an IPP attributes file from the printer with the given URI can be generated which allows emulating this printer with the `ippserver' utility. For developers of client software (print dialogs, PPD generatoes, ...) it would be great to have a pool of such files for as many printers as possible so that they can test the support for all functionality of IPP printers by simply emulating different models with different features. The pool could be made part of this ippsample software package. If manufacturers do not like to publish their printer's capability list files they could, if they prefer it, anonymise them by removing make/model info.

tillkamppeter avatar Jan 11 '18 18:01 tillkamppeter

That's an interesting idea. But even if we don't have "real" attribute files we can still put together a selection of synthesized printers that represent common classes of printers, like Apple does in its Printer Simulator developer application.

michaelrsweet avatar Jan 16 '18 14:01 michaelrsweet

Hey,

I just read out this attribute file my printer HP Color LaserJet M254nw.

./ipptool --ippserver attrs.txt ipp://NPI2EEE6B.local:631/ipp/print ../examples/get-printer-attributes.test

HP Color LaserJet M254nw.attr.txt

Note: I tried to dogfeed the HP.Color.LaserJet.M254nw.attr.txt into the ippserver but then I cannot print anymore to the printer and some of the printed files will be queued but then paused and therefore never arrive the data folder. Be aware that when you use it, it might be only for the dialog and showing options but not for using it to print any file to it. ./ippserver -a HP.Color.LaserJet.M254nw.attr.txt -k "test" &

JackGrinningCat avatar Aug 21 '18 18:08 JackGrinningCat

Hey, another one.

This is from a Samsung M283.

Samsung M283x Series.txt

Curious fact:

  1. When you call lpinfo -v this printer will not produce an ipp uri. Only socket and dnssd but not the ipp which is certainly supported. The last (HP) printer returned that flawlessly.

dnssd://Samsung%20M283x%20Series%20(SEC8425192A70C2)._printer._tcp.local/ socket://192.168.100.151

  1. The attribute file is shorter. Some of the info within the HP file is here missing. Like the collection media-size-supported .

JackGrinningCat avatar Sep 04 '18 15:09 JackGrinningCat

Glade has published binary Get-Printer-Attributes responses from various printers. For code quality tests I decode and encode again all 261 ipp messages and compare the bytes.

Another approach could be to provide a simple script that uploads printer and job attributes to a public ipp-printer-database.

gmuth avatar Feb 24 '21 11:02 gmuth

@gmuth There are some privacy issues we need to address for this (printer attributes often contain personally identifying information) and the linked files don't include the printer resource files (icons and strings files) that would also be needed to fully impersonate a particular printer. But thank you for the link, might be useful as a starting point at least...

michaelrsweet avatar Feb 25 '21 15:02 michaelrsweet

I like the direction this is moving but I agree with Mike that there are some privacy issues to be resolved. There also may be some "mechanical" issues to resolve as well, since a large repository of .conf files living in a "print" sub-directory to all be loaded b ippserver gets increasingly awkward as the number of .conf files grows.

wifiprintguy avatar Feb 26 '21 21:02 wifiprintguy

I've written a jvm-based tool inspectprinter.sh that runs a few ipp operations and saves the ipp responses. Anyone can fork the github repository ipp-samples, run the tool, commit and push new ipp files and create a pull request. If you like the approach I'd be happy to support a shared effort. If you see privacy issues we could use a private repository.

gmuth avatar Jul 25 '21 22:07 gmuth