Google replacement for CloudMqtt - google-app-engine

We have an IoT project here
Facts:
We have our app running on Google App Engine, PHP runtime.
The clients are raspberry pi or similar boards.
We are using cloudmqtt (www.cloudmqtt.com) to generate a push event on our C client app, which then runs the sync process with the server
Is there a google cloud replacement for what we are doing?
We tried Google Push/Sub, but our C app needed to be polling the service.
We would love to use Google Cloud Messaging but we could not find any way to use it for push notifications for the client.
Basically, we need to send push messages to a raspberry pi, what would you recommend for that? (remember our server is on GAE)

GCM handle polling mechanisms on its own and should let you push notifications as well as messages to the client. Try debugging your application using documentation.
During I/O 2016, they also launched Firebase Cloud Messaging (FCM) which is basically a newer version of GCM, and is the recommended product to use.
But if you wanted to use your deployment rather than a service, you can use Google Compute Engine instances to deploy EMQTTD which is a highly scalable MQTT broker written in Erlang.

Related

Google Cloud Datastore from embedded device in POSIX c?

I managed to get Google Cloud Messaging working on an embedded device using libcurl using http requests and a 'BrowserKey' for authentication.
Now i would like to move to Google Cloud Datastore for saving settings of the embedded device into the cloud. There seems to be support for Java, Ruby, Python, NodeJS but so far I found nothing that could help me further using things i know.
Can I get access to the Cloud Datastore from my existing application written in plain C ?
While we don't have client libraries for C, we do have a RESTful API (documentation) that you can call, so it should be possible to write your own simple library in C to talk to Cloud Datastore from an embedded device.
If you are concerned about security (since someone could possibly impersonate your embedded device and get direct access to your Cloud Datastore instance, I recommend you take a look at Cloud Endpoints (documentation). It gives you an easy way to generate a RESTful API on top of App Engine. You could then use your custom API in the embedded device and use App Engine as a proxy/data validation layer that controls access to the database.

Can I use GAE Cloud Endpoints from a desktop application?

I want to write a desktop application that interacts with a GAE-based web service. For Android and Web clients there is the possibility to generate client libraries automatically. Is there a way to generate client libraries for C or C++? I would settle for Python as well.
Theoretically all the Google APIs Client libraries allow accessing any Discovery-based API as long as the discovery document is available (which is the case for cloud endpoints) even though the functionality isn't very well documented in most cases.
See https://developers.google.com/discovery/libraries for a list of currently available client libraries.
As example of how you can use the python client library with cloud endpoints:
service = build("your_api", "your_api_version", http=http,
discoveryServiceUrl=("https://yourapp.appspot.com/_ah/api/discovery/v1/"
"apis/{api}/{apiVersion}/rest"))
result = service.resource().method([parameters]).execute()
Currently, Google App Engine Cloud Endpoints only supports generating client libraries for Android (Java), iOS (Objective-C) and JavaScript. See https://developers.google.com/appengine/docs/java/endpoints/overview.
Of course you may still develop your application using GAE for your web service and write the web service interface libraries yourself in any language you choose.

Can I Use Google App Engine as XMPP Gateway

I have a Cloud App hosted on Windows Azure and I need to integrate XMPP with the service. Can I use GAE's XMPP API to achieve this? I'll need to be able to create new Jabber IDs and send & receive messages from other clients like GTalk.
As far as I know, GAE only supports Java, Python and my expertise is limited to .NET & C#; so, I'll have to make my Azure App to communicate with the GAE.
Finally, can I use GAE as an alternative to running ejabbered on Windows Azure Virtual Machines or Amazon EC2?
Thanks in advance... :)
You could but it would be very limited. You may be better off running ejabbered somewhere else.
With GAE's XMPP API, your username selection is rather limited. See the GAE XMPP Overview API documentation.
Your Cloud App would need to send and receive messages from your GAE app via HTTP accesses. This is no big deal for sending, but you'll have to work your own way of receiving messages. You could buffer your messages to the datstore and poll for messages. You could use the Channel API to receive messages directly, but so far the Channel API client is only available in Javascript, so your app would need some sort of javascript interpreter to use the client.
You will be able to send/receive messages from other XMPP addresses like GTalk clients.

Are there any hosted services for Socket.IO (or alternatives)?

I have a web application running on Google App Engine and need to provide near real time updates to connected web clients. One way would be to use the Google App Engine Channels API, but I'm a bit uneasy about using a proprietary solution.
Are there any reliable hosted services allowing for clients to connect using Socket.IO (with all its supported fallback protocols), and a web server solution running on Google App Engine to publish notifications to it? Any other alternatives that offers the same functionality?
You looking for something like beaconpush.com?
I have the same problem as you.
I've thought about using the Channel API as well however the free quota is quite low (100 channels created per day, each client is one channel).
Here's the solution I'm building:
All of the server logic runs in app engine python runtime
app engine serves all the html and client code
I run a node.js socket.io server on dotcloud (using their free tier)
the node.js server sets up an http server that listens to get requests on a few special url endpoints (ie: myapp-on.dotcloud.com/room/[room_id]) and when it gets called it triggers the socket.io broadcast to the appropriate clients
html clients generated on app engine connect to my myapp-on.dotcloud.com
All user input in the client is sent to app engine via a normal ajax post/get
when the app engine server code needs to push something to the client it makes a url fetch on the appropriate url (myapp-on.dotcloud.com/room/[room_id]) that triggers a message push via socket.io to the connected clients
I'm yet to implement this, but sounds like a workable plan
the idea is to keep all the logic in app engine and only use the socket.io server as a message pusher

Google App engine for mobile clients

Can I use GAE(Google App Engine) for developing a server for mobile clients? Mobile clients will send data to server every 10 seconds.
I am planning to develop the prototype using GAE and then depending on the results, will decide where to locate the prod server.
And are there any best practices to follow in developing code so that it will have very minimal dependancy with GAE (Can easily port to another environment with minimal code change when required)
thanks.
Ofcourse you can, GAE provides a good way to create a great backend for a mobile app.
about dependencies, you can use a project like django-nonrel, it creates an interface between your code and the API of GAE.

Resources