This documentation is for WSO2 IoT Server 3.1.0. View the documentation for the latest release.
Page Comparison - Raspberry Pi (v.9 vs v.10) - IoT Server 3.1.0 - WSO2 Documentation

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. Sign in to the Device Management console.

    titleClick here for more information.
    Excerpt Include
    Accessing the WSO2 IoT Server Consoles
    Accessing the WSO2 IoT Server Consoles
  2. Click Enroll New Device.
  3. Click Raspberry Pi to enroll a device of the type Raspberry Pi.
  4. Connect the DHT11 Temperature Sensor and the LED to the Raspberry Pi board.

  5. Set up your Raspberry Pi device as shown in the schematic diagram. 


    Ensure that your Raspberry Pi Board is Internet enabled, either via Wi-Fi or Ethernet.

  6. Download the device agent.
    1. Click Download Agent.
    2. Enter a preferred name on the download agent form.
    3. Click DOWNLOAD NOW to download the device agent on your machine. If you select this option move to step 7.
      Click COPY LINK to directly download the agent to the Raspberry Pi board via the generated cURL command. If you select this option move to step 8.
  7. Unzip the downloaded agent file and copy the unzipped file onto your Raspberry Pi board.
  8. Navigate to the downloaded agent that is on the Raspberry Pi board.

    Code Block
    cd <RASPBERRY_PI_BOARD>/agent
  9. Test to confirm that the agent is working as expected.

    Code Block

    You can run the script on your local machine, on which the agent was downloaded.

    titleClick here to know more about testing the agent.

    Follow the steps given below to confirm that the agent is working as expected.

    1. You will be prompted to get the apt-get updates and continue. Enter Yes to get the updates or enter No to continue without the updates.
      Example: Continue without receiving the apt-get updates.

      Code Block
      Do you wish to run 'apt-get update' and continue? [Yes/No] No
    2. Enter the time interval that you require for the device to push data to WSO2 IoTS, in seconds.

      Example: Push data to the IoTS every 45 seconds.

      Code Block
      What's the time-interval (in seconds) between successive Data-Pushes to WSO2-IoTS (ex: '60' indicates 1 minute) > 45
    3. Run the test agent as a virtual agent. Enter Yes to run it as a virtual agent or enter No if you wish to run the test on the Raspberry Pi device itself.


      If the Raspberry Pi device is not connected to the IoT Server and if you enter No, you will run into errors as the server will not be able to find the device.

      Example: Running the agent as a virtual agent.

      Code Block
      Do you want to run this as a virtual agent? (Yes/No) Yes

    Once the virtual agent starts you can view the data being pushed to the IoT Server.


    Code Block
    RASPBERRY_STATS: Temp=25.0*C  Humidity=28.0%
    send: 'POST /raspberrypi/controller/push_temperature/ HTTP/1.1\r\nHost:\r\nAccept-Encoding: identity\r\nAuthorization: Bearer 88f4940a2c26ef2b7b5d02d2767182c7\r\nContent-Type: application/json\r\nContent-Length: 84\r\n\r\n'
    ~~~~~~~~~~~~~~~~~~~~~~~~ Pushing Device-Data ~~~~~~~~~~~~~~~~~~~~~~~~~
    send: '{"owner":"admin","deviceId":"1h7ldn73eha2f","reply":"","value":"25"}'
    reply: 'HTTP/1.1 204 No Content\r\n'
    header: Date: Wed, 20 Jan 2016 06:01:55 GMT
    header: Server: WSO2 Carbon Server
    RASPBERRY_STATS: Response Message
    Date: Wed, 20 Jan 2016 06:01:55 GMT
    Server: WSO2 Carbon Server
  10. Start and deploy the agent as a service on the Raspberry Pi board once you have tested the agent as explained in step 9.


    The registered service will be loaded on boot up.

    Code Block