Deploy the Application
Click the button to deploy the sample application:
Examine and Modify the Flows
The flows have been built in a very simple, easy to understand way that should allow for easy extension.
There are two flows – SimulatedSensorTag and SensorTag.
Simulated Sensor Tag
This flow is a simple example that demonstrates how to use the Watson IoT Device Simulator nodes to:
- Create Device Types and Devices on Watson IoT Platform
- Create Simulated Device Instances, change their data values and have them send events with those values into the platform
The Device Type created is “SimulatedSensorTag” and the flow allows the creation of two simulated devices ‘Room1’ and ‘Room2’
Everything is done manually using inject nodes on the flow. Press the inject buttons to create device types and devices in the platform – and then create a simulated device and have it send an event into the platform.
This flow simulates a real Sensor Tag – the Device Type created is “SensorTag” and a UI is provided to allow the creation of a Simulated Sensor tag. In this sample only the objectTemp and light values are simulated – but the flow could easily be extended to simulate other sensor values. The actual values sent into the IoT Platform can be randomly generated or manually set using the UI. With the exception of creating the Sensor Tag device type which is done on the flow, everything is done on the UI.
Note that the flow allows for the data to be sent using the Watson IoT node – which acts as a Device and will therefore need to be configured with the Platform credentials – or using the ibmiot node which represents an application sending the data on behalf of a device and therefore does not require credentials.
Edit the Configuration Nodes (Menu > Configuration nodes)
Edit the Device ST1 configuration node:
In the Organization field, type the organization id of your Watson IoT Platform (see below if you do not know how to find this)
In the Auth Token field, type 12345678
Tip: If you want to use a different token you can but you must modify the Add Devce ID nodes for ‘Create Device’ and ‘Delete Device’ as these currently use 12345678
TIP: You can find the organization id by opening your Watson IoT Platform service dashboard:
Click Create Sensor Tag Type:
Examine and use the UI
The UI is available at yourAppURI/ui
In the Device Management section, type ST1 into the Device Name field (you can use any name you like but the device name in Watson IoT node must be the same – on deployment that node is set to ‘ST1’).
Click Create Device
Click Create Device Instance
Click Random Values
Click Send to Cloud
View data coming into Watson IoT Platform: