Page 1 of 1

Need help with setting Google cloud print

Posted: Sat Jul 25, 2015 2:28 am
by rubiks
I have setup my rasberry pi as printer server and printing from Mac and Windows are working fine. However, I have couple chromebooks that print through Google cloud print. As I am very new to ubuntu commands, I need some helps with the following setup. Greatly appreciate your help!

Disclaimer: I basically using the read me from GCP CUPS Connector

1: sudo apt-get install build-essential

2. sudo apt-get install libcups2-dev libsnmp-dev

3. go get github.com/google/cups-connector/connector
go get github.com/google/cups-connector/connector-init
go get github.com/google/cups-connector/connector-monitor
go get github.com/google/cups-connector/connector-util

4. This is the step I have issue with.

To create a basic config file called cups-connector.config.json, use connector-init.

Do I do #sudo nano /cups-connector.config.json/? Then what does mean using connector-init?

Also the default file is the following, I understand that I need to update the gmail address and proxy-name, what is the correct proxy name should I be using?

{
"xmpp_jid": "e73b3deadc7bbbeefc1d2d22@cloudprint.googleusercontent.com",
"robot_refresh_token": "1/D39yourG_KMbeefjnsis1peMIp5DeadMyOkwOQMZhSo",
"user_refresh_token": "1/fBXneverhZHieath_2an2UxDVsourGE8pwatermelon",
"share_scope": "somedude@gmail.com",
"proxy_name": "joes-crab-shack",
"gcp_max_concurrent_downloads": 5,
"cups_max_connections": 5,
"cups_connect_timeout": "5s",
"cups_job_queue_size": 3,
"cups_printer_poll_interval": "1m",
"cups_printer_attributes": [
"printer-name",
"printer-info",
"printer-location",
"printer-make-and-model",
"printer-state",
"printer-state-reasons",
"printer-uuid",
"marker-names",
"marker-types",
"marker-levels"
],
"cups_job_full_username": false,
"cups_ignore_raw_printers": true,
"copy_printer_info_to_display_name": true,
"monitor_socket_filename": "/var/run/cups-connector/monitor.sock",
"gcp_base_url": "https://www.google.com/cloudprint/",
"xmpp_server": "talk.google.com",
"xmpp_port": 443,
"gcp_xmpp_ping_timeout": "5s",
"gcp_xmpp_ping_interval_default": "2m",
"gcp_oauth_client_id": "539833558011-35iq8btpgas80nrs3o7mv99hm95d4dv6.apps.googleusercontent.com",
"gcp_oauth_client_secret": "V9BfPOvdiYuw12hDx5Y5nR0a",
"gcp_oauth_auth_url": "https://accounts.google.com/o/oauth2/auth",
"gcp_oauth_token_url": "https://accounts.google.com/o/oauth2/token",
"snmp_enable": true,
"snmp_community": "public",
"snmp_max_connections": 100
}

5. Do I just run the two commands?

Finally, make sure that the socket directory (see monitor_socket_filename above), exists and is writeable by the user that the connector will run as:

$ sudo mkdir /var/run/cups-connector
$ sudo chown $USER /var/run/cups-connector


Do I need to add anything additional? Thanks a lot.

Re: Need help with setting Google cloud print

Posted: Sat Jul 25, 2015 4:05 pm
by DougieLawson
sudo pip install cloudprint # gets the python version of Cloudprint that I'm running. You method looks like it may be easier and more automatic. I ended up adding a line to /etc/rc.local to get the Python cloudprint program running.

My B+ is running that so that my wife can print from her Chromebook. I had to set up the printer at https://www.google.com/cloudprint and then share it with my wife's GMail id.

Re: Need help with setting Google cloud print

Posted: Mon Jul 27, 2015 8:34 am
by SatNav
I just set this up over the weekend, you're most of the way there (as I'm sure you realise).

After the 'go get' commands, the four utilities will be stored in your 'go/bin' directory. So do the following:

Code: Select all

cd $GOPATH/bin
./connector-init
Then follow the instructions. This should drop 'cups-connector.config.json' in the folder. Then...

Code: Select all

./connector
... to begin the connector.

Re: Need help with setting Google cloud print

Posted: Mon Jul 27, 2015 11:22 pm
by rubiks
SatNav wrote:I just set this up over the weekend, you're most of the way there (as I'm sure you realise).

After the 'go get' commands, the four utilities will be stored in your 'go/bin' directory. So do the following:

Code: Select all

cd $GOPATH/bin
./connector-init
Then follow the instructions. This should drop 'cups-connector.config.json' in the folder. Then...

Code: Select all

./connector
... to begin the connector.
Actually, I end up taking a much easier route using chromium.

#This is getting some standard chromium packages and add user to printer group.

Code: Select all

sudo apt-get install chromium-browser cups

Code: Select all

sudo adduser pi lpadmin
Then go to http://127.0.0.1:631 to add your printer.

Open up chromium and go to advance option to connect your printer with google could print.

If you have multiple Chromebooks like me, go to the first Google account and share the printer with others google accounts.

You are all set.