Unit 4: Posting the Measurement Points to EnOS


When the Raspberry Pi has successfully connected to EnOS, its device measurement points can be posted.

Step


  1. Navigate to the RPI-python directory:

    cd rpi/RPI-python
    
  2. Run the sample code:

    python3 main.py
    
  3. Sample response:

    16:37:16: Starting up
    16:37:16: Registering in DPS
    16:37:17: Device credentials generated
    16:37:17: Connecting to client
    ---------------------------------------------------------------------------
    16:37:18: Temperature:29
    16:37:18: Humidity:60
    16:37:18: Light Intensity:621
    16:37:18: Measurementpoints posted on IoTHub successfully
    ---------------------------------------------------------------------------
    16:37:28: Temperature:28
    16:37:28: Humidity:65
    16:37:28: Light Intensity:609
    16:37:28: Measurementpoints posted on IoTHub successfully
    ---------------------------------------------------------------------------
    

Results


  1. After successfully connecting, the Raspberry Pi’s Connectivity Status will change from Not connected to Connected and Allocation Status will change from Not allocated to Allocated.

  2. It will also appear in the list of devices in Device Management > Device Assets.

  3. To see the posted measurement point data, click its View icon and click the Measurement Points tab.


    ../../_images/results.png