[SUPPORT] cups DOCKER REPOSITORY


Recommended Posts

  • José Coelho changed the title to [SUPPORT] cups DOCKER REPOSITORY

Hi,

 

I have been looking for this very thing for ages!

 

I've got a similar query to Twinkie... I'm connecting to a network printer and want to serve this printer to devices in the house via wifi etc... the reason being the printer isn't Apple Air Print compatible and CUPS is a nice way of bridging that gap.  I've actually created a pi build that does this with CUPS and works but I wanted to use a container on my "always on" Unraid box...

 

I've got the printer installed, I've collected a PPD file for it from the manufacturer CUPS sees the printer.  I've also managed to sent print jobs to it from network machines so I know CUPS is receiving the print jobs and processing them.  However it appears the printer isn't doing anything.  The jobs just sit in the job list and never complete, is there anything I could try?

Link to comment
13 minutes ago, craig_read said:

Hi,

 

I have been looking for this very thing for ages!

 

I've got a similar query to Twinkie... I'm connecting to a network printer and want to serve this printer to devices in the house via wifi etc... the reason being the printer isn't Apple Air Print compatible and CUPS is a nice way of bridging that gap.  I've actually created a pi build that does this with CUPS and works but I wanted to use a container on my "always on" Unraid box...

 

I've got the printer installed, I've collected a PPD file for it from the manufacturer CUPS sees the printer.  I've also managed to sent print jobs to it from network machines so I know CUPS is receiving the print jobs and processing them.  However it appears the printer isn't doing anything.  The jobs just sit in the job list and never complete, is there anything I could try?

 

Hi,

 

It's ok I have sorted it now thanks, for some reason it needed to use a different driver and after some config changes it appears to be working :)

 

Please ignore!

Link to comment
3 hours ago, craig_read said:

the reason being the printer isn't Apple Air Print compatible and CUPS is a nice way of bridging that gap.  I've actually created a pi build that does this with CUPS and works but I wanted to use a container on my "always on" Unraid box...

 

Agreed, I'm currently using a custom docker container to bridge airprint to an old network printer.  This app would be a great replacement if it supported airprint.  Can this be added in the future?  Thanks!

Link to comment

I try cups for my wifi printer, but it doesn´t work. I have a 32bit driver and i tried to install it. Can´t localized Printer or connected but nothing happens. I love the idea to have airprint for my Dell C1660W Printer. Its just a dream or my knowledge is not enough for solving the problem, but i learn a lot..... 🙂

 

Link to comment
20 hours ago, dereitz said:

 

Agreed, I'm currently using a custom docker container to bridge airprint to an old network printer.  This app would be a great replacement if it supported airprint.  Can this be added in the future?  Thanks!

I'm able to print documents now from iphone, ipad with this container.  The only thing I'm trying to sort out now is a weird setting where the print is paused till I get to the printer nad press "Go" on the printer itself.  It then prints without problem.  On the pi version I made of this, I don't have to do this, is there some setting somewhere I can flip to prevent this that anyone knows about?  Not really a CUPS problem but wondered if someone knew.

 

Thanks

Link to comment
23 minutes ago, craig_read said:

I'm able to print documents now from iphone, ipad with this container.  The only thing I'm trying to sort out now is a weird setting where the print is paused till I get to the printer nad press "Go" on the printer itself.  It then prints without problem.  On the pi version I made of this, I don't have to do this, is there some setting somewhere I can flip to prevent this that anyone knows about?  Not really a CUPS problem but wondered if someone knew.

 

Thanks

Figured this out now using the operational policy.. all is well :)

Link to comment
9 hours ago, Twinkie0101 said:

Can you please share how you solved this?

I did a search for my printer for PPD files.  I found a PPD file for it online, however when I installed this it would not work.  I did some further searching and found that the printer I am using HL4150CDN from Brother will actually work with a another printer driver that was already available in the list built in to this CUPS build.  I tried that driver and it worked just fine.

 

Perhaps find a driver that's compatible but already within that list if you're having a problem.

Link to comment
  • 2 weeks later...

This seems to work nicely with a bit of tinkering.  I noticed when using the usb id for my usb connected HP P2035n I found during a server restart or printer restart the usb id changes.  Seeing this is a network printer, I tinkered a bit more and finally was able to get it to work successfully without the usb connection.

 

Great work Jose

finally we can AirPrint now with CUPS

Link to comment
  • 2 weeks later...

Thanks for your work.

 

Working great so far. Sad that linux cant handle scanning in 2020 xD but its ok.

 

one weird issue is the unraid log getting spammed with:

 

 

Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [_ssh._tcp.local#011IN#011PTR Unraid-Server._ssh._tcp.local ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011TXT ; ttl=4500] not fitting in legacy unicast packet, dropping.
Jan 18 19:49:07 Unraid-Server avahi-daemon[9247]: Record [Unraid-Server._ssh._tcp.local#011IN#011SRV 0 0 22 Unraid-Server.local ; ttl=120] not fitting in legacy unicast packet, dropping.

 

I have no idea what it wants from me :D in another thread ive read something about ipv6, but thats already disabled 😕 

Edited by nuhll
Link to comment
On 1/8/2022 at 7:04 AM, Rick_Sanchez said:

I've got this working when using the path:

/dev/bus/usb/001/002

But, after creating a symlink (in case the Bus and Device numbers are changed after a restart) the print jobs are not sent. The symlink is

/dev/printer1

Any ideas on how to fix this?

 

Rick_Sanchez,

 

cups Docker container -> Edit -> Change from 'Basic View' to 'Advanced View' (upper right toggle)

Under "Extra Parameters" append this to the end:  --device=$(readlink -f /dev/printer1)

Make sure "Printer:" field is /dev/printer1

 

 

========== Long Version (SymLink and docker config) ============

Pre-Req:

* Install cups docker app

* Plug your USB printer in

 

In Unraid Terminal window:

  1. Run lsusb to find your USB printer:
    lsusb

    Find your device from the output. Example: Bus 002 Device 008: ID 04f9:0045 Brother Industries, Ltd HL-2240 series
    Remember the Bus(002), Device(008), and vendor/product ID(04f9:0045) for later:
     

  2. Run udevadm to find the serial number of your printer (replacing /002/008 with the Bus/Device number you collected above):

    udevadm info -a -n /dev/bus/usb/002/008 | grep '{serial}' | head -n1

    Example: ATTR{serial}=="ABC123456"
     

  3. Create a file with the nano editor. (Rules are run in order. 99 would be run 'last', which is why the 99 is in the filename)

    nano /etc/udev/rules.d/99-usb-rules.rules


    In the editor, add the following lines. (First 2 lines are just comments, optional.)
    Replace the Vendor, Product, and Serial#.
    Use any name helpful to you for the Symlink. The result would be /dev/myprinter001 if you use my example:

    # This file maps a Brother Printer (Vendor:Product / Serial) to /dev/myprinter001
    
    # Brother Printer / 04f9:0045 Brother Industries, Ltd HL-2240 series / Serial ABC123456
    
    SUBSYSTEM=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="0045", ATTRS{serial}=="ABC123456", SYMLINK+="myprinter001"

    Close & save the file: [Ctrl+X] -> [y]es -> [enter]
     

  4. The file above gets wiped on boot, so we need to copy it every boot.
    Create a /boot/config/rules.d folder and copy the Rules file you made

    mkdir /boot/config/rules.d/
    
    cp /etc/udev/rules.d/99-usb-rules.rules /boot/config/rules.d/99-usb-rules.rules

     

  5. Now, edit the /boot/config/go script, which:
    * Copies the rules file back out to /etc/udev/rules.d/
    * Changes permissions (likely not necessary, but for completeness it's here)
    * Reload the rules & reset the USB subsystem (often because the rules sometimes don't load in time, so we have to trigger again)
     

    nano /boot/config/go


    And the file contents should be:

    # This sets the USB friendly name mapping rule to apply each boot
    
    cp /boot/config/rules.d/99-usb-rules.rules /etc/udev/rules.d/99-usb-rules.rules
    
    chmod 644 /etc/udev/rules.d/99-usb-rules.rules
    
    udevadm control --reload-rules
    
    udevadm trigger --attr-match=subsystem=usb

    Close & save the file: [Ctrl+X] -> [y]es -> [enter]
     

  6. Reboot the unraid system

    shutdown -r now


     

  7. On bootup, open a Terminal and check if your device is present:

    ls -l /dev/myprinter001

     

To get the cups Docker container working:

  • cups container -> Edit -> Change from 'Basic View' to 'Advanced View' (upper right toggle)
  • Under "Extra Parameters" append this to the end:  --device=$(readlink -f /dev/myprinter001)
  • Make sure "Printer:" field is /dev/myprinter001
  • (Re)Start the cups Docker container
  • Within cups WebGUI, add the printer
Edited by rpertusio
  • Like 2
  • Thanks 1
Link to comment

Can anyone help me figure out why I can't print with this? I have my printer (Brother HL-L2300D) connected to the container and added as a printer. I can print a test page, but when I try to connect to it from another computer (Share printers connected to this system and Allow printing from the internet are both checked on the admin page) nothing prints. The jobs show up and say they've been completed but when I check the printer, nothing actually printed.

Link to comment
On 1/4/2022 at 5:20 PM, Walter S said:

This seems to work nicely with a bit of tinkering.  I noticed when using the usb id for my usb connected HP P2035n I found during a server restart or printer restart the usb id changes.  Seeing this is a network printer, I tinkered a bit more and finally was able to get it to work successfully without the usb connection.

 

Great work Jose

finally we can AirPrint now with CUPS

I have run into the USB id changing as well, and have run across some script-y ways of setting it, but the example is using a synology and some of it I think I could adapt into a user-script that would actually make the docker but that kinda defeats using this template altogether (and adapting it might be right at the "over my head" point as well). 

My printer unfortunately is not network... so I am limited to USB (unless I can locate a 15yr old USB print server I have in the garage)..  anyway, overall I am loving having a cups template to make setting this up a bit cleaner.

Link to comment
On 1/18/2022 at 1:52 PM, nuhll said:

Working great so far. Sad that linux cant handle scanning in 2020 xD but its ok

I have had pretty good luck using sbs20/scanservjs which is pretty easy to setup... I am hoping to find the time to make it my first unraid template worth sharing... I just haven't had the time lately.  But you should be able to get it done with google (or pm me if maybe I can help) ..and its 2022 now

Edited by Garbonzo
snarky comment about the year!
Link to comment
16 minutes ago, rpertusio said:

Please check 2 posts above and you'll see my post on how to make it work. See if my instructions work for you! Happy to take feedback, too.

I just did that (saved the nano file as I got your reply!) so was going to thank you for that bit of learnin' 

Now here is the only issue I have.  I have to manually install the Canon printer drivers via their install.sh every time I rebuild the docker, its easy enough because I map the driver folder so it is trivial...

but I get a Idle - "File "/usr/lib/cups/filter/rastertoufr2" not available: No such file or directory" status after I make any changes, which is often enough since I am playing around with things as I am only a month or so into unraid and about 6 months with docker...

anyway I tried mapping that /usr/lib/cups/filter/ to a persistent location, then I get this.. Idle - "Directory "/usr/lib/cups/filter" has insecure permissions (040755/uid=99/gid=100)." (but incedentally the only 2 files getting written to that location are the "rastertoufr2" and "pdftocpca" so I assume I could add them somehow to my own fork, or by automating something (either the running of the install.sh for the driver, or copying the file into the docker) unfortunately both of those things are going to be tomorrows problem I think, I am getting hungry.. :)

 

ANYWAY, really, thanks a bunch for that info, I shouldn't have posted that other message before reading the whole thread.. :)

 

-G

 

Edited by Garbonzo
corrected second error message
Link to comment

I spent some time today trying to automatically get this file straight.

from inside the docker, I just use "cp /data/rastertoufr2 /usr/lib/cups/filter/rastertoufr2" and I am done... it's easy enough, and takes much less time than executing "yes | ./data/install.sh" to run the canon linux driver install script...  but it's a manual thing I have to do after making any changes, which admittedly wont be so often now that everything is working... but it's something I'd like to know if possible/how to do... (edit: also the container has to be restarted once the file is copied, so this may be more difficult than I imagined without creating a loop)

 

also @rpertusio your instructions for the symlink setup above is working great (finally got to reboot the server this morning) and I am curious if the --device=$(readlink -f /dev/canon) --- and not that there is a need/reason to do it this way, I am just trying to understand unraid --- would be the same as adding a device with name= $(readlink -f) and the vaulue= /dev/canon in the gui... i am just trying to grok how unraid handles things... it appears to work, but I haven't rebooted the server, and don't think that's needed to verify anyway, but again, not sure.  TIA for the 'learnin

 

-g

Edited by Garbonzo
I realize the whole thing may be more trouble than worth
Link to comment
43 minutes ago, tcj said:

The symlink-solution works well ...

 

... until the device number changes (due to printer on/off) while cups-docker is running 😞

 

Can you confirm you followed all the steps?

 

I powered OFF and ON my printer.  The device number changed.  And it picked up within seconds:

 

image.thumb.png.833e9f68fbb1a5b8d4a50e1e46dc0262.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.