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

Unable to add the ipp network printer to cup server #514

Closed
Krishnanudhaya opened this issue Oct 28, 2022 · 6 comments
Closed

Unable to add the ipp network printer to cup server #514

Krishnanudhaya opened this issue Oct 28, 2022 · 6 comments
Assignees
Labels
question General usage question

Comments

@Krishnanudhaya
Copy link

Krishnanudhaya commented Oct 28, 2022

Hi Team,

I would like to add the network printer to cups server using http call ( printer_host_name, port).

I couldn't find the way to add the printer to cupserver from cups api documentation.

Please share the cup api which allows to add ipp network printer into cups and share the different approaches to connect the printer.

Currently, I have connecting the cup server with cups4j library through java.

Thanks

@michaelrsweet michaelrsweet self-assigned this Oct 30, 2022
@michaelrsweet michaelrsweet added the question General usage question label Oct 30, 2022
@michaelrsweet
Copy link
Member

See the CUPS Implementation of IPP, specifically the information about the CUPS-Add-Modify-Printer operation. The "ppd-name" attribute will have a value of 'everywhere' for an IPP Everywhere printer, otherwise you need to specify a driver/model name (lpinfo -m) corresponding to the printer.

For a C code example, look at the "lpadmin.c" file in the CUPS source code.

@Krishnanudhaya
Copy link
Author

Thank you for the response.

@gmuth
Copy link

gmuth commented Nov 8, 2022

@michaelrsweet, I tried to add an ipp printer to CUPS on macOS as you described - especially with "ppd-name=everywhere". However it does not work on macOS 12.6 with CUPS 2.3.4:

    CUPS-Add-Modify-Printer:
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri (uri) = ipps://localhost:631/printers/x3
        device-uri (uri) = ipp://192.168.2.145
        printer-info (textWithoutLanguage) = x3_Info
        printer-location (textWithoutLanguage) = x3_Location
        ppd-name (nameWithoutLanguage) = everywhere

        RECEIVED: 115 bytes in response
        status-code = server-error-internal-error (Unable to copy PPD file.)
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        status-message (textWithoutLanguage) = Unable to copy PPD file.

because there is no such file:

/var/log/cups/error_log:
[cups-driverd] Unable to open \"/usr/share/cups/model/everywhere\" - No such file or directory
copy_model: empty PPD file
[Client 319] Returning IPP server-error-internal-error for CUPS-Add-Modify-Printer (ipps://localhost:631/printers/x3) from localhost.

My ipptool test case is documented here: https://github.com/gmuth/ipp-client-kotlin/tree/master/issues/%2310

@michaelrsweet
Copy link
Member

@gmuth macOS uses an old version of CUPS that doesn't support the "everywhere" virtual PPD; instead, the "lpadmin" command and "admin.cgi" programs did the PPD generation and provided the PPD file as an attachment.

@gmuth
Copy link

gmuth commented Nov 8, 2022

Ok, on macOS I should be able to generate the PPD with ipp2ppd:
Usage: ipp2ppd <printer_uri> <input_ppd_path>
What is the correct input_ppd_path for macOS?

@michaelrsweet
Copy link
Member

@gmuth It can be anything, including /dev/null - IIRC it is used to update a print queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General usage question
Projects
None yet
Development

No branches or pull requests

3 participants