GroveStreams Digi Cloud - Quick Start


This tutorial will walk through the creation of a GroveStreams user account, an organization, and the configuration of a Digi Command Monitor. The Command Monitor will push data from the Digi Device Cloud into your GroveStreams organization. Configure it to monitor the DataPoint event.



Step 1: Create a Free GroveStreams User Account and Organization

Open a browser and navigate to the GroveStreams registration page and sign up:
GroveStreams - Create User Account

Log into GroveStreams after creating your free user account.

You will be prompted to create an organization. Select Yes:
GroveStreams - Create Organization


What's an Organization?
An organization is a Workspace, typically representing a home, business, or organization. Each organization has its own set of components, streams, dashboards, maps, and other items. An organization allows you to control user and device access to the organization. You are automatically the "owner" and given full access rights when you create an organization. Other users may invite you to their organizations with rights they give you. All of the organizations, you "own" or are a member of, will appear in your GroveStreams start page (the first page that appears when you sign in).


Enter a name for the new organization. It can be any name. Click Create Organization:
GroveStreams - Create Organization

Enter your new organization by clicking on its name:
GroveStreams - Create Organization

The API Key, that the Digi Monitor will need to send data to the GroveStreams organization, can now be retrieved. The API Key is needed later in the tutorial:
GroveStreams - API Key

To find your Secret API Key:
1. Select the Admin - API Keys menu option and choose the Feed Put API Key (with auto-registration rights) key
2. Click View Secret Key
3. Select and copy the API Secret Key to the clipboard (Ctrl-c) when you are ready to paste it below.


Step 2: Create the Digi Monitor Command

Follow Digi's instructions to create a Monitor web service to monitor Device Cloud activity and push data to GroveStreams.

Digi to GroveStreams Monitor Example:
					
<Monitor>
   <monTopic>DeviceCore,XbeeCore</monTopic>
   <monTransportType>https</monTransportType>
   <monTransportUrl>https://grovestreams.com/api/gtw/dgi/api_key/data</monTransportUrl>
   <monTransportToken>x:x</monTransportToken>
   <monTransportMethod>PUT</monTransportMethod>
   <monFormatType>json</monFormatType>
   <monBatchSize>100</monBatchSize>
   <monCompression>none</monCompression>
   <monBatchDuration>10</monBatchDuration>
</Monitor>
				
Important! Replace api_key with the api_key copied from above.
  • monTrasnportType: Use either http and https.
  • monTrasnportToken (uid/pwd) is ignored by GS so put anything in there like x:x.
  • monTransportUrl: Replace the GS secret api_key between dgi and data. Append ?compTmplId=your_component_template_id onto the end of the URL to utilize component templates.
  • monCompression: We support gzip compression. Not sure what Digi is doing. You can try with and without compression to see if it works.
Our Digi gateway logic queues up PUTs and blasts them into GS every 10 seconds so it will take a few seconds for the sample to arrive in GS. We do this to respect the GS 10 second upload limit per source IP. The source IP is a Digi Cloud Server.

Your component will land under the Components folder in Observation Studio. Refresh that folder to see if it has registered.


Congratulations! You have successfully created a Digi Cloud Command that uploads measurements into GroveStreams.


Click on the Dashboards tab to create dashboards and maps. Right click on the component and choose Edit Component to set your component's location, add stream units, create events with notifications, and change other properties. Keep exploring and learning!

Continue with the GroveStreams Temperature Example to learn more about how to make the most of your data with GroveStreams.

How it Works

The Digi Cloud pushes data to GroveStreams as it arrives.

The data sent to GroveStreams arrives in Digi's cloud JSON format. The JSON includes the sample data, sample time, and several keys so that GroveStreams knows where to store the data being sent:
  • api_key: This is included as part of the URL above and is your secret API key. It tells GroveStreams which organization the data will be inserted into and ensures the caller has the proper rights to make the call.
  • id: This is the ID of a component within your GroveStreams organization that contains the stream that the data will go into. Component IDs need to be unique within an GroveStreams organization.
  • streamId: This is the ID of the component stream which is used to place the data into. Stream IDs only need to be unique within each component.
  • data: The sample data.
  • timestamp: The sample date and time.
GroveStreams detected that a component did not exist with the included component ID (the Digi id of the device) the first time the Command pushed data to GroveStreams. GroveStreams then created a new component and placed the sample data within a stream.

This example was made simple by allowing GroveStreams to create a default component with default streams. GroveStreams will do its best to determine if the stream type is a number, text, or boolean based on the first sample arriving. Users can view or modify existing component definitions by right clicking on them and selecting Edit Component. Modify any component attributes except the component and stream IDs. Consider using component templates to avoid having to edit every component after it registers.

Troubleshooting

Successful API calls to GroveStreams should return a status of: HTTP/1.1 200 OK.

If the call made it to a GroveStreams server, but an error still occurred, a GroveStreams system notification will be created that contains the error. While in the GroveStreams organization's Observation Studio, click on the Notifications button located in the top toolbar (It looks like an envelope) and select the System tab. Click Refresh to list new notifications.

Any parameter that is part of the URL within the Command needs to be URL encoded. This should only become an issue if you have given any parameters a value with reserved URL characters (such as spaces or commas). There are many free URL encoders on-line that you can use to encode your URL or URL parameters such as freeformatter.com.

Ensure you are not using the same API Secret Key for different organizations. API Secret Keys are only associated with the organization they have been created within and can only be used for that organization.

Having problems or you wish to modify the solution and are not sure what to do?

Post a question on our forum or send us an email and we'll do our best to help you out: support@grovestreams.com


Helpful Links

GroveStreams Temperature Example
GroveStreams Help Center
GroveStreams Simple Feed PUT API
GroveStreams Forum
Digi Transport Protocol
Digi Monitor