Google App Engine Device Cloud Client

From Digi Developer

Jump to: navigation, search

Contents

Purpose

The Google App Engine Device Cloud Client is one example of a client application that uses Web Service (XML) communication to a Digi gateway using Device Cloud. It is deployed to a Google Appspot account and runs on the servers provided by Google. The advantage of this hosted service is that there is no server infrastructure needed at the customer and applications can run 24/7 on the Google servers, making it an ideal solution if continuous sensor readings are required, e.g. for daily/weekly statistics of sensor data, displayed to the users in form of graphs accessible over the web:

Google App Engine Device Cloud Client Main View Google App Engine Device Cloud Client Graph View

Requirements

Hardware

Software

Usage

Installation

  • Create DIA project that includes drivers at least for the Digi Wall Router and the XBee ZB module on development board. Device names should be xbr0 for the wall router and xbib0 for the development board. In addition to the drivers it is mandatory that the DIA project includes the RCI Handler presentation to enable the gateway to talk to the Device Cloud. Optional the Embedded Web presentation can be included for local tests.
    Recommended is to start with the iDigi Professional Development Kit sample that can be found in the ESP by choosing File | New | iDigi DIA sample project. This sample comprises the drivers with correct device names as well as the necessary presentations mentioned above. For more information, consult the Device Cloud Professional Development Kit ZB Getting Started Guide (see steps 6 and 7)
  • Run DIA project on the Gateway as explained in the Getting Started Guide
  • If available, test with embedded web page if wall router and development board are working as expected
  • Add Digi gateway to your developer.idigi.com account as explained in the Getting Started Guide (steps 1 and 2) and make sure it shows up as Connected
  • Install Python 2.5 and the Google App Engine SDK for Python
  • Extract the necessary source files to a subfolder of your Google App Engine SDK installation, by default \Program Files\Google\google_appengine
  • Use a text editor to open Config.py in the iDigi_kit folder. Change the username and password fields with the data of your Device Cloud developer account and modify the Device ID field with the Device ID of your gateway. Change the other fields if necessary and if you know what you are doing.
  • Create a new application in your Google Appspot account, e.g. "<your name>-idigi" and choose any title for the application, e.g. "iDigiGoogleApp"

Google Appspot Application

Deployment

  • Open the Google App Engine Launcher and
    • add the Device Cloud client with File | Add Existing Application and choosing the iDigi_kit subfolder extracted previously
    • change the name of the application to match the application that you created on your Google Appspot account by selecting the application in the list, clicking Edit and modifying the application: entry in the file
    • deploy the application by selecting it in the list and clicking Deploy

Google App Engine Launcher

    • close the deployment window when instructed to do so

These steps can be repeated as often as you change the application source code.

  • To check the status and output of the application
    • use the Current Version link in your Google Appspot application list to see the output of the application, click on the gauges to see the corresponding graphs

Access the Application View

    • after a few moments of operation, check the Logs, Cron Jobs and Datastore Viewer views in your application Dashboard view (accessible by clicking on the application name in the Google Appspot application list) to ensure the application operates as expected. Cron Jobs should list a job /update (sensor data update) running every 2 minutes (UTC), the Datastore Viewer should list sensor values collected from the wall router and development boards

Access the Dashboard view

Current Limitations

  • Only Celsius temperature values are supported
  • Device names need to be xbr0 and xbib0

Sources

Feel free to edit sources to your needs:

Media:Google_appengine_iDigi_kit.zip

Personal tools
Wiki Editing