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.
Beginner
This example will focus on writing Squirrel code. Please visit the Getting Started Guide on the Electric Imp Dev Center to learn how to configure your device with BlinkUp™ and how to use the Electric Imp IDE, impCentral™.
- How to update agent code to send data to multiple cloud services.
- Your WiFi network name (SSID) and password (not needed for cellular with imp006 or impC001).
- A computer with a web browser.
- A smartphone with the Electric Imp app (iOS or Android) installed.
- A free Electric Imp Developer Account.
- A free Initial State Account.
- An IBM Bluemix account.
- One of the imp hardware boards listed below:
- Follow the first six instructions in Example 3 to get the device code running.
- 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.