Auto update ThingSpeakPlot charts | ThingSpeak Apps | Forum


Please consider registering

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
Auto update ThingSpeakPlot charts
No permission to create posts
November 22, 2016
10:20 am
New Member
Forum Posts: 1
Member Since:
November 22, 2016
sp_UserOfflineSmall Offline

Hi, I use two Arduinos to count certain events. Each Arduino is sending its counter every 20sec to its Channel, i.e. I have two channels- one for each Arduino. In addition I have generated one ThingSpeakPlot visualisation which is calculating the difference between counter 1 from channel 1 and counter 2 from channel 2. The result is depicted using 

[Counter1Data, time] = thingSpeakRead(readChannelID1, 'Fields', Counter1FieldID, 'NumPoints', 30,'ReadKey', readAPIKey1);
[Counter2Data, time] = thingSpeakRead(readChannelID2, 'Fields', Counter1FieldID, 'NumPoints', 30,'ReadKey', readAPIKey2);

Difference = Counter1Data - Counter2Data;

thingSpeakPlot(time, [Difference]);

Problem: when the chart is generated/depicted in either Channel 1 or 2 it does not automatically update itself, i.e. when the counter values change the plot/chart does not only does, when I manually refresh the page or open it the first time.

I'd like to have a "living" chart as I have it when visualizing each channel counter value separately.

Any help is appreciated- Thanks!

November 23, 2016
7:21 pm

Forum Posts: 200
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

To confirm your request, you would like the plot generated using thingSpeakPlot to auto refresh every 'n' seconds? 

This is not possible today, but we will put it in the list of features to add based on user requirements. 

In the mean time, you could save the following into a simple HTML page. It auto reloads the page every 5 minutes. Instead of opening, you would open this page.

<html lang="en">
 <body style="margin:0;padding:0">
   <iframe src="" id="myIFrame" style="border:none;" height="0" width="0"></iframe>
   var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
   var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
   var frameHdl = document.getElementById('myIFrame');
   frameHdl.src = ""
   frameHdl.height = height;
   frameHdl.width = width;
   window.setInterval("reloadPage();", 5*60*1000); //minutes to milliseconds 
   function reloadPage() {
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