In this recipe you will learn how to:
1. Create an IoT service.
2. Register a device to your organization.
3. Send and view sensor data!
There is also an accompanying video following the same steps.
Create an IoT Service
1. Open this link in a new tab: https://new-console.ng.bluemix.net/#overview
Note: If you have not yet created a Bluemix account you will need to do so. You may be prompted to log in.
2. Click on “Internet of Things”.
3. Click on “IBM Watson IoT Platform”.
4. Scroll down to the bottom, then click “Create”.
Registering Your Device
1. Click on “Launch dashboard”.
2. In IoT Platform, classes of devices are represented by “Device Types”.
Device Type are used to define attributes that are common to all devices of the same class.
Let’s define a “Device Type” first on the IBM Watson IoT Platform dashboard.
Click “DEVICES” tab, “Device Types”, then click on the “+ Create Type” button.
3. Click “Create device type”.
4. Specify a name for the device type to be added and optionally a description, then click “Next”.
5. Observe that a template page is given where you can select and define one or more attributes. All of these attributes are optional.
They will be used as a template for new devices that are assigned this device type.
Attributes that you do not define may still be edited individually later when you add the device.
You can define one or more attributes by selecting them then clicking next.
6. Click “Next” again.
7. (optional: Add Metadata) Click “Create”.
8. Observe your newly created device type. Now click “Browse”.
9. In the upper right click “+ Add Device”.
10. Select your device type from the drop down menu, then click “Next”.
11. Fill in the Device ID field, then click “Next”.
12. (optional: add metadata) Click “Next”.
13. On the next page, you can either add your own authentication token, or allow the IBM Watson IoT Platform to generate a token for you.
The IBM Watson IoT Platform generated token will be 18 characters long and will contain a mix of alphanumeric characters and symbols.
The token will be returned to you at the end of the registration process.
In case would like to create your own token, enter a token as shown below, then click “Next”.
14. As shown below, you will be given a summary page to verify the details before adding the device to IBM Watson IoT Platform. Verify and click “Add”.
15. At this step, the device is registered to your Organization and you will be provided with the registration details as marked below.
To get your device connected, you need to add the credentials to your device.
IMPORTANT: BE SURE TO KEEP A COPY OF THE ORGANIZATION ID, DEVICE TYPE, DEVICE ID, AND AUTHENTICATION TOKEN!!!
Note: If you have been following the tutorial so far your information will match below EXCEPT for your organization ID.
If you accidentally closed your window the org ID should be visible in the upper right hand corner of your device menu.
Note: You may repeat “Registering Your Device” to register multiple devices.
Send Sensor Data
1. Open the following link in a new tab: http://watson-iot-sensor-simulator.mybluemix.net/
This is a simulated sensor that is capable of sending temperature, humidity, and object tempearture data.
The value being sent can be changed by interacting with the web UI of the simulator.
This sensor connects to the IoT Platform and sends an ‘iotsensor’ event every 2 seconds while active.
Keep a tab or window open with the sensor to continue sending data.
2. Fill in the required information. The device token is your device’s unique authentication token. Click “Save changes”.
3. If your device is connected, the “connecting…” in the upper right corner should now be replaced by your device ID.
Leave this tab open to continuously send data.
Click your device ID to be brought to your dashboard, otherwise refresh the page and enter your information again.
4. Click “+ Create New Board” in the upper right.
5. Type in a Board name. Check the “Make this board my landing page.” box. Click “Next”.
6. Click “Create”.
7. Click on the newly created board. In this example “LIVE DATA”.
8. Click “+ Add New Card” in the upper right.
9. Scroll down and click on “Realtime chart”.
10. Select the device’s data that will be visualized. Click “Next”.
11. Click “Connect new data set” then click on each field. Fill in the name field.
Each field should present options when clicked, follow the example below. You may have to scroll down. Click “Next”.
Note: If the fields do not present an option when clicked, repeat steps 1 and 2 and leave the Simulated Sensor open in a window or tab.
12. This shows a preview of your cards appearance with real time data. Choose a size then click “Next”.
13. Enter a title, pick a color scheme, and click “Submit”.
14. Now you can view your data in real time! If you closed your simulated sensor earlier open this link in a new tab:
You can alter the temperature by clicking the up and down arrows, or click on the right or left sides to alter other data.
15. After altering the temperature values, take a look at your chart!
(optional) Try making another card, it is possible to display multiple data sets at once.