Long time to display google gauge | ThingSpeak Plugins | Forum


Please consider registering


— 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
Long time to display google gauge

Forum Posts: 54
sp_UserOfflineSmall Offline
April 26, 2013 - 2:21 am
sp_Permalink sp_Print


I have followed your google gauge tutorial and added to gauges to my channel at


It displays either the pool gauge or the panel gauge immediately but the other seems to take around 15 seconds to display.

I am no expert on Javascript, but I am assuming this is because it is waiting for the JSON query which feeds the gauge to return some data. each piece of data is sent from the Arduino on a rolling 16 second interval


(16 second delay)
(16 second delay)

This is because I am using will nue's seriot application to tether the Arduino to the PC. His app does not send the data as one post but rather sends one individual sensors data per post. meaning it takes 32 seconds to send both records. I am trying to get in touch with him to see if he is prepared to update it.

For the time being however, is there something that can be amended in the query

$.getJSON('https://api.thingspeak.com/channels/5384/feed/last.json?apikey=4DTOBCAIKO2WD3KB&callback=?', function(data)

Which will allow it to display the gauges instantly or am I on the wrong track altogether?


Forum Posts: 54
sp_UserOfflineSmall Offline
April 26, 2013 - 6:51 am
sp_Permalink sp_Print

Following on from my above post I have been doing some investigation. I still have no solution so would appreciate any help

It seems that because I am using seriot I am forced to send individual sensor updates with each post rather than both at once. This means the JSON query being read by the google gauge reads

Panel_Sensor,"10" Pool_Sensor,"null"

then 15 seconds later

Panel_Sensor,"null" Pool_Sensor,"20"

etc etc

Now here is the interesting part. If the google gauge receives a null then it doesnt display the gauge. I have set the interval to 1 second for the gauge which means it constantly checks. As soon as a value becomes available, I then get a gauge displayed.

So trying to code around this, I logically thought, ok

if (data.field1==null)

i.e if the JSON query returns null then trap that and change it to a null. However it seems that for some reason this implementation of the gauge code wont display a gauge if the value is zero. -1 is fine 1 is fine but you try sending it a zero and the need stays where it is. So for that reason, even if I trap data.field1 and turn it to a 0 the gauge still wont display on first load. similary if my temperatures fall to 0 its never going to show a gauge reading of 0.

I suspect this is in some way because javascript is treating 0 in the same manner as null rather than just as another number. I am way out of my depth with javascript. I am sure its a simple change to the code to convert null to 0 and to have 0 treat as an actual number 0

here is the snippet of code from the google gauge example

function loadData()
// variable for the data point
var p;

$.getJSON('https://api.thingspeak.com/channels/5384/feed/last.json?apikey=4DTOBCAIKO2WD3KB&callback=?', function(data)

// get the data point
p = parseFloat(data.field2);

if (p)


New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
January 9, 2015 - 8:02 pm
sp_Permalink sp_Print

I know this is an old thread, but I'm experiencing the same thing as I'm updating 1 channel via 2 Arduino's - Null is posted for the fields the particular Arduino does not use, hence, the gauges then disappear.

Any ideas?

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
27 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:







Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565


Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee