3. Register the devices

You must register the Raspberry Pi as a Gateway and the candle as a device in your IoT organization.

  1. Open a browser on your computer and navigate to the Watson IOT Platform.
  2. Select Devices.
  3. Click Add Device.
  4. Select the Gateway Type that you created in Lab 1.
  5. Click Next.
  6. Enter a unique device ID. The mac address for your PLAYBULB Candle must be unique.
  7. Click Next. Then, click Next
  8. Enter your token.
  9. Click Next. Then, click Add.
  10. 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.

  11. In your SSH terminal, edit the file device.json file.
  12. Enter the organization, type id, and auth-token from your IoT settings: 
    {
      "org": "",
      "domain": "internetofthings.ibmcloud.com",
      "type": "Playbulb",
      "id": "",
      "auth-method" : "token",
      "auth-token" : ""
    }
  13. 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.
  14. 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.