Thursday, January 21, 2016

Setting up odk aggregate server with google app engine


ODK(Open data kit) is open source tool for conducting surveys and collecting data through mobile application instead of traditional paperwork. ODK is widely used by NGO and other communities over the world but still some them unaware of this amazing tool and paying lot of money to third parties who provide them same features sometimes not enough. 



to know more about ODK please visit ODK official website . This site has everything you want to / wish to know about ODK.  In this we are going to learn how to setup aggregate server with google app engine.






Requirements

Create a new App Engine Instance

  1. Log into your personal Google account.
  2. Click “Create Project”
Screen Shot 2015-07-22 at 11.44.32 AM.png
  1. Give the project a name. I.e. “My ODK Project”. Note that the project name you select will determine your project ID, which is usually the same as your project name, but lowercase and with hyphens instead of spaces. The project ID will determine what your project’s URL will be - <projectid>.appspot.com - so choose wisely!
Screen Shot 2015-07-22 at 11.44.49 AM.png
  1. Click “Create”

Download and install ODK Aggregate on your computer

  1. Open a new tab and go to http://opendatakit.org/downloads/
  2. Select and click on appropriate version of ODK Aggregate to install. Windows users should click on ODK Aggregate v1.4.7 windows-installer.exe.
Screen Shot 2015-07-22 at 11.47.25 AM.png
  1. One the details page for the installer, click “Download” to download the file
  2. Once downloaded, Double click the file (i.e. “ODK Aggregate v1.4.7 windows-installer.exe”) on your computer
  3. Follow the ODK Aggregate Setup Wizard:
    1. Setup - ODK Aggregate: Click the “Next” button at the bottom righthand corner.
    2. License Agreement: Check “I accept the agreement” and click “Next”.
    3. Select an output parent directory: Select the location on your computer where you’d like to store the ODK Aggregate files associated with the project and create a folder to store the files in. You can name the folder whatever you like. Click “Next”
    4. Choose Platform: Select Google App Engine option. Click “Next”.
    5. ODK Aggregate Instance Name: Enter instance name, i.e. “My ODK Project”. Click “Next”.
    6. Super-user ODK Aggregate Username: Create user name (whatever you want, i.e. “admin”).  Click “Next”.
      1. i.e. “admin”
      2. you use this the first time you log in
      3. default password when you log in will be “aggregate”, so it’s smart to change password right away for security reasons
    7. Google AppEngine application ID: To get the correct ID, look your projects page at https://console.developers.google.com/project. Copy the Project ID for the AppEngine instance exactly. For example, for “My ODK Project” in the console pictured below, the Project ID is “my-odk-project”.
Screen Shot 2015-07-29 at 8.45.48 AM.png
      1. Don’t check Master/Slave box.
      2. Click “Next”.
    1. Ready to Configure ODK Aggregate:  Click “Next”.
      1. Installs program where you told it to in applications folder
      2. Files will get configured
    2. Completing the ODK Aggregate Setup Wizard: Finish installation by clicking “Finish”
    3. Application window will open that asks you to enter the same Google username and password you used to create your App Engine instance. It should look like this:

odk1.png

Upload ODK Aggregate to your App Engine instance


Before you begin: Your Google account security settings will likely prevent the following steps from ending in success. You may need to turn off blocking access to less secure apps before proceeding:
Screen Shot 2015-07-24 at 3.30.27 PM.png
  • After you complete the steps below successfully, feel free to return to this page and turn off access.

Note: if you have 2-Step Verification enabled for your account then the “Less secure apps” settings is not available for you. In this case you have to generate and application-specific password (ASP) and use this special password instead of your account password. Here are the steps to generate an ASP:
  1. In the “Select app” dropdown pick “Other (Custom name)”.
  2. Enter a name like “ODK Aggregate”.
  3. Click “Generate”.
  4. Copy the generated app password and use in ODK Aggregate below.
  5. Once ODK Aggregate is uploading to App Engine you can click “Done” or close the browser tab.

Begin here:
  1. In the Application window,  enter the same Google username and password you used to create your App Engine instance.
  2. Enter your email account password and hit the “Upload” button.
  3. A command line should run for about 1 minute or less, ending with message: “Update completed successfully.”

odk2.png

  1. If the upload script fails, you can fix any errors and start it again by clicking on the UploadAggregratetoAppEngine.hta file in the ODK directory on your computer (this file should be in the folder your created as the directory to store your ODK Aggregate files).
  2. Double-check whether ODK Aggregate was successfully uploaded to your AppEngine instance. Go to <your project id>.appspot.com and log in.

Troubleshooting tip: If you haven’t installed Java correctly, this upload script will fail and you should get an error message indicating this. If so, please try reinstalling Java.

Optional: Set up Fusion Tables with Google Maps API credentials


If you’d like to be able to publish your ODK data to Google Spreadsheets or Fusion Tables, you will need to set up Google Maps API Credentials. If you only plan to export your data as CSV or KML, then you do not need to do this.

Note: There is also another, more detailed version of the below instructions at http://opendatakit.org/use/aggregate/oauth2-service-account/.

  1. Log into ODK Aggregate on App Engine.
  2. Click on the Site Admin tab, then click on Preferences in the sub-navigation.
  3. Click on the ODK Project for which you’d like to set up Google Maps API Credentials.
  4. Click on the “APIs & Auth” tab on the left sidebar, and click “APIs” beneath that.
  5. Using the search bar, search for “Drive API”.
Screen Shot 2015-07-24 at 3.43.48 PM.png
  1. Click on “Drive API” as it appears below the search bar.
  2. On the subsequent page, click the “Enable API” button.
Screen Shot 2015-07-24 at 3.44.43 PM.png
  1. Repeat this project for “Fusion Tables API” and “Google Maps JavaScript API v3”
  2. In the lefthand sidebar, click on “Credentials” under the “APIs & auth” section.
  3. Click “Create new Client ID” and select the “Service Account” option, then click “Create Client ID”. This action will download a JSON file to your laptop and notify you in a dialog box
Screen Shot 2015-07-24 at 3.47.28 PM.png
  1. A JSON file will download to your laptop and you’ll be notified of this in a dialog box. Click “OK” on the dialog box.
  2. Click “Generate new P12 key” button. A file will be downloaded to your laptop.
  3. Under Public API access, click “Create new Key” and then select “Browser key”, then “Create”.
  4. Leaving the Console open in a browser tab, go back to your Aggegate instance (i.e. earth-outreach-workshops.appspot.com) and make sure you are in Site Admin > Preferences.
  5. Click on the “Change Google API Credentials” button.
  6. Under the Google Simple API Key section, in the Simple API Key field, copy and paste your API key from the Console.
  7. Under the Google API Service Account Information section:
    1. Private key file (.p12 file): Select and upload the p12 file you just downloaded to your computer.
    2. Client ID: Find this under the Service account info in Console.
    3. Email address: Find this under the Service account info in Console.
  8. Click “Upload Google Credentials”.

12 comments:

  1. Yamaç Nakliyat firması olarak evden eve nakliyat, yük taşıma, eşya taşıma hizmetleri sunmaktayız.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Ankara çankaya nakliyat Çankaya evden eve nakliyat hizmeti ile taşınmak bir stres nedeni olmaktan çıkmaktadır.

    ReplyDelete
  5. Mamak nakliyat Mamak evden eve nakliyat firması olarak Ankara’nın her ilçesinde olduğu gibi Mamak ve bölgesinde de aktif hizmet vermekteyiz.

    ReplyDelete
  6. Karapürçek nakliye Karapürçek nakliye firmamız taşınma işlemi öncesinde her zaman en uygun fiyatları sunmayı tercih etmiştir

    ReplyDelete