/XivelyRead

A simple example of how to read a Xively feed from MATLAB

Primary LanguageMatlabGNU General Public License v3.0GPL-3.0

XivelyRead

An example of how to read a Xively feed from MATLAB. Xively promotes the IoT (Internet of Things) provinding a platform for easily uploading and accessing data. There are libraries for a variety of languages, but apparently not for MATLAB. However, they offer a REST API.

Requirements

Assuming that you have read the API docs and got a master key with reading permissions, you can access any public feed along with your own private feeds. In order to use the key, save it in a matfile like this:

key = 'YOUR_KEY_HERE';
save('key.mat','key');

The script can work as standalone, but I've used two libraries from the MathWorks Matlab Central which you can either download (their URLs are included in the source) or disable.

Tip: Browse Thingful for relevant feeds near you!

Example result

This example script gets CPU load and CPU temperature from a Raspberry Pi (you can see a tutorial on how to connect a Pi to Xively here) and uses it to plot a figure of the increasing of temperature over time, taking into account only datapoints where the CPU load was low:

Result

Licensing

This script is licensed under GPL v3.