Chungnam National University Computer Science and Engineering Database System Laboratory

ThingSpeak-Open Source Platform for Connected Products and Services

2012년 8월 29일

임형준([email protected]) 충남대학교 컴퓨터공학과 데이터베이스시스템연구실 TOC

 ioBridge, Inc.

 ThingSpeak

■ Goal

■ Features

■ Apps

■ Plugins

■ Devices

 Conclusion  References

Chungnam National University 2 Computer Science and Engineering Database System Laboratory ioBridge, Inc.

 ioBridge, Inc. offers technology and services that enable almost anything to be Web-enabled and monitored and controlled over the Internet

■ http://www.iobridge.com

 ioBridge's technology includes a Web services platform that customers can use to extend the technology of many applications

 ioBridge provides OEM and commercial integration services and licensing of core, patent-pending technologies

Chungnam National University 3 Computer Science and Engineering Database System Laboratory ioBridge, Inc. Labs[1/4] - CheerLights

 Imagine millions of lights connected together

■ http://www.cheerlights.com/  CheerLights is a project that enables people all around the world to link lights and applications together based on social networking trends  To control CheerLights, send a tweet to @cheerlights or include “cheerlights” somewhere in your message with the name of a color

■ Example Tweet: @CheerLights Paint the town red

Chungnam National University 4 Computer Science and Engineering Database System Laboratory ioBridge, Inc. Labs[2/4] ‒ Tide Alerts

 Tide Alerts is a project developed by ioBridge to monitor and report tide levels in real-time using low-cost, battery-powered sensors connected to ioBridge cloud services

■ http://tidealerts.com/

 Users can see current and historical charts, contribute their own data, and set customizable email notifications so you know exactly when to get your boat back to the dock without getting stuck in low water levels

Chungnam National University 5 Computer Science and Engineering Database System Laboratory Ockway Bay Tide Levels

Chungnam National University 6 Computer Science and Engineering Database System Laboratory ioBridge, Inc. Labs[3/4] - ioAuth

 The will not be complete without a comprehensive security model

 ioAuth is a set of open standards that involve how devices and systems authenticate to web services

 We are used to the model of signing into a website or authenticating with an API

 Devices require the same architecture

■ ioAuth is OAuth for "things" (specification coming soon)

Chungnam National University 7 Computer Science and Engineering Database System Laboratory ioBridge, Inc. Labs[4/4] - ThingSpeak

 ThingSpeak is an open source "Internet of Things" platform for storing and retrieving data using HTTP commands

 ThingSpeak also includes a suite of applications designed for making "social things“

 This cloud service is open to anyone and can be used with many devices, robots, and things

Chungnam National University 8 Computer Science and Engineering Database System Laboratory ThingSpeak

 ioBridge, Inc. releases ThingSpeak (April 18, 2011)

■ The first open source solution for "Internet of Things" products and services – Much like WordPress allows people to create blogs easily

■ ThingSpeak (http://www.thingspeak.com) allows developers to interact with devices using standard Web technologies

■ ThingSpeak can be run via its free hosted service or on personal servers

Chungnam National University 9 Computer Science and Engineering Database System Laboratory ThingSpeak Goals

 "Our goal is to take some of the mystery out of connecting devices to the Web," said Hans Scharler, President of Software at ioBridge.

 Everyone is discussing the as if it's in the future, but cell phones are the perfect blend of things, social interaction, and the Web

■ I think of mobile devices as sensor platforms and gateways to Web services

Chungnam National University 10 Computer Science and Engineering Database System Laboratory Internet of Things Devices

 Range from microcontrollers to computers  Need to be able to push data to Web Services  They might push “a lot” of data  Open Data + Thing Data = Web of Things

 ThingSpeak App Platform

Chungnam National University 11 Computer Science and Engineering Database System Laboratory ThingSpeak Features [1/4]

 Features of the ThingSpeak platform include data logging, data processing, data distribution, location-based services, status updates, social network integration, apps, and plugins

 All-purpose Data Storage and Retrieval

■ Data Storage – You use ThingSpeak to Send and Receive "data" via simple HTTP requests, much like going to a web page and filling out a form – Data can be from anything - Blood Sugar Levels measured by a glucose meter, Server Usage and Uptime reported by servers, or Location Info from a mobile phone – Once the data is in ThingSpeak, you can build applications that retrieve the data, use the data for process decision making, and reporting

■ Data Retrieval – Data is stored in a ThingSpeak Channel – Each channel allows you to store up to 8 fields of data up to 255 alphanumeric characters

Chungnam National University 12 Computer Science and Engineering Database System Laboratory ThingSpeak Features [2/4]

 Data Importing

■ Do you already have a bunch of data collected from data acquisition devices, server logs, or sensors?

■ Then you can use the ThingSpeak Importer to bring in your existing data and leverage the ThingSpeak API and Charts to share with and connect to applications instantly.

 Dynamic Charting

■ When you need to visualize your data, ThingSpeak has dynamic charts and an API to make customizations

■ The charts are perfect for displaying sensor data over time and finding some meaning behind the data

 Data Processing

■ When pulling data out of ThingSpeak, you can process the data to get it ready for your application

■ You can also filter the data by setting minimum and maximum value thresholds

■ Processing options include time scaling, summing, averaging, and median

Chungnam National University 13 Computer Science and Engineering Database System Laboratory ThingSpeak Features [3/4]

 Integration with

■ Often enough you will find times where you want to share significant data across social networks like Twitter

■ You can have your garage door Tweet, "You left your garage door open" or have your house, say "Today's Power Use was 6150 watts.“

■ The ThingSpeak API has Twitter baked in, so you can send status updates to Twitter along with storing your data in a ThingSpeak Channel at the same time

 Fully Localized

■ ThingSpeak supports over 40 time zones and time offsets for locations that support Day Light Savings

■ When charts and data are presented to users, we format times and dates using the viewer's time zone

Chungnam National University 14 Computer Science and Engineering Database System Laboratory ThingSpeak Features [4/4]

 Privacy Options for Open Data

■ You can choose to make your data public or private

■ Over 95% of ThingSpeak Channels are private meaning that the data is not publicly accessible without API keys and user authentication

■ You can control who has access to your data and build applications that are open to those that you choose

 Open Source API and Web App

■ https://github.com/iobridge/ThingSpeak

Chungnam National University 15 Computer Science and Engineering Database System Laboratory ThingSpeak Apps

 Integrated Web Apps

■ ThingTweet – Link your Twitter account to ThingSpeak and send Twitter messages using our simple API

■ ThingHTTP – Low-level access to high-level web resources – Create custom POSTs or GETs to other Web Services and retrieve the data

■ TweetControl – Listen to commands from Twitter and then perform an action

■ React – Perform actions when conditions are met by your data in your channels

Chungnam National University 16 Computer Science and Engineering Database System Laboratory ThingHTTP - Google Weather Tutorial

 Parse Weather Data from Google Weather with ThingHTTP

■ ThingHTTP can be used by a microcontroller to send HTTP requests and then parse the response

■ This is useful so you do not have to take code space, which is limited, away from the microcontroller

■ This tutorial shows you how to create a ThingHTTP request to Google Weather and parse out just the current temperature from the XML response

Chungnam National University 17 Computer Science and Engineering Database System Laboratory Plugins

 Display a Google Gauge Visualization using ThingSpeak Plugins

■ This tutorial shows you how to use a Google Visualization inside of ThingSpeak Plugins

■ We will be the Google Gauge visualization to display the last value of a ThingSpeak channel

■ We will be using jQuery to get and parse JSON from the feed

■ The Google Gauge also auto updates with the latest value using JSONP

Chungnam National University 18 Computer Science and Engineering Database System Laboratory Devices

 The Devices tab in ThingSpeak is a place to store information about your devices such as an , Netduino, mBed, Spinneret, or an ioBridge device

■ The information you can store is name, model, public IP address, and public port number

■ The IP and port number will be used for a future dynamic DNS app and are optional

Chungnam National University 19 Computer Science and Engineering Database System Laboratory Featured Channels

Chungnam National University 20 Computer Science and Engineering Database System Laboratory my_house Channel

Chungnam National University 21 Computer Science and Engineering Database System Laboratory Social Sensor Network

 The first commercial application to be built on ThingSpeak is the Social Sensor Network

■ http://www.socialsensornetwork.com

■ This application makes use of people as sensors by allowing users to report and share any data on a social channel via a web browser

■ The data is processed and presented in a meaningful way

■ All of the data is open and available so other developers can make use of it

 Web and mobile app used to collect data that sensors can not sense

■ “It’s hot in here” / “Lots of ladies here”

Chungnam National University 22 Computer Science and Engineering Database System Laboratory ThingSpeak ‒ Open Source

 Before You Begin

■ 1. Install Ruby, RubyGems, Rails 3, git, and a database like MySQL

■ 2. Download the application using git: git clone [email protected]:iobridge/thingspeak.git

■ 3. Change to the thingspeak directory and install the appropriate gems: sudo bundle install

 Configuration

■ 1. Set your database configuration file at config/database.yml (see config/database.yml.example for an example)

■ 2. Create the database: rake db:create

■ 3. Create the database tables: rake db:schema:load

 Run The Application

■ 1. Start the server: rails server

■ Your application will now be running at http://localhost:3000/

Chungnam National University 23 Computer Science and Engineering Database System Laboratory Cosm (Pachube is now Cosm)

 Cosm is everything you know and love about Pachube, with more power to connect and build the Internet of Things today

■ https://cosm.com/

■ Connect devices and apps on the Cosm platform, exchange data and ideas with developers, and bring smart products to the world

Chungnam National University 24 Computer Science and Engineering Database System Laboratory References

 [1] Hans Scharler, “ThingSpeak: Open Source Platform for Connected Products and Services”, ioBridge, Inc., April 18, 2011.  [2] ThingSpeak, https://www.thingspeak.com/  [3] ioBridge, http://connect.iobridge.com/  [4] Cosm, https://cosm.com/

Chungnam National University 25 Computer Science and Engineering Database System Laboratory