Raspberry Pi is a credit-card-sized single-board computer. Because it is low-cost and easy to equip with various types of sensors, using Raspberry Pi as a cloud data logger is one of its ideal use cases.
You can import sensor data from Raspberry Pi into Treasure Data.
Raspbian is a free operating system based on Debian, optimized for the Raspberry Pi. Install Raspbian on your Raspberry Pi by following the instructions in the blog post below:
Install Treasure Agent (Fluentd)
Next, we’ll install Treasure Agent (Fluentd) on Raspbian. Raspbian bundles Ruby 1.9.3 by default, but we need the extra development packages.
We’ll now install Treasure Agent (Fluentd) and the necessary plugins.
Configure and Launch Treasure Agent
Prepare the fluent.conf file with the following information, including your API key.
Finally, launch Treasure Agent (Fluentd) via your terminal.
To test the configuration, just post a JSON message to Treasure Agent via HTTP.
If you're using Python, you can use python logger library.
Now, access the databases page to confirm that your data has been uploaded to the cloud properly.
You can now issue queries against the imported data.
For example, these queries calculate the average sensor1 value and the sum of sensor2 values.
Raspberry Pi is an ideal platform for prototyping data logger hardware. By combining Raspberry Pi and Treasure Data, we can easily analyze the physical world in the cloud.