How to register classic printer to google cloud print - google-cloud-print

How to register classic printers (e.g. HP or Samsung printer) to google cloud print using service register API(https://www.google.com/cloudprint/interface/register) call. I am passing these required parameters-
'printer' => 'My classic printer',
'proxy' => '212121',
'capabilities' => '<XPS capabilities data>',
'defaults' => '<XPS capabilities data>'
As I am not sure from where to get proxy id, I am passing arbitrary value. I am making the call using PHP CURL. Once the printer is registerd using API call it is showing printer type as 'Cloud ready printer' and connection status as 'unknown' in google account's printer list interface.
But if i do mannual register using google chrome browser it is showing as 'Classic printer connected via Google Chrome' and connection status as 'Online'.
Please comment if anyone has any idea..

Printers show as 'Online' if the software that registered the printer maintains an active XMPP connection to Cloud Print. When you use Google Chrome to connect the printer, Chrome maintains an XMPP connection to Cloud Print. When you register the printer using the API directly, I'm guessing your PHP code also doesn't create an XMPP connection for that printer. You'll still be able to submit jobs to your 'Offline' printer, it's just that Cloud Print won't be able to send the printer a notification about the newly submitted print job. If you'd like to create an XMPP connection to Cloud Print, you can read more about it here: https://developers.google.com/cloud-print/docs/devguide#receiving
Regarding the differences in label (Cloud Ready vs Classic Printer), Chrome adds some tags into the printer to help Cloud Print identify the printer as being connected through Chrome.

Related

connecting a raspberry pi to a google home

I want to control my raspberry pi with my Google Home at college, but everything I find involves a server and opening a port which I can not do on my schools network.
Is there another way I can do this?
The Google Home has no way to directly control other devices on the same network or through other wireless protocols. Everything goes through an Internet-based service and expects to communicate with devices via a server-based proxy. How that server communicates with the device is up to the developer.
Depending on your needs and capabilities, you do have a few options.
One option, for example, is to use a tool like ngrok to create a tunnel between the device itself and a service run by ngrok on the public Internet. Calls to the public https address are sent to a service running locally on your device, and you can handle it accordingly.
Another is to have your device connect to a server and listen for command changes, and then execute those changes. If you don't want to run a server, you can even use something like Firebase - have your device listen for changes on the real-time database (which can use the HTTPS port to communicate as a client, so you don't open anything) and have something like a Firebase Cloud Function act as the webhook for your Action.
Go through this blog post: http://nilhcem.com/android-things/google-assistant-smart-home
You will have to set up a OAuth server but as #Prisoner said you can use ngrok to tunnel the device to internet, BUT I would recommend using "localtunnel" as it provides a free static url and the set-up is also easy. NO Port Forwarding is required with this method.
More info on localtunnel setup:-
How to generate fixed url with ngrok
Moreover you need to activate the OAuth server only once for account linking & than you can close it.
The simplest way I can think of is to expose your Pi to the internet (using port forwarding, ngrok, or whatever) then set up an IFTTT Google Assistant trigger to invoke a webhook which points to your exposed Pi.

Google Smart Home integration with my IoT device (clarification needed)

I am looking for some clarification to how Google Smart Home works.
I am looking to integrate my current end device which control lights with Google Smart Home.
My end device is running a very small microcontroller utilizing an RTOS (Linux is not available)
Here is how I see it (Please correct or comment)
To my understanding this requires me to host my own cloud service
which will talk to my current end device?
My cloud service will then talk to Google cloud service.
My cloud service defines the protocol to talk to multiple end devices
Google Smart Home define the protocol to talk to my cloud service
Questions
Is there any method of doing this without having my own cloud Service?
That is a pretty basic summary of things - yes.
The crucial point there is that issuing a command to the Google Home does not have it send out a message on your local network. Google issues any commands from their network - not from your device.
This might seem like a minor detail, but it doesn't need to be a "cloud service" that you control that Google talks to. It does need to be a publicly accessible HTTPS endpoint. This could be a cloud service (and it would be in most cases), a public non-cloud server, or even just a public URL that has a tunnel to your private network (such as with ngrok).
The last is really how you'd get around having your own cloud service - you can setup the control on a local machine, and have a tunnel using ngrok.
I think a specific example may be beneficial: here's how to connect Google Home to your devices using an intermediary service like IFTTT:
Create a recipe (applet) on IFTTT to connect Google Assistant to an ngrok tunnel using the Webhook service. This permits you to define a simple keyword phrase that the Google Home will recognize (like "Hey Google turn on my device"). The applet will then call a webhook - e.g. ngrok - with a custom command that you get to define (like "https://myngroktunnel.ngrok.io/Control.cgi?mydevice=on" ), where myngroktunnel is your ngrok tunnel address (see below #2) and Control.cgi is the CGI script that you have placed on your microcontroller (see below #3).
You would need to install and run ngrok on your microcontroller: this will connect the IFTTT applet to your microcontroller via the ngrok tunnel and give you a publicly-accessible URL that forwards requests to your microcontroller. You would typically forward your ngrok tunnel to a specific port on your microcontroller where you are running a web server (e.g. Apache) with CGI scripts to control your device. There are other secure tunnel services available on the web: ngrok is just one of them. So, you do not have to host your own webservice, but you do have to use a tunnel to a publicly-accessible service.
The web server that you have placed on your microcontroller has CGI scripts that control your device (for example, let's say you have a Control.cgi script that turns your device on or off, given a command string like mydevice=on, e.g. the hook in the IFTTT applet is "/Control.cgi?mycommand=on"
Of course, the RTOS on your microcontroller muse be capable of running ngrok and a web server - this is why many people have chosen to use a single-board computer like the Raspberry Pi or Orange Pi running a form of linux to host and control their devices. Since your device's RTOS is not linux, I would suggest getting a linux device which would then forward the request to your RTOS device over your LAN.

proxmox CT external vnc access

I'm creating a PAAS provider with openVZ virtual machines on proxmox.
I want to use noVNC to access the instances in another website different than proxmox console.
I used an url with this form
wss://promox_ip:8006/api2/json/nodes/node_name/openvz/instance_id/vncwebsocket?port=5900&vncticket=vnc_ticket
I'm always getting this error:`
connection closed unexpectedly.
`
note that i use a new ticket each connection.
Finally solved by adding modifications to HTTPerver.pm file under
/usr/share/perl5/PVE/
to Allow accessing novnc console when not logged in.
Then send POST resquest to
/api2/json/nodes/{node}/lxc/{vmid}/vncproxy
and get ticket and port.
Then you can connect via websocket to this link
/api2/json/nodes/{node}/lxc/{vmid}/vncwebsocket

Unable to access Google Cloud SQL (old) console

As of today, I can no longer access the Google Cloud SQL web console. For as long as we've been using Google Cloud SQL (about a year now) we've always been able to open the old google API console to get to the SQL prompt, but today the "noredirect" link stopped working and it always redirects to the new Google developers console which has no way to run SQL against the database. The URL we are using is like this:
https://code.google.com/apis/console/b/2/?noredirect&pli=1#project:999999999999:sql:instance:myprojectid:db01
Any ideas why this stopped working, and any alternatives for an SQL web interface? I would prefer to not have to setup a static IP and connect from a MySQL client.
Thanks.
This service has been turned down. There are several alternatives:
1) You can use the new "gcloud beta sql connect" command that is included in the Cloud SDK. Unless you machine supports IPv6 (unlikely) you will need to enable a IPv4 address for your instance.
2) You can connect using the normal mysql client. Again, unless you machine support IPv6 (unlikely) you will need to enable a IPv4 address for your instance. You will also need to authorize your IP address.
3) You can deploy PHPMyAdmin on Google App Engine which will provide you with a web console.

Client times out when launching XenApp6 app from internet

Using XenApp6 on Windows 2008 R2 I have the windows Calculator as a test app. Apps are set to run on the server, and are not streamed to the client. When running Calculator from inside the network it runs as expected.
However, when accessing the app from an external web browser or Citrix Receiver, the client always times out and the Calculator app is not launched. I see incoming traffic on port 1494 (which is open) but there is no response from XenApp.
For both internal and external, I log in as Administrator and can see the citrix management console showing my test Calculator app.
Any ideas why it's timing out and not launching from the internet?
Thanks.
Chris
If the Citrix server's internal IP is being NATted to an external IP you may need to set an alternate address using altaddr on the Citrix server. Try this: Download the ICA file that the Citrix server passes when you launch a published app from a web browser, open it in a text editor, and see what FQDN or IP it is trying to connect to.