Skip to content

Commit

Permalink
Fix bug in reading channels
Browse files Browse the repository at this point in the history
Fix bug in reading values from ThingSpeak - Misparsing HTML response.
  • Loading branch information
rpurser47 committed Jan 8, 2016
1 parent 29528a8 commit f31a101
Show file tree
Hide file tree
Showing 15 changed files with 263 additions and 148 deletions.
4 changes: 2 additions & 2 deletions examples/ReadLastTemperature/ReadLastTemperature.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
See the accompaning licence file for licensing information.
Expand Down Expand Up @@ -105,7 +105,7 @@ void loop() {
Serial.println(" degrees F");
#endif
#ifdef SPARK
Spark.publish("thingspeak-lasttemp", "Current temp " + String(temperatureInF) + " degrees F",60,PRIVATE);
Particle.publish("thingspeak-lasttemp", String::format("Current temp %.1f degrees F",temperatureInF),60,PRIVATE);
#endif
delay(30000); // Note that the weather station only updates once a minute
}
4 changes: 2 additions & 2 deletions examples/ReadPrivateChannel/ReadPrivateChannel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for prototyping
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
See the accompaning licence file for licensing information.
Expand Down Expand Up @@ -108,7 +108,7 @@ void loop() {
Serial.println("V");
#endif
#ifdef SPARK
Spark.publish("thingspeak-readvoltage", "Latest voltage is: " + String(voltage) + "V",60,PRIVATE);
Particle.publish("thingspeak-readvoltage", "Latest voltage is: " + String(voltage) + "V",60,PRIVATE);
#endif
delay(30000);
}
12 changes: 6 additions & 6 deletions examples/ReadWeatherStation/ReadWeatherStation.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for prototyping
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
Documentation for the ThingSpeak Communication Library for Arduino is in the extras/documentation folder where the library was installed.
See the accompaning licence file for licensing information.
Expand Down Expand Up @@ -126,16 +126,16 @@ void loop() {
Serial.println();
#endif
#ifdef SPARK
Spark.publish("thingspeak-weather", "Current weather conditions in Natick: ",60,PRIVATE);
Spark.publish("thingspeak-weather", String(temperature) + " degrees F, " + String(humidity) + "% humidity",60,PRIVATE);
Spark.publish("thingspeak-weather", "Wind at " + String(windSpeed) + " MPH at " + String (windDirection) + " degrees",60,PRIVATE);
Particle.publish("thingspeak-weather", "Current weather conditions in Natick: ",60,PRIVATE);
Particle.publish("thingspeak-weather", String(temperature) + " degrees F, " + String(humidity) + "% humidity",60,PRIVATE);
Particle.publish("thingspeak-weather", "Wind at " + String(windSpeed) + " MPH at " + String (windDirection) + " degrees",60,PRIVATE);
if(rainfall > 0)
{
Spark.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg, and it's raining",60,PRIVATE);
Particle.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg, and it's raining",60,PRIVATE);
}
else
{
Spark.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg",60,PRIVATE);
Particle.publish("thingspeak-weather", "Pressure is " + String(pressure) + " inHg",60,PRIVATE);
}
#endif

Expand Down
224 changes: 126 additions & 98 deletions extras/documentation/_thing_speak_8h_source.html

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions extras/documentation/annotated.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -57,14 +57,19 @@
</div><!-- directory -->
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
9 changes: 7 additions & 2 deletions extras/documentation/class_thing_speak_class.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -1703,14 +1703,19 @@
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
9 changes: 7 additions & 2 deletions extras/documentation/classes.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -61,14 +61,19 @@
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -56,14 +56,19 @@
</table>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -58,14 +58,19 @@
</table>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
9 changes: 7 additions & 2 deletions extras/documentation/functions.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -98,14 +98,19 @@
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
9 changes: 7 additions & 2 deletions extras/documentation/functions_func.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -98,14 +98,19 @@
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
9 changes: 7 additions & 2 deletions extras/documentation/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2015, The MathWorks, Inc.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -67,14 +67,19 @@ <h3>Examples</h3>
</ul>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- ThingSpeak(TM) Communication Library For Arduino, ESP8266, and Particle
ThingSpeak ( https://www.thingspeak.com ) is a free IoT service for building
systems that collect, analyze, and react to their environments.
Copyright 2016, The MathWorks, Inc.
See the accompaning licence file for licensing information.-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
<table border=0 width='100%'><tr>
<td align="left" width='50%'>
See the accompaning licence file for licensing information
</td>
<td align="right" width='50%'>
Copyright &copy; 2015 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
Copyright &copy; 2016 <a target=_top href=http://www.mathworks.com>The MathWorks, Inc.</a><br>
</td>
</tr></table>
</small></address>
Expand Down
24 changes: 24 additions & 0 deletions library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "ThingSpeak",
"keywords": "iot",
"description": "ThingSpeak Communication Library for Arduino & ESP8266",
"authors":
{
"name": "MathWorks",
"email": "[email protected]",
"url": "https://www.thingspeak.com/",
"maintainer": true
},
"repository":
{
"type": "git",
"url": "https://github.com/mathworks/thingspeak-arduino.git"
},
"examples": [
"examples/*/*.ino"
],
"url": "https://www.thingspeak.com/",
"exclude": "extras",
"frameworks": "arduino",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ThingSpeak
version=1.1.0
version=1.1.1
author=MathWorks <[email protected]>
maintainer=MathWorks <[email protected]>
sentence=ThingSpeak Communication Library for Arduino & ESP8266
Expand Down
Loading

0 comments on commit f31a101

Please sign in to comment.