OpenPrinting / ippusbxd

Cross-platform IPP over USB driver
Other
29 stars 4 forks source link

ippusbxd should poll list of available service (print, scan, ...) from device instead of advertising hard-coded DNS-SD record #11

Closed tillkamppeter closed 4 years ago

tillkamppeter commented 4 years ago

ippusbxd does not only pass on the client conversation from the socket on localhost to the USB channels of the device but also advertises the device's presence via a DNS-SD registration. But there are only done DNS-SD service registrations for the devices web admin interface and for its IPP print service. It is not taken into account that the actual device can be a multi-function device (printing, scanning, ...) or can have additional, special services, like for example IPP System Service. What ippusbxd needs to do when connecting to the device, it neds to get the devices full list of services, or make the device somehow do the DNS-SD registration by itself and pass it through the USB<->IP interface.

tillkamppeter commented 4 years ago

Note that eSCL (Apple AirScan) scanning does not only work through the network but also through ippusbxd. See the this thread on the sane-devel mailing list about @Ordissimo's eSCL SANE backend and my suggestion to use it on USB via ippusbxd.

tillkamppeter commented 4 years ago

By the way, I succeeded to scan with SANE via ippusbxd! It worked with the newly merged "escl" backend from @Ordissimo. One only needs to enter the following data into /etc/sane.d/escl.conf:

[device]

model USB via ippusbxd
type http
ip 127.0.0.1
port 60000

So we need a solution for correct DNS-SD registration.

ThierryHFR commented 4 years ago

Le 2019-12-27 02:31, Till Kamppeter a écrit :

By the way, I succeeded to scan with SANE via ippusbxd! It worked with the newly merged [1] "escl" backend from @Ordissimo [2]. One only needs to enter the following data into /etc/sane.d/escl.conf:

[device]

model USB via ippusbxd type http ip 127.0.0.1 port 60000

So we need a solution for correct DNS-SD registration. Hi Till, Please open a ticket and provide me with the result of: avahi-browse -rav

Unfortunately, I don't have an HP AirPrint printer on hand. The discovery problem for eSCL is only present on this brand.

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [3], or unsubscribe [4].

Links:

[1] https://gitlab.com/sane-project/backends [2] https://github.com/Ordissimo [3] https://github.com/OpenPrinting/ippusbxd/issues/11?email_source=notifications&amp;email_token=ACRQEDFWUNQ2YPCKLKYX7YTQ2VLH7A5CNFSM4J7NGUN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHWLUOA#issuecomment-569162296 [4] https://github.com/notifications/unsubscribe-auth/ACRQEDFX272MPVSWASAGTW3Q2VLH7ANCNFSM4J7NGUNQ

ThierryHFR commented 4 years ago

Le 2019-12-27 02:31, Till Kamppeter a écrit :

By the way, I succeeded to scan with SANE via ippusbxd! It worked with the newly merged [1] "escl" backend from @Ordissimo [2]. One only needs to enter the following data into /etc/sane.d/escl.conf:

[device]

model USB via ippusbxd type http ip 127.0.0.1 port 60000

So we need a solution for correct DNS-SD registration. Hi Till Corrected : https://gitlab.com/sane-project/backends/merge_requests/285 Thierry

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [3], or unsubscribe [4].

Links:

[1] https://gitlab.com/sane-project/backends [2] https://github.com/Ordissimo [3] https://github.com/OpenPrinting/ippusbxd/issues/11?email_source=notifications&amp;email_token=ACRQEDFWUNQ2YPCKLKYX7YTQ2VLH7A5CNFSM4J7NGUN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHWLUOA#issuecomment-569162296 [4] https://github.com/notifications/unsubscribe-auth/ACRQEDFX272MPVSWASAGTW3Q2VLH7ANCNFSM4J7NGUNQ

tillkamppeter commented 4 years ago

@Ordissimo, thank you very much. I applied your 1-line patch and the DNS-SD discovery of my scanner works now.

tillkamppeter commented 4 years ago

Now we only need the original DNS-SD registration of the devices through ippusbxd.

ThierryHFR commented 4 years ago

I've got a lot to do, but I plan to work on it in February. The task seems simple enough.

tillkamppeter commented 4 years ago

Great, I am looking forward for your contribution.

ThierryHFR commented 4 years ago

I think the ticket may be closed. The printer and scanner records are correct. I tested the web interface with chromium and firefox successfully.

tillkamppeter commented 4 years ago

This is indeed fixed now. Thanks for all your work on this, @Ordissimo.

tillkamppeter commented 4 years ago

Below is the complete DNS-SD record of the printer part of my HP OfficeJet Pro 8730. I do not know whether one can extract all of these items from the get-printer-attributes IPP request, and there are items which depend on the interface, like the MAC address. Interesting is the "rfo=ipp/faxout/". This means that the printer has a URI "ipp://HOST:PORT/ipp/faxout" for sending faxes. You can do a get-printer-attributes IPP request on this URI and generate a PPD file (and there are also many non-PPD-typical fax-specific options), create a queue, and then print jobs with "-o phone=XXX" with XXX being a fax number and you send a fax. Works even with IPP-over-USB. I have tested this. There is no hint for this fax support in the get-printer-attributes IPP response for the printing part. Probably one should try a get-printer-attributes IPP request on the ipp/faxout URI and if this succeeds add "rfo=ipp/faxout" to the TXT record. Here is the IPP response for get-printer-attributes on the printer part: HP-OfficeJet-Pro-8730-ipp-attrs.txt

Service Type: _ipp._tcp
Service Name: HP OfficeJet Pro 8730 [08C229]
Domain Name: local
Interface: enx00051bb07395 IPv4
Address: HP18602408C229.local/10.0.0.3:631
TXT adminurl = http://HP18602408C229.local./#hId-pgAirPrint
TXT Duplex = T
TXT URF = CP1,MT1-2-8-9-10-11,PQ3-4-5,RS300-600,SRGB24,OB10,W8,DEVW8,DEVRGB24,ADOBERGB24,DM3,FN3,IS1-2,V1.4
TXT note = 
TXT Fax = T
TXT rp = ipp/print
TXT ty = HP OfficeJet Pro 8730
TXT priority = 20
TXT mopria-certified = 1.3
TXT txtvers = 1
TXT TLS = 1.2
TXT product = (HP OfficeJet Pro 8730)
TXT usb_MDL = OfficeJet Pro 8730
TXT qtotal = 1
TXT usb_MFG = HP
TXT mac = 18:60:24:08:c2:29
TXT kind = document,envelope,photo,postcard
TXT UUID = dbcc4b58-fc4c-f6fd-b4d6-2b00d554ad47
TXT Scan = T
TXT Color = T
TXT pdl = application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/postscript,application/pdf,image/jpeg,application/PCLm,image/urf,image/pwg-raster
TXT PaperMax = legal-A4
TXT rfo = ipp/faxout
tillkamppeter commented 4 years ago

Missing in TXT record of both ippusbxd and ipp-usb are:

Fax, Scan, and rfo can be derived by checking the scan and fax URIs (the scan URI you are checking already). mac does not make sense for localhost. The TXT record of ipp-usb has usb_CMD, which the network record misses. Not really a problem. Very important: Boolean entries are T, F, or U, never true or false, so please correct Color=true to Color=T. ipp-usb discovers that my printer does duplex and therefore says Duplex=T whereas your implementation in ippusbxd says Duplex=U. Could you fix these things?

ThierryHFR commented 4 years ago

Le 2020-02-17 21:49, Till Kamppeter a écrit :

Below is the complete DNS-SD record of the printer part of my HP OfficeJet Pro 8730. I do not know whether one can extract all of these items from the get-printer-attributes IPP request, and there are items which depend on the interface, like the MAC address. Hi Tii,

Here's a little program that will give you all the info you can get with ippInfo:

gcc -o ippinfo ippinfo.c -lcups

./ippinfo 192.168.0.26 631

Interesting is the "rfo=ipp/faxout/". This means that the printer has a URI "ipp://HOST:PORT/ipp/faxout" for sending faxes. You can do a get-printer-attributes IPP request on this URI and generate a PPD file (and there are also many non-PPD-typical fax-specific options), create a queue, and then print jobs with "-o phone=XXX" with XXX being a fax number and you send a fax. Works even with IPP-over-USB. I have tested this. There is no hint for this fax support in the get-printer-attributes IPP response for the printing part. Probably one should try a get-printer-attributes IPP request on the ipp/faxout URI and if this succeeds add "rfo=ipp/faxout" to the TXT record. Here is the IPP response for get-printer-attributes on the printer part: HP-OfficeJet-Pro-8730-ipp-attrs.txt [1]

Service Type: _ipp._tcp Service Name: HP OfficeJet Pro 8730 [08C229] Domain Name: local Interface: enx00051bb07395 IPv4 Address: HP18602408C229.local/10.0.0.3:631 TXT adminurl = http://HP18602408C229.local./#hId-pgAirPrint TXT Duplex = T TXT URF = CP1,MT1-2-8-9-10-11,PQ3-4-5,RS300-600,SRGB24,OB10,W8,DEVW8,DEVRGB24,ADOBERGB24,DM3,FN3,IS1-2,V1.4 TXT note = TXT Fax = T TXT rp = ipp/print TXT ty = HP OfficeJet Pro 8730 TXT priority = 20 TXT mopria-certified = 1.3 TXT txtvers = 1 TXT TLS = 1.2 TXT product = (HP OfficeJet Pro 8730) TXT usb_MDL = OfficeJet Pro 8730 TXT qtotal = 1 TXT usb_MFG = HP TXT mac = 18:60:24:08:c2:29 TXT kind = document,envelope,photo,postcard TXT UUID = dbcc4b58-fc4c-f6fd-b4d6-2b00d554ad47 TXT Scan = T TXT Color = T TXT pdl = application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/postscript,application/pdf,image/jpeg,application/PCLm,image/urf,image/pwg-raster TXT PaperMax = legal-A4 TXT rfo = ipp/faxout

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or unsubscribe [3].

Links:

[1] https://github.com/OpenPrinting/ippusbxd/files/4216125/HP-OfficeJet-Pro-8730-ipp-attrs.txt [2] https://github.com/OpenPrinting/ippusbxd/issues/11?email_source=notifications&amp;email_token=ACRQEDBEAGUIFFYV2U7GCVLRDLZ43A5CNFSM4J7NGUN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL7T4RQ#issuecomment-587152966 [3] https://github.com/notifications/unsubscribe-auth/ACRQEDFY4CFGHEIFI3L5DJTRDLZ43ANCNFSM4J7NGUNQ

tillkamppeter commented 4 years ago

Where do I find this "ippinfo" program?

ThierryHFR commented 4 years ago

I can pick up in "job-creation-attributes-supported "ipp-attribute-fidelity". I don't know how to get "job-mandatory-attributes". I'm looking. This concerns ipp/faxout

ThierryHFR commented 4 years ago

Hi @tillkamppeter it seems that this attribute is sufficient "ipp-attribute-fidelity", "job-mandatory-attributes" is only available when creating a job. you need the support of "application/pdf" or "application/openxps". What do you think?

tillkamppeter commented 4 years ago

I think these ones are really only if you are creating a job. What are you trying to achieve now? If you want to add the "Fax", "Scan", and "rfo" attributes, you need to check the URI /eSCL for "Scan" (what you are already doing) and if it is there and containing valid info, put a "Scan=T", otherwise a "Scan=F". For the others you check (with IPP) whether there is an /ipp/faxout URI. If so, you set "Fax=T" in the TXT record, and also add "rfo=/ipp/faxout", if the /ipp/faxout URI does not exist, you only set "Fax=F".

ThierryHFR commented 4 years ago

Thank you for that clarification. For TLS, all I get is "uri-security-supported=tls,tls,tls,tls,none."

tillkamppeter commented 4 years ago

Thanks for adding "Scan", "Fax", and "rfo". Probably it would be correct to set TLS when "uri-security-supported" contains "tls" at least once, but the value of "TLS" seems to be a version number which we cannot deduct from the IPP response and also to tell whether we can do a secure connection, we already get an extra "_ipps._tcp" record, and on USB I do not even know whether one can do secured connections there anyway (patches welcome) and whether it makes much sense, as USB is only accessible locally. So we probably can leave out TLS here.

ThierryHFR commented 4 years ago

Indeed the communication with the device is secure. Doesn't the use of Fax require TLS ?

tillkamppeter commented 4 years ago

AFAIK fax is something old-fashioned of the good old times of analogue phone. There are no modern encryption technologies as TLS, I think there is even no encryption at all available for fax communication. TLS is only used for the connection between the computer and the printer and this only on IP connections (usually network). I think classic USB (no IPP-over-USB) is also always unencrypted.

ThierryHFR commented 4 years ago

So this ticket is resolved?

tillkamppeter commented 4 years ago

I think so, so I will close it and do the 1.34 release. Thank you very much.