4.2.2 Include a New Device

  1. Use the Chrome browser to open FBP editor: http://localhost:5000

  2. Enter the Device Management page to check the initial state

  3. Click the "Add Nodes" button to start including the IoT board for Master management. You should see the message stating Master is "ready to ADD".

  4. Open another terminal and use SSH command to connect to the IoT board.

     ssh root@<IP address of IoT board>
    
  5. After SSH is established, go to the folder of the Python WuClass on the IoT board.

     cd <path_of_source_code>/wukong-darjeeling/wukong/gateway/udpwkpf/
    
  6. Edit udpwkpf_io_interface.py and configure the device_type definition on line 12. If you use Intel Edison, configure this definition to be DEVICE_TYPE_MRAA. If you use Raspberry Pi, configure it to be DEVICE_TYPE_RPI. This definition will be further explained in the chapter 6.4.

  7. Run the device program udpdevice_blink_led.py. This Python program will start the device to receive a node ID from the WuKong gateway, and then the two WuObjects, Button and Light Actuator, residing on the device.

    python udpdevice_blink_led.py <IP address of Gateway> \
    <IP address of IoT board>:<arbitrary port number>
    

  8. Once Master has found the board (displaying the message as shown), stop the inclusion process.

  9. Check the device management list again by clicking the Discover Nodes button.

  10. Modify the device location and press the Set Location button to save it.

  11. Press the Details button to check the sensor profile of the Python device.