Printing to Google Cloud Print using CUPS

I previously blogged about allowing printing to local printers via Google Cloud Print on Gentoo , and recently I have been looking at the opposite of this – printing to Google Cloud Print from Linux.

The main reason to want to print to Google Cloud Print is for future compatibility with printers within Linux – it means that any ‘Cloud Ready Printer’ can be printed to without having to install possibly closed-source, or non-existent printer drivers.

It also allows printing directly to Google Docs, so you can easily print documents from work straight into your Google Docs account, making archiving documents simple, and easily accessible.

With this in mind, I was looking for a simple CUPS driver, which would allow printing via the normal printing functionality of any application, however this didn’t seem to exist… so I decided to write a CUPS backend and driver to support it.

The github project is available here , and I have produced packages for Gentoo ( Sabayon etc ), Debian ( Ubuntu, Mint etc ) , RedHat ( Fedora, Centos, SuSe etc ) and Arch Linux, with instructions here.

14 thoughts on “Printing to Google Cloud Print using CUPS”

  1. Cloudprint (gentoo) is crashing unpredictably for me. I’ve run it all day in a screen session without printing to it and it produced the following output sometime during the day (I don’t know when):
    ——–8><
    Traceback (most recent call last):
    File "/usr/lib/cloudprint/cloudprint.py", line 388, in
    main()
    File “/usr/lib/cloudprint/cloudprint.py”, line 384, in main
    process_jobs(cups_connection, cpp, printers)
    File “/usr/lib/cloudprint/cloudprint.py”, line 313, in process_jobs
    for job in printer.get_jobs():
    File “/usr/lib/cloudprint/cloudprint.py”, line 234, in get_jobs
    return self.cpp.get_jobs(self.id)
    File “/usr/lib/cloudprint/cloudprint.py”, line 193, in get_jobs
    { ‘X-CloudPrint-Proxy’ : ‘ArmoooIsAnOEM’},
    File “/usr/lib/cloudprint/cloudprint.py”, line 107, in f
    r = attr(*arg, **karg)
    File “/usr/lib64/cloudprint/rest.py”, line 105, in post
    return self.rest_call(‘POST’, path, data, content_type, headers, response_type)
    File “/usr/lib64/cloudprint/rest.py”, line 88, in rest_call
    raise REST.RESTException(‘REST Error’, resp.status, data)
    rest.RESTException: REST Error:502
    Message:

    Error 502 (Server Error)!!1

    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}


    502. That’s an error.
    The server encountered a temporary error and could not complete your request.Please try again in 30 seconds. That’s all we know.
    ——–8><
    It's a nice little program and I'd like to get it running. If there's no fix, is there an easy way of restarting on a crash – without using an hourly cron job?

  2. Hi Robert,

    It looks like you are using Armooo’s cloud print software ( I wrote CUPS Cloud Print [ lets you print to Google Cloud Printers ], which does the opposite of Armoo’s software [ lets you share a CUPS printer over Cloud Print ] ), the only thing I can suggest is try using the latest code on Github, as it looks like you might not have the most recent version. It does also still look actively maintained, so if it doesn’t solve the issue you may want to report the issue to Armooo , it looks like something that should be simple to fix.

    Simon

  3. The gentoo ebuild contains the lines:

    EGIT_REPO_URI=”git://github.com/armooo/cloudprint”

    and

    git checkout 620e490f1a1a82e42f5c3b603517e64ed2919654

    I believe that this means that it installs the latest code on Github. As I only installed it a few days ago, I assume I’m using the latest version.

    I’ve installed a cron job to test it and it hasn’t crashed for more than 24h now. Keeping fingers crossed . . .

  4. Hi Jeremy & edcompsci,

    I don’t currently support Lucid at is only includes Python 2.6 , all the other platforms I support have 2.7 , but I will have a look and see if there is any issues with creating a package based on Python 2.6 .

    Simon

  5. How do I add Print to FedEx as an option to CUPS with this? Seems to skip right past it, when that is pretty much my de-facto default printer in reality.

  6. Hi Paul,

    I’m looking into FedEx support next, it doesn’t seem to appear as a normal printing option, but I’ll see what I can do.

    Thanks

    Simon

  7. Hi DarioX7,

    Unfortunately I haven’t got an OpenWRT device to test on, but I would guess the process would be something like:

    Install CUPS ( http://wiki.openwrt.org/doc/howto/cups.server )
    Install dependencies ( Python 2.6+, pycups library, python-httplib2 library ) , there may be packages etc to do this.
    Do a source install of CUPS Cloud Print ( it may be easier to git clone on a desktop or laptop and copy the files over than actually doing the git clone on the OpenWRT device ).
    Run the setupcloudprint.py script.

    Hope this helps

    Simon

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>