3. Register the devices
You must register the Raspberry Pi as a Gateway and the candle as a device in your IoT organization.
- Open a browser on your computer and navigate to the Watson IOT Platform.
- Select Devices.
- Click Add Device.
- Select the Gateway Type that you created in Lab 1.
- Click Next.
- Enter a unique device ID. The mac address for your PLAYBULB Candle must be unique.
- Click Next. Then, click Next
- Enter your token.
- Click Next. Then, click Add.
- Repeat the previous steps to add the PLAYBULB Candle as a device.
You should now have three registered devices. The Raspberry Pi, the SensorTag, and the PLAYBULB Candle.
- In your SSH terminal, edit the file device.json file.
- Enter the organization, type id, and auth-token from your IoT settings:
"auth-method" : "token",
"auth-token" : ""
- Set the org, type, id, and token that you used to register the candle.Now, when you start the app with the id of the PLAYBULB Candle, the app will listen to your Watson IoT organization for commands.
- Run the command to start publishing and listening to device commands coming from the IoT Platform targeted to the candle:
sudo node pipbiot.js
The application should connect to the Watson IoT Platform.
You are now ready to control the candle from your Bluemix Node-RED application.