Connect a Raspberry Pi to WSO2 IoT Server and manage it. The following subsections explain how you can work with the Raspberry Pi device type:
- A Raspberry Pi board that is Internet enabled (Wi-Fi or Ethernet).
- An Adafruit DHT11 temperature sensor.
- An LED bulb.
Start the Raspberry Pi
Sign in to the Device Management console.Click here for more information.
- Click Enroll New Device.
- Click Raspberry Pi to enroll a device of the type Raspberry Pi.
Connect the DHT11 Temperature Sensor and the LED to the Raspberry Pi board.
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.
- Download the device agent.
- Click Download Agent.
- Enter a preferred name on the download agent form.
- 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.
- Unzip the downloaded agent file and copy the unzipped file onto your Raspberry Pi board.
Navigate to the downloaded agent that is on the Raspberry Pi board.
Test to confirm that the agent is working as expected.
You can run the script on your local machine, on which the agent was downloaded.Click here to know more about testing the agent.
Follow the steps given below to confirm that the agent is working as expected.
You will be prompted to get the apt-get updates and continue. Enter
Yesto get the updates or enter
Noto continue without the updates.
Example: Continue without receiving the apt-get updates.
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.
Run the test agent as a virtual agent. Enter
Yesto run it as a virtual agent or enter
Noif 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.
Once the virtual agent starts you can view the data being pushed to the IoT Server.
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.
Try out the Raspberry Pi device
Once you start and deploy the Raspberry Pi agent you can try out the following actions:
|View device details|
Navigate to the Device Details page to view the device details, carry out operations and monitor real-time data.
|Control the bulb|
|Monitor real-time data|
Click View Device Analytics to monitor real-time data via the Device Details page.
Follow the options given below to see what you can do next.
Navigate to the Device Management page to view all the devices created by you.
- Select a device from your device dashboard and check the available operations and monitor real-time data.