-
Notifications
You must be signed in to change notification settings - Fork 185
Install
These instructions will result in sharing all printers on your CUPS server with Chrome, on the local subnet (mDNS broadcast domain) only. This is accomplished without creating/maintaining any config file.
If you need to share the printers with Google Cloud Print clients on Android, iOS, or Windows, or if you need to share the printers with clients not on the local subnet, then visit Configuration after completing these steps.
Visit https://github.com/google/cups-connector/releases/latest to download binaries for your platform. If binaries aren't available for your platform, then visit Build from source.
Extract the .tar.gz file you downloaded. You'll find two binary executables:
gcp-cups-connector
- shares CUPS printers
- processes print jobs
- runs for long periods of time
gcp-cups-connector-util
- create a new config file
- upgrade a config file after a release
- delete all printers
- collect monitoring values
Before running the connector, make sure that the necessary client libraries are available: CUPS and Avahi. Also, git and bzr are needed to fetch some Go dependencies.
If your distro is based on Debian (Ubuntu, Raspbian, Mint, others) then this one-liner will get all dependencies:
$ sudo apt-get install libcups2 libavahi-client3 avahi-daemon git bzr
OpenSUSE 13.2:
$ sudo zypper install cups-libs libavahi-client3 avahi git bzr
The binaries don't work on Fedora currently, due to a difference in the name of libcrypto.so
. You can still Build from source.
You will also need a running CUPS server. The standard CUPS client configuration applies:
/etc/cups/client.conf
~/.cups/client.conf
- environment variables
CUPS_SERVER
andCUPS_ENCRYPTION
Run the connector:
$ gcp-cups-connector
The connector logs to to /tmp/connector.INFO
(and others) by default.
If any printers are installed on the CUPS server, then they should now be available locally via Google Cloud Print. Test this by printing to the newly available GCP printer(s) from a Chrome browser.
Ctrl-C will stop the connector.
This would be a good time to create a config file, if you need one.
There are many ways to do this. This is a simple method that works well for a Raspberry Pi.
Edit /etc/rc.local
, add these lines at the end, just before exit 0
# CUPS Connector:
# sleep: hack to wait for the network interface to come up
# su ... pi: run as user "pi"
# --login: environment similar to "pi" instead of "root"
# --command: run this thing
# /home/pi/cups-connector/gcp-cups-connector: thing to run
# &: run the command "in the background"
sleep 60
su --login --command /home/pi/cups-connector/gcp-cups-connector pi &