Skip to content

Commit f31a101

Browse files
committed
Fix bug in reading channels
Fix bug in reading values from ThingSpeak - Misparsing HTML response.
1 parent 29528a8 commit f31a101

15 files changed

+263
-148
lines changed

examples/ReadLastTemperature/ReadLastTemperature.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
99
systems that collect, analyze, and react to their environments.
1010
11-
Copyright 2015, The MathWorks, Inc.
11+
Copyright 2016, The MathWorks, Inc.
1212
1313
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
1414
See the accompaning licence file for licensing information.
@@ -105,7 +105,7 @@ void loop() {
105105
Serial.println(" degrees F");
106106
#endif
107107
#ifdef SPARK
108-
Spark.publish("thingspeak-lasttemp", "Current temp " + String(temperatureInF) + " degrees F",60,PRIVATE);
108+
Particle.publish("thingspeak-lasttemp", String::format("Current temp %.1f degrees F",temperatureInF),60,PRIVATE);
109109
#endif
110110
delay(30000); // Note that the weather station only updates once a minute
111111
}

examples/ReadPrivateChannel/ReadPrivateChannel.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for prototyping
1010
systems that collect, analyze, and react to their environments.
1111
12-
Copyright 2015, The MathWorks, Inc.
12+
Copyright 2016, The MathWorks, Inc.
1313
1414
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
1515
See the accompaning licence file for licensing information.
@@ -108,7 +108,7 @@ void loop() {
108108
Serial.println("V");
109109
#endif
110110
#ifdef SPARK
111-
Spark.publish("thingspeak-readvoltage", "Latest voltage is: " + String(voltage) + "V",60,PRIVATE);
111+
Particle.publish("thingspeak-readvoltage", "Latest voltage is: " + String(voltage) + "V",60,PRIVATE);
112112
#endif
113113
delay(30000);
114114
}

examples/ReadWeatherStation/ReadWeatherStation.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for prototyping
88
systems that collect, analyze, and react to their environments.
99
10-
Copyright 2015, The MathWorks, Inc.
10+
Copyright 2016, The MathWorks, Inc.
1111
1212
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
1313
See the accompaning licence file for licensing information.
@@ -126,16 +126,16 @@ void loop() {
126126
Serial.println();
127127
#endif
128128
#ifdef SPARK
129-
Spark.publish("thingspeak-weather", "Current weather conditions in Natick: ",60,PRIVATE);
130-
Spark.publish("thingspeak-weather", String(temperature) + " degrees F, " + String(humidity) + "% humidity",60,PRIVATE);
131-
Spark.publish("thingspeak-weather", "Wind at " + String(windSpeed) + " MPH at " + String (windDirection) + " degrees",60,PRIVATE);
129+
Particle.publish("thingspeak-weather", "Current weather conditions in Natick: ",60,PRIVATE);
130+
Particle.publish("thingspeak-weather", String(temperature) + " degrees F, " + String(humidity) + "% humidity",60,PRIVATE);
131+
Particle.publish("thingspeak-weather", "Wind at " + String(windSpeed) + " MPH at " + String (windDirection) + " degrees",60,PRIVATE);
132132
if(rainfall > 0)
133133
{
134-
Spark.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg, and it's raining",60,PRIVATE);
134+
Particle.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg, and it's raining",60,PRIVATE);
135135
}
136136
else
137137
{
138-
Spark.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg",60,PRIVATE);
138+
Particle.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg",60,PRIVATE);
139139
}
140140
#endif
141141

extras/documentation/_thing_speak_8h_source.html

Lines changed: 126 additions & 98 deletions
Large diffs are not rendered by default.

extras/documentation/annotated.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -57,14 +57,19 @@
5757
</div><!-- directory -->
5858
</div><!-- contents -->
5959
<!-- HTML footer for doxygen 1.8.9.1-->
60+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
61+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
62+
systems that collect, analyze, and react to their environments.
63+
Copyright 2016, The MathWorks, Inc.
64+
See the accompaning licence file for licensing information.-->
6065
<!-- start footer part -->
6166
<hr class="footer"/><address class="footer"><small>
6267
<table border=0 width='100%'><tr>
6368
<td align="left" width='50%'>
6469
See the accompaning licence file for licensing information
6570
</td>
6671
<td align="right" width='50%'>
67-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
72+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
6873
</td>
6974
</tr></table>
7075
</small></address>

extras/documentation/class_thing_speak_class.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -1703,14 +1703,19 @@
17031703
</div>
17041704
</div><!-- contents -->
17051705
<!-- HTML footer for doxygen 1.8.9.1-->
1706+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
1707+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
1708+
systems that collect, analyze, and react to their environments.
1709+
Copyright 2016, The MathWorks, Inc.
1710+
See the accompaning licence file for licensing information.-->
17061711
<!-- start footer part -->
17071712
<hr class="footer"/><address class="footer"><small>
17081713
<table border=0 width='100%'><tr>
17091714
<td align="left" width='50%'>
17101715
See the accompaning licence file for licensing information
17111716
</td>
17121717
<td align="right" width='50%'>
1713-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
1718+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
17141719
</td>
17151720
</tr></table>
17161721
</small></address>

extras/documentation/classes.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -61,14 +61,19 @@
6161
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
6262
</div><!-- contents -->
6363
<!-- HTML footer for doxygen 1.8.9.1-->
64+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
65+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
66+
systems that collect, analyze, and react to their environments.
67+
Copyright 2016, The MathWorks, Inc.
68+
See the accompaning licence file for licensing information.-->
6469
<!-- start footer part -->
6570
<hr class="footer"/><address class="footer"><small>
6671
<table border=0 width='100%'><tr>
6772
<td align="left" width='50%'>
6873
See the accompaning licence file for licensing information
6974
</td>
7075
<td align="right" width='50%'>
71-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
76+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
7277
</td>
7378
</tr></table>
7479
</small></address>

extras/documentation/dir_339e8c1d13ed9d171a31356d80f51341.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -56,14 +56,19 @@
5656
</table>
5757
</div><!-- contents -->
5858
<!-- HTML footer for doxygen 1.8.9.1-->
59+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
60+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
61+
systems that collect, analyze, and react to their environments.
62+
Copyright 2016, The MathWorks, Inc.
63+
See the accompaning licence file for licensing information.-->
5964
<!-- start footer part -->
6065
<hr class="footer"/><address class="footer"><small>
6166
<table border=0 width='100%'><tr>
6267
<td align="left" width='50%'>
6368
See the accompaning licence file for licensing information
6469
</td>
6570
<td align="right" width='50%'>
66-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
71+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
6772
</td>
6873
</tr></table>
6974
</small></address>

extras/documentation/dir_9eb8a1162b9e86c4bf1f8e762bfe83d1.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -58,14 +58,19 @@
5858
</table>
5959
</div><!-- contents -->
6060
<!-- HTML footer for doxygen 1.8.9.1-->
61+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
62+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
63+
systems that collect, analyze, and react to their environments.
64+
Copyright 2016, The MathWorks, Inc.
65+
See the accompaning licence file for licensing information.-->
6166
<!-- start footer part -->
6267
<hr class="footer"/><address class="footer"><small>
6368
<table border=0 width='100%'><tr>
6469
<td align="left" width='50%'>
6570
See the accompaning licence file for licensing information
6671
</td>
6772
<td align="right" width='50%'>
68-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
73+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
6974
</td>
7075
</tr></table>
7176
</small></address>

extras/documentation/functions.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -98,14 +98,19 @@
9898
</ul>
9999
</div><!-- contents -->
100100
<!-- HTML footer for doxygen 1.8.9.1-->
101+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
102+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
103+
systems that collect, analyze, and react to their environments.
104+
Copyright 2016, The MathWorks, Inc.
105+
See the accompaning licence file for licensing information.-->
101106
<!-- start footer part -->
102107
<hr class="footer"/><address class="footer"><small>
103108
<table border=0 width='100%'><tr>
104109
<td align="left" width='50%'>
105110
See the accompaning licence file for licensing information
106111
</td>
107112
<td align="right" width='50%'>
108-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
113+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
109114
</td>
110115
</tr></table>
111116
</small></address>

extras/documentation/functions_func.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -98,14 +98,19 @@
9898
</ul>
9999
</div><!-- contents -->
100100
<!-- HTML footer for doxygen 1.8.9.1-->
101+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
102+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
103+
systems that collect, analyze, and react to their environments.
104+
Copyright 2016, The MathWorks, Inc.
105+
See the accompaning licence file for licensing information.-->
101106
<!-- start footer part -->
102107
<hr class="footer"/><address class="footer"><small>
103108
<table border=0 width='100%'><tr>
104109
<td align="left" width='50%'>
105110
See the accompaning licence file for licensing information
106111
</td>
107112
<td align="right" width='50%'>
108-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
113+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
109114
</td>
110115
</tr></table>
111116
</small></address>

extras/documentation/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
22
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
33
systems that collect, analyze, and react to their environments.
4-
Copyright 2015, The MathWorks, Inc.
4+
Copyright 2016, The MathWorks, Inc.
55
See the accompaning licence file for licensing information.-->
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -67,14 +67,19 @@ <h3>Examples</h3>
6767
</ul>
6868
</div></div><!-- contents -->
6969
<!-- HTML footer for doxygen 1.8.9.1-->
70+
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
71+
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
72+
systems that collect, analyze, and react to their environments.
73+
Copyright 2016, The MathWorks, Inc.
74+
See the accompaning licence file for licensing information.-->
7075
<!-- start footer part -->
7176
<hr class="footer"/><address class="footer"><small>
7277
<table border=0 width='100%'><tr>
7378
<td align="left" width='50%'>
7479
See the accompaning licence file for licensing information
7580
</td>
7681
<td align="right" width='50%'>
77-
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
82+
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
7883
</td>
7984
</tr></table>
8085
</small></address>

library.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "ThingSpeak",
3+
"keywords": "iot",
4+
"description": "ThingSpeak Communication Library for Arduino & ESP8266",
5+
"authors":
6+
{
7+
"name": "MathWorks",
8+
"email": "[email protected]",
9+
"url": "https://www.thingspeak.com/",
10+
"maintainer": true
11+
},
12+
"repository":
13+
{
14+
"type": "git",
15+
"url": "https://github.com/mathworks/thingspeak-arduino.git"
16+
},
17+
"examples": [
18+
"examples/*/*.ino"
19+
],
20+
"url": "https://www.thingspeak.com/",
21+
"exclude": "extras",
22+
"frameworks": "arduino",
23+
"platforms": "*"
24+
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ThingSpeak
2-
version=1.1.0
2+
version=1.1.1
33
author=MathWorks <[email protected]>
44
maintainer=MathWorks <[email protected]>
55
sentence=ThingSpeak Communication Library for Arduino & ESP8266

0 commit comments

Comments
 (0)