ThingSpeak Communication Library for Arduino | Arduino | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





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

sp_Feed sp_TopicIcon
ThingSpeak Communication Library for Arduino
No permission to create posts
August 22, 2015
3:44 pm
Avatar
Rob Purser
Natick, MA

MathWorks
Members
Forum Posts: 46
Member Since:
August 22, 2015
sp_UserOfflineSmall Offline

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!

August 28, 2015
8:49 am
Avatar
mdahlb

Silver
Members
Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline

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

August 28, 2015
12:22 pm
Avatar
Rob Purser
Natick, MA

MathWorks
Members
Forum Posts: 46
Member Since:
August 22, 2015
sp_UserOfflineSmall Offline

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!

August 30, 2015
2:57 pm
Avatar
mdahlb

Silver
Members
Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline

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

September 10, 2015
8:20 am
Avatar
mdahlb

Silver
Members
Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline

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

September 10, 2015
9:42 am
Avatar
hans

MathWorks
Members
Forum Posts: 4
Member Since:
January 19, 2011
sp_UserOfflineSmall Offline

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.

September 10, 2015
11:48 am
Avatar
Rob Purser
Natick, MA

MathWorks
Members
Forum Posts: 46
Member Since:
August 22, 2015
sp_UserOfflineSmall Offline

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!

September 30, 2015
4:43 am
Avatar
mdahlb

Silver
Members
Forum Posts: 10
Member Since:
August 28, 2015
sp_UserOfflineSmall Offline

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! =)

October 10, 2015
11:27 am
Avatar
AYAduino

Silver
Members
Forum Posts: 9
Member Since:
February 10, 2015
sp_UserOfflineSmall Offline

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

October 10, 2015
7:32 pm
Avatar
Rob Purser
Natick, MA

MathWorks
Members
Forum Posts: 46
Member Since:
August 22, 2015
sp_UserOfflineSmall Offline

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!

October 13, 2015
8:19 pm
Avatar
AYAduino

Silver
Members
Forum Posts: 9
Member Since:
February 10, 2015
sp_UserOfflineSmall Offline

Thanks Rob!

November 5, 2015
10:46 am
Avatar
JolynLaub
New Member
Members
Forum Posts: 1
Member Since:
November 5, 2015
sp_UserOfflineSmall Offline

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?

November 9, 2015
1:44 pm
Avatar
mpo881
New Member
Members
Forum Posts: 1
Member Since:
November 9, 2015
sp_UserOfflineSmall Offline

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

November 10, 2015
1:33 pm
Avatar
hans

MathWorks
Members
Forum Posts: 4
Member Since:
January 19, 2011
sp_UserOfflineSmall Offline

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.

December 28, 2015
8:07 am
Avatar
Rob Purser
Natick, MA

MathWorks
Members
Forum Posts: 46
Member Since:
August 22, 2015
sp_UserOfflineSmall Offline

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!

January 23, 2016
11:19 am
Avatar
homerruma

Silver
Members
Forum Posts: 8
Member Since:
November 6, 2015
sp_UserOfflineSmall Offline

hello esp8266 real name Module

February 3, 2016
10:02 am
Avatar
pljevljak
New Member
Members
Forum Posts: 1
Member Since:
February 3, 2016
sp_UserOfflineSmall Offline

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).

February 24, 2016
11:43 pm
Avatar
wheato22

Silver
Members
Forum Posts: 8
Member Since:
February 23, 2016
sp_UserOfflineSmall Offline

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

February 25, 2016
1:04 am
Avatar
rw950431

Top
Members
Forum Posts: 261
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

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.

March 12, 2016
9:37 pm
Avatar
neilh
New Member
Members
Forum Posts: 3
Member Since:
July 24, 2013
sp_UserOfflineSmall Offline

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.

^

No permission to create posts
Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

josephrj11, dennis55, jillhp4, tabathawg69, MarinaMa, Susandom

Administrators: Hans: 387, lee: 457