ThingSpeak Communication Library for Arduino | Arduino | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
ThingSpeak Communication Library for Arduino
Avatar
Rob Purser
Natick, MA

Forum Posts: 46
sp_UserOfflineSmall Offline
1
August 22, 2015 - 3:44 pm
sp_Permalink sp_Print

We've created a Arduino library to connect your Arduino to ThingSpeak. You can set up the new ThingSpeak Communication Library for Arduino in about 60 seconds from within the Arduino IDE, and try out the examples right away! You can read and write with just 1 line of code!

See the 60 second video:

Send us your feedback!
-Rob

Senior Development Manager for IoT and Hardware Interfacing for MATLAB at MathWorks.  Visit ThingSpeak.com to explore the IoT Analytic platform that speaks MATLAB made for engineers and scientists.  You can collect, analyze, and act in 5 minutes or less!

Avatar
mdahlb

Silver
Forum Posts: 10
sp_UserOfflineSmall Offline
2
August 28, 2015 - 8:49 am
sp_Permalink sp_Print

Hello Rob!

Great that there is a Library for Arduino that connect to ThingSpeak! But when I try to add the library in "manage library" I can't find ThingSpeak when I use the filter? I follow every step in the video but still nothing.. Will try again later!

Best regards
Mattias

Avatar
Rob Purser
Natick, MA

Forum Posts: 46
sp_UserOfflineSmall Offline
3
August 28, 2015 - 12:22 pm
sp_Permalink sp_Print

I've found that sometimes the Arduino IDE caches this info, and then doesn't always update. Assuming you're using windows, if you go to the AppData/Arduino15 directory, there's a file called library_index.json. Quit the Arduino IDE, delete that file, and start it up again, and you should be all set.

On my computer, this file is at:
C:\Users
purser\AppData\Roaming\Arduino15

-Rob

Senior Development Manager for IoT and Hardware Interfacing for MATLAB at MathWorks.  Visit ThingSpeak.com to explore the IoT Analytic platform that speaks MATLAB made for engineers and scientists.  You can collect, analyze, and act in 5 minutes or less!

Avatar
mdahlb

Silver
Forum Posts: 10
sp_UserOfflineSmall Offline
4
August 30, 2015 - 2:57 pm
sp_Permalink sp_Print

Thank you for your reply! I will check this tomorrow and get back to you regarding the library! Thank you very much! =))

Regards
Mattias, Sweden

Avatar
mdahlb

Silver
Forum Posts: 10
sp_UserOfflineSmall Offline
5
September 10, 2015 - 8:20 am
sp_Permalink sp_Print

Hello again!

I actually haven't had any success with the ThingSpeak library for Arduino yet. I have installed the library and trying the "WriteVoltage" example. I'm using an Arduino Uno R3 with a Wifi Shield. I started by "uncomment the line below" in order to use the Wifi Shield. I have checked the ssid and password and the Arduino connects to my network. The channelnumber and writeAPIkey is correct and I even tried to change between "public channel" and "private channel" in ThingSpeak but without any succes. I have attached a 3 V to A0 but there is no reaction at my ThingSpeak Channel. I can update the channel by a HTTP Post request but not from my Arduino.

Any suggestions?

Best Regards
Mattias

Avatar
hans

Forum Posts: 4
sp_UserOfflineSmall Offline
6
September 10, 2015 - 9:42 am
sp_Permalink sp_Print

Mattias,

The 'WriteVoltage' example is hard coded to read analog input from pin 0.

See line 89:
https://github.com/mathworks/thingspeak-arduino/blob/master/examples/WriteVoltage/WriteVoltage.ino#L89

You can add a print statement after this line to determine if the sensor value is being read correctly.

Avatar
Rob Purser
Natick, MA

Forum Posts: 46
sp_UserOfflineSmall Offline
7
September 10, 2015 - 11:48 am
sp_Permalink sp_Print

Have you gotten the standard wi-fi shield examples working? I have found that I had to get them working, first, and I found I had to upgrade the firmware on the wi-fi shield as well. To say the least, my experience with it has been mixed.

-Rob

Senior Development Manager for IoT and Hardware Interfacing for MATLAB at MathWorks.  Visit ThingSpeak.com to explore the IoT Analytic platform that speaks MATLAB made for engineers and scientists.  You can collect, analyze, and act in 5 minutes or less!

Avatar
mdahlb

Silver
Forum Posts: 10
sp_UserOfflineSmall Offline
8
September 30, 2015 - 4:43 am
sp_Permalink sp_Print

The problem is solved! Thanks for the help! I updated the firmware for the Wifi shield and now it works perfectly! The Library is great, just one line of code to update the ThingSpeak channel!

Perfect! =)

Avatar
AYAduino

Silver
Forum Posts: 9
sp_UserOfflineSmall Offline
9
October 10, 2015 - 11:27 am
sp_Permalink sp_Print

Is there support for writing to the Status field? I had a quick look through the library/tech reference but didn't see any mention.

Brad

Avatar
Rob Purser
Natick, MA

Forum Posts: 46
sp_UserOfflineSmall Offline
10
October 10, 2015 - 7:32 pm
sp_Permalink sp_Print

Hi Brad,

There's no direct support for the status field, but now that you've asked for it, I'll work on that. For now, you can use the "writeRaw"function to write fields that aren't directly supported.

-Rob

Senior Development Manager for IoT and Hardware Interfacing for MATLAB at MathWorks.  Visit ThingSpeak.com to explore the IoT Analytic platform that speaks MATLAB made for engineers and scientists.  You can collect, analyze, and act in 5 minutes or less!

Avatar
AYAduino

Silver
Forum Posts: 9
sp_UserOfflineSmall Offline
11
October 13, 2015 - 8:19 pm
sp_Permalink sp_Print

Thanks Rob!

Avatar
JolynLaub
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
12
November 5, 2015 - 10:46 am
sp_Permalink sp_Print

I am the new user with the Arduino and want to learn more and more about it.
Can you please tell me something more about this library?
I want to know which type of library is it and which type of data type and keywords it contains?
Also is it compatible with all the Arduino hardware?

Avatar
mpo881
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
13
November 9, 2015 - 1:44 pm
sp_Permalink sp_Print sp_EditHistory

Rob,
I am interested in using thingspeak and twitter to send me a tweet when a condition changes (Trigger a reaction-Turn off that Humidifier! It's above 60). I have been trying to follow along with the community ThingTweet here;

http://community.thingspeak.com/tutorials/arduino/update-twitter-with-thingtweet-and-arduino-ethernet-shield/

I downloaded the code here;

https://github.com/iobridge/ThingSpeak-Arduino-Examples/blob/master/Ethernet/Arduino_to_ThingTweet.ino

and replaced String thingtweetAPIKey = "XXXMX2WYYR0EV68M"; with the API key that was generated when I linked my twitter account to thingspeak. I have also added the thingspeak library to the sketch, #include

The sketch compiles and loads. However when I open the serial monitor I see

Connecting Arduino to network...
Arduino connected to network using DHCP
Connecting to ThingSpeak...

and then that's it. According to the sketch I would expect to see that the connection failed. No matter what I have tried, I get the same results! Possibly you could offer some insight? I am using an arduino mega 2560 r3, with an arduino PoE ether shield (although I am not using a PoE port) using Arduino 1.6.5. I am able to connect to the web with a different sketch using Temboo and the same hardware and am able to send myself an email (via gmail).

Any help you can provide would be appreciated.

Sincerely
Brian

Avatar
hans

Forum Posts: 4
sp_UserOfflineSmall Offline
14
November 10, 2015 - 1:33 pm
sp_Permalink sp_Print

mpo881,

The 'ThingSpeak and MATLAB Tutorial' Documentation section covers a similar workflow to what you have described. The tutorial covers how to create a Channel, how to write data to the Channel, how to analyze the Channel data using MATLAB and how to perform actions when data conditions are matched.

From the description, it appears that data from the Arduino is being sent to ThingSpeak. If so, you can skip to the 'Act' section of the tutorial which "shows how to send a tweet when your dew point data exceeds 60°F using ThingTweet and React apps."

https://thingspeak.com/docs/tutorials#act

To summarize the major points:

1. Attach Twitter Account using the ThingTweet app
2. Create a React app with the appropriate condition and the action 'ThingTweet' with the message to tweet.

Avatar
Rob Purser
Natick, MA

Forum Posts: 46
sp_UserOfflineSmall Offline
15
December 28, 2015 - 8:07 am
sp_Permalink sp_Print

Hi all,

Version 1.1.0 of these libraries now supports ESP8226 devices, the Particle Electron (coming soon!).

You can use these libraries directly from within the Arduino and Particle IDEs.

All the best,
-Rob

Senior Development Manager for IoT and Hardware Interfacing for MATLAB at MathWorks.  Visit ThingSpeak.com to explore the IoT Analytic platform that speaks MATLAB made for engineers and scientists.  You can collect, analyze, and act in 5 minutes or less!

Avatar
homerruma

Silver
Forum Posts: 8
sp_UserOfflineSmall Offline
16
January 23, 2016 - 11:19 am
sp_Permalink sp_Print

hello esp8266 real name Module

Avatar
pljevljak
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
17
February 3, 2016 - 10:02 am
sp_Permalink sp_Print sp_EditHistory

Hi, I couldn't find information what pins are defined by your library for RX and TX pins of ESP8266? I am using ESP8266 breakout (ESP-01).

Avatar
wheato22

Silver
Forum Posts: 8
sp_UserOfflineSmall Offline
18
February 24, 2016 - 11:43 pm
sp_Permalink sp_Print

As a new user I need help in finding an appropriate Example for Aurdino with an Ethernet Shield. My intended application is to use ThingSpeak to log the exact time and date of pulses that are created by my water flow rate sensor. Each pulse from my sensor indicates one gallon of flow. I intend to use the reed switch in the meter to trigger an interrupt in the Aurdino and to have the Sketch write a one digit field representing one gallon of flow to my channel. I assume the exact Time and Date will be appended to the channels log file. The maximum pulses rate will be 10/minute and up to 400 per day and 15,000/month. Are there are Sketch examples for Aurdino with Ethernet Shield and Interrupt initiated writes?

Larry

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
19
February 25, 2016 - 1:04 am
sp_Permalink sp_Print

Which ethernet shield?

Also you will find that Thingspeak has a hard limit of 15 seconds between channel updates (max 4/minute) so you may need to rethink your design slightly. Count your pulses then send the count to thingspeak every minute or so.

Avatar
neilh
New Member
Forum Posts: 3
sp_UserOfflineSmall Offline
20
March 12, 2016 - 9:37 pm
sp_Permalink sp_Print

Hi I've had an early developer edition Due+Ethernet/wiznet shield running connected to xively for a couple of years and decide to switch to thingspeak
Seems like it would be wired Ethernet shield and be transparent to the upper layer.
I tried the example first, and I wonder if anybody can shed some light on the error

Arduino: 1.6.8 (Windows 8.1), Board: "Arduino Due (Programming Port)"

WARNING: library ThingSpeak claims to run on [avr architecture(s) and may be incompatible with your current board which runs on esp8266] architecture(s).
In file included from C:\..\Documents\Arduino\libraries\ThingSpeak\examples\ReadWeatherStation\ReadWeatherStation.ino:19:0:

C:\..\Documents\Arduino\libraries\ThingSpeak\src/ThingSpeak.h:86:8: error: #error Only Arduino Yun, Uno/Mega/Due with either Wired or wi-fi Ethernet shield, ESP8266, and Spark Core/Photon/Electron are supported.

#error Only Arduino Yun, Uno/Mega/Due with either Wired or wi-fi Ethernet shield, ESP8266, and Spark Core/Photon/Electron are supported.

^

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

epicpaymentsny

DanielBobby

mercedeszw18

ujuxoketate

olihfez

winnieeq69

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee