SickHub / docker-cups-airprint

A standalone CUPS and Avahi (mDNS/Bonjour) server, exposing local printers on AirPrint for iOS devices
GNU General Public License v3.0
159 stars 38 forks source link

Document USB printer setup #29

Open DrPsychick opened 3 years ago

DrPsychick commented 3 years ago

@HammyHavoc would you be willing to create a PR for this?

sunmeplz commented 3 years ago

Hi @DrPsychick ! not sure if there need some extra info for that, It takes long lime to understand why my printer is not visible in UI. So if you'll add that backends other staff will work out of the box. So I have configured printer by UI, then copy ppd and printers.conf and create a custom docker image. In my case driver was already installed(splinx)

FROM drpsychick/airprint-bridge:2.3.1-focal
RUN ln -s /usr/lib/cups/backend-available/usb /usr/lib/cups/backend/usb
COPY printers.conf /etc/cups/
COPY Xerox_Phaser_3121.ppd /etc/cups/ppd
RUN chmod 640 /etc/cups/ppd/*
RUN chown root:lp /etc/cups/ppd/*
sunmeplz commented 3 years ago

Useful commands: lsusb - print usb devices, you can find you prinnter there and catch bus num and device num your usb device would be here: /dev/bus/usb/bus_num/device_num you can plug it info docker with that path but I found that device num was changed after printer power off-on, so I'm using /dev/usb/lp0 which is static, I think.

DrPsychick commented 3 years ago

Perfect, thanks @sunmeplz. I'll put together a doc for it.

FrancYescO commented 3 years ago

in my case adding --device /dev/bus --device /dev/usb -v /var/run/dbus:/var/run/dbus (sincerely idk if all of these are needed) to the docker run command was enought to find and setup the usb printer attached to my orangepi4 from the webinterface

DrPsychick commented 3 years ago

As it seems @sunmeplz and @FrancYescO you both succeeded with a USB printer setup. Would you be willing to submit a PR with a short description/guide in USB.md linked in the README.md?

FrancYescO commented 3 years ago

I don't think a separate USB.md file is needed, expecially because your README is pretty verbose (in my opinion all things that requires a fully rebuild of the container should be removed and guide the user to use volumes/some env variable), probably a few lines added are enought to describe how to add an USB printer I'll try to do a PR after a little more testing ;)

NeoMod commented 3 years ago

I know this is almost a solved issue, but since I found this docker image very useful I wanted to share my experience with a USB printer.

In my setup, Docker is running on a VM under ESXI; the printer is physically attached to the server and mounted to the same VM as Docker.

Once I started the container, I then used the official "Driver Install Package" for my printer (Brother) via console to install the drivers and configure the printer as a "local USB Printer".

Doing so, CUPS was able to automatically detect the aforementioned printer: in fact, it was already installed, I had to just tweak a few options and it was ready to print.

Probably this is one of those "happy case scenarios" where everything went smooth by sheer luck. Although - maybe- it's worth mentioning as a possible "Easy Step" for those dealing for the first time with CUPS and not familiar with CLI commands.