Pages: [1]   Go Down
Author Topic: ThingSpeak Client to Connect Arduino to the Internet  (Read 6136 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Internet of Things!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have created a tutorial on how to use the Arduino+Ethernet Shield and ThingSpeak. You can use it to data log on the web, see charts, connect a device to the internet, or even send status updates to Twitter.

http://community.thingspeak.com/tutorials/arduino/using-an-arduino-ethernet-shield-to-update-a-thingspeak-channel/

The sketch shows you how to send an HTTP POST to the ThingSpeak API. It's updated to use Arduino 22, the native String library, and includes a watchdog timer for the Ethernet Shield. When 5 failed transactions are detected in a row, the Arduino re-initializes the Ethernet Shield (soft-reset). This will not solve every lockup, but it will make the setup more stable.

ThingSpeakClient Sketch http://community.thingspeak.com/arduino/ThingSpeakClient.pde

Here's how you get started with the ThingSpeakClient sketch...
 
  • Sign Up for New User Account - https://www.thingspeak.com/users/new
  • Create a New Channel by selecting Channels and then Create New Channel
  • Enter the Write API Key in this sketch under "ThingSpeak Settings"

A ThingSpeak Channel can hold any type of data - sensor data (decimal and comma), binary data, serial strings... You can also send geo location information in dedicated location for mobile things. We just released an app you can install that allows you to send Twitter updates without doing OAuth on the Arduino side. The other part of ThingSpeak is that you can get data from a channel and start connecting things together.

We welcome anyone to try it out and looking for feedback as the service is new. The source code for the API will go up on GitHub and be open source once the kinks are worked out. The app is localized with language YML files, so you can even translate into pirate if you want. We hope this makes it easier to connect things to the web.
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How much do you folks expect to charge for this service when you come out of testing mode?
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 0
Posts: 11
Internet of Things!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I hope it's always in testing mode so that we keeping adding new features and keep it free. We are operating under the MySQL guidelines. Like I said, shortly the API source code will be on GitHub so you can fork on to your own server or put it on a shared host.

Do you have any ideas for it?
« Last Edit: February 15, 2011, 12:32:20 pm by ThingSpeak » Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Being able to save data over extended periods is my top item.  Comparing this year to last, this month to last, that kind of thing.  Also, being able to import data for the past so one can bring in older data.  Charts and stuff are cool, but if you don't have the data from the past you can't make comparisons.
Logged

Trying to keep my house under control http://www.desert-home.com/

0
Offline Offline
Full Member
***
Karma: 1
Posts: 111
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So this is basically a MySQL server, just wrapped up and easier to use???

I got my Arduino communicating with MySQL already, and writing to the database, just gotta make it look pretty and have PHP read from it.

Is that what your service is basically providing?? A PHP front end and MySQL database?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
Internet of Things!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you have the right idea ... there is a database component. It's a full web app with Charts, Apps, and Plugins that extend that base functionality - much like Wordpress is a PHP/MySQL front-end for blog posts with plugins. The goal is to make it easy and not have to run a local server if you don't want to or put this on a shared web host. An import tool is in progress so you can use the visualization tools if you have data already maybe from an SD card logger or something like that.

Sounds like you are making good progress with your project. Maybe they will link...
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 236
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

will this work without an ethernet shield? Just straight USB serial?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
Internet of Things!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you can use Processing or Python to pass serial data from the Arduino to ThingSpeak.

Here's a video from a user demonstrating it with Python:
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
Internet of Things!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all of the feedback over at our site.

Since we released, we have added many more features and tutorials. So, if it was no so clear a few months ago, I think you can see the direction that we are going.

Here's a link to the tutorials: http://community.thingspeak.com/tutorials/

The biggest addition to our apps is called ThingHTTP - which allows you to send a simple command to the app, then the app does the connection to the resource that you want to get or command. It also can parse the response so you don't have to have an XML or JSON parser on the arduino. We hope that it simplifies connections to web services and saves code space on the mcu.

We also released the API to GitHub, so you can roll your own "ThingSpeak" on your home network.

https://github.com/iobridge/ThingSpeak

Have fun!
Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
I’m no expert, but I play one on the Internet…
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

will this work without an ethernet shield? Just straight USB serial?

polishdude20,
I wrote a windows application that I call Seriot to communicate with an Arduino (or any other serial device) via usb/serial. The application logs the data to a file locally and optionally can send it to ThingSpeak. It's easy to configure and you can run it in several different modes depending on your needs.

You can read more and download it here:
http://nuewire.com/seriot/

willnue
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
there's no place like 127.0.0.1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks promising.
Will definately give it a try, now that I got my ethernet shield smiley

The things that I am interested in would be to
-store/view historical data of my setup.
-add alarm conditions to various signals that are monitored, and send notifications based on the alarm conditions.
-schedule actions / timed actions for home control etc (ie switching on the ligt at 7 am...)


Will get back to you when I test further smiley
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
there's no place like 127.0.0.1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again.

So I have had a go at gathering some temperature data, and storing them on ThingSpeak.
Works great, so far... (except that for some reason, it stopped logging at 04:00 this morning)... anyway.   smiley-fat

If the developers over at ThingSpeak are listening in, I have a feature request:

Add a display, that will only show the latest reading from the chart/field. -and display it as a number in a little neat box (no graph).
That way, for any stored data on ThingSpeak, it would be possible to see the historical data, and also the most current value.

The same idea for digital values: make a text display, where you can assign some text for each value. Example: 0 = off  /  1 = on   etc...
That way it would be really easy to build up a webpage, and include all the info from ThingSpeak, to show current and historical status of whatever is monitored.


Nice service by the way  smiley-cool
Logged

USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
I’m no expert, but I play one on the Internet…
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Spumanti,
You can use the ThingSpeak API to get the last value for a given channel.
Quote
Retrieving the Last Entry in Channel Feed
Method: POST or GET
Feed URL: http://api.thingspeak.com/channels/(channel_id)/feed/last.(format)

For example to get the last value of my Outdoor temperature sensor (public channel #233) click the following link:
http://api.thingspeak.com/channels/233/feed/last

You could use some Javascript to go get the last value then parse the result and format it however you like on your web page. Note, if you don't want to make your channel public you can also generate a Read API key and pass that to the API. Check out the ThingSpeak API docs for more info:
http://community.thingspeak.com/documentation/api/

You could also use one of their existing plugins to render a Google Gauge. See the following post for more info:
http://community.thingspeak.com/tutorials/google/display-a-google-gauge-visualization-using-thingspeak-plugins/

willnue
Logged

Pages: [1]   Go Up
Jump to: