José Coelho Posted December 20, 2021 Share Posted December 20, 2021 (edited) Repo: https://github.com/josecoelho/unraid-templates/tree/main/cups I based my docker build on this comment of the previous thread Feedback is more than welcome. This is my first template for Unraid. Edited December 22, 2021 by José Coelho 2 Quote Link to comment
José Coelho Posted December 20, 2021 Author Share Posted December 20, 2021 I changed the base image to https://hub.docker.com/r/ydkn/cups as it is kept up to date Quote Link to comment
Twinkie0101 Posted December 22, 2021 Share Posted December 22, 2021 Hi, probably a dumb question and I'll be shaking my head after this, but does the printer need to be connected via USB to my server or can I use a wifi based printer? Also, and related, but I don't understand Printer variable. I am assuming this means the printer is connected directly to the server. Thanks! Quote Link to comment
cracyfloyd Posted December 22, 2021 Share Posted December 22, 2021 Thnx a lot for this container. i am search a long time for this. all i try before dont worked very well under unraid then i used a vm for cups. 1st tests are very very well. 1 Quote Link to comment
craig_read Posted December 22, 2021 Share Posted December 22, 2021 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? Quote Link to comment
craig_read Posted December 22, 2021 Share Posted December 22, 2021 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! Quote Link to comment
dereitz Posted December 22, 2021 Share Posted December 22, 2021 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! Quote Link to comment
ZakMcKracken Posted December 22, 2021 Share Posted December 22, 2021 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..... 🙂 Quote Link to comment
hwanggz Posted December 23, 2021 Share Posted December 23, 2021 thank you so much! i searched and tried many other cup dockers and none of them worked. this one is working out of the box. breath a new life for my old Brother 2240D! Quote Link to comment
craig_read Posted December 23, 2021 Share Posted December 23, 2021 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 Quote Link to comment
craig_read Posted December 23, 2021 Share Posted December 23, 2021 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 Quote Link to comment
Twinkie0101 Posted December 23, 2021 Share Posted December 23, 2021 On 12/22/2021 at 6:53 AM, craig_read said: 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! Can you please share how you solved this? Quote Link to comment
craig_read Posted December 24, 2021 Share Posted December 24, 2021 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. Quote Link to comment
Walter S Posted January 4, 2022 Share Posted January 4, 2022 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 Quote Link to comment
Rick_Sanchez Posted January 8, 2022 Share Posted January 8, 2022 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? Quote Link to comment
NewDisplayName Posted January 18, 2022 Share Posted January 18, 2022 (edited) Thanks for your work. Working great so far. Sad that linux cant handle scanning in 2020 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 in another thread ive read something about ipv6, but thats already disabled 😕 Edited January 18, 2022 by nuhll Quote Link to comment
rpertusio Posted January 25, 2022 Share Posted January 25, 2022 (edited) 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: 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: 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" 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] 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 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] Reboot the unraid system shutdown -r now 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 January 25, 2022 by rpertusio 2 Quote Link to comment
eblohm93 Posted January 27, 2022 Share Posted January 27, 2022 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. Quote Link to comment
Garbonzo Posted January 28, 2022 Share Posted January 28, 2022 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. Quote Link to comment
Garbonzo Posted January 28, 2022 Share Posted January 28, 2022 (edited) On 1/18/2022 at 1:52 PM, nuhll said: Working great so far. Sad that linux cant handle scanning in 2020 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 January 28, 2022 by Garbonzo snarky comment about the year! Quote Link to comment
rpertusio Posted January 28, 2022 Share Posted January 28, 2022 22 minutes ago, Garbonzo said: I have run into the USB id changing as well... 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. 1 Quote Link to comment
Garbonzo Posted January 28, 2022 Share Posted January 28, 2022 (edited) 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 January 28, 2022 by Garbonzo corrected second error message Quote Link to comment
Garbonzo Posted January 28, 2022 Share Posted January 28, 2022 (edited) 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 January 28, 2022 by Garbonzo I realize the whole thing may be more trouble than worth Quote Link to comment
tcj Posted January 29, 2022 Share Posted January 29, 2022 The symlink-solution works well ... ... until the device number changes (due to printer on/off) while cups-docker is running :-( Quote Link to comment
rpertusio Posted January 29, 2022 Share Posted January 29, 2022 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: Quote Link to comment
Recommended Posts
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.