Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tillkamppeter opened this issue Dec 26, 2019 · 23 comments

Comments

@tillkamppeter
Copy link
Member

@tillkamppeter tillkamppeter commented Dec 26, 2019

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

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Dec 26, 2019

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

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Dec 27, 2019

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.

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Dec 27, 2019

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Dec 27, 2019

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Dec 27, 2019

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

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Dec 27, 2019

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

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Dec 27, 2019

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

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Dec 27, 2019

Great, I am looking forward for your contribution.

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 15, 2020

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

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 15, 2020

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

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 17, 2020

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

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 17, 2020

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

  • Fax
  • Scan
  • TLS
  • mac
  • rfo

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?

@tillkamppeter tillkamppeter reopened this Feb 17, 2020
@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 17, 2020

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 17, 2020

Where do I find this "ippinfo" program?

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 18, 2020

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

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 18, 2020

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

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 18, 2020

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".

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 18, 2020

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

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 18, 2020

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.

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 18, 2020

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

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 18, 2020

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.

@Ordissimo

This comment has been minimized.

Copy link

@Ordissimo Ordissimo commented Feb 18, 2020

So this ticket is resolved?

@tillkamppeter

This comment has been minimized.

Copy link
Member Author

@tillkamppeter tillkamppeter commented Feb 18, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.