Skip to main content

Adding Further Cloud Services To The Simple Remote Monitoring Application

An Introduction To Squirrel Applications Example 9

In this example we will use the device code from example 3, but adapt the agent code to send data to an additional cloud service, IBM Watson IoT.

Skill Level

Beginner

This example will focus on writing Squirrel code. Please visit the Getting Started Guide to learn how to configure your device with BlinkUp™ and how to use the Electric Imp IDE, impCentral™.

What You Learn

  • How to update agent code to send to multiple cloud services.

What You Need

Instructions

  • Follow the first six instructions in example 3 to get the device code.
  • Copy and Paste the Agent Code in this folder into the Agent Code pane in the impCentral code editor.
  • Configure Initial State:
    • Sign into Initial State.
    • Find your Streaming Access Key on the My Account page
    • Navigate back to impCentral.
    • In the Agent code enter your Streaming Access Key into the runtime constant IS_STREAMING_ACCESS_KEY
  • Configure IBM Watson IoT:
    • Watson IoT takes quite a bit more setup. Follow the instructions here to get the keys you will need from Watson IoT.
    • Copy and paste your API_KEY, AUTH_TOKEN and ORG_ID into the runtime constants WATSON_API_KEY, WATSON_AUTH_TOKEN and WATSON_ORG_ID.
  • Hit the Build and Force Restart button to start the code.
  • Use the cloud services to visualize your data.

Code

Agent Code