Continuing the discussion from Adafruit BMP085 Library not compiling in WEB IDE on Lib 2.0:
Hey there @Sauli – have you already tried reaching out to the original library creator? In the meantime, if you are trying to use a DS18B20 library, I believe this library should also work for you:
Greetings! I just compiled with Libraries 2.0. It works!
Note: Just need to modify #include “…/OneWire/OneWire.h” >> #include “OneWire.h” in “spark-dallas-temperature.h”
Have a nice day!
I just tried the above fix and got:
weatherlcd.cpp:23:21: fatal error: OneWire.h: No such file or directory
#include "OneWire.h"
So I tried re-including the OneWire library. I got some message about migrating to a new format so I said Yes. Then the entire page grayed out and went unresponsive. I waited quite a while and finally hit reload on the browser and got
The page you were looking for doesn't exist.You may have mistyped the address or the page may have moved.
So I closed the page, relogged in again and tried to compile. Now it’s going:
In file included from /src/weatherlcd.cpp:29:0:
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:66:0: warning: "_BV" redefined [enabled by default]
#define _BV(bit) (1 << (bit))
^
In file included from ./inc/application.h:92:0,
from lib/HttpClient/src/HttpClient.h:4,
from /src/weatherlcd.cpp:11:
../wiring/inc/spark_wiring_arduino.h:131:0: note: this is the location of the previous definition
#define _BV(x) (((uint32_t)1) << (x))
^
/src/weatherlcd.cpp: In function 'void printLCD()':
/src/weatherlcd.cpp:951:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
plus a ton of other errors.
This code compiled perfectly the last time I tried it. I haven’t touched anything since then. How do I fix this?
These warnings are note nice but won’t keep your code from building.
Can you post your full error log and I tend to suggest moving to the DS18B20 library as this is the one I maintain and try to keep able to build.
If you can tell what the possible advantages of Spark-Dallas-Temperature
are over that one, I might be able to add this too.
Here is the full error log:
In file included from /src/weatherlcd.cpp:30:0:
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:66:0: warning: "_BV" redefined [enabled by default]
#define _BV(bit) (1 << (bit))
^
In file included from ./inc/application.h:92:0,
from lib/HttpClient/src/HttpClient.h:4,
from /src/weatherlcd.cpp:12:
../wiring/inc/spark_wiring_arduino.h:131:0: note: this is the location of the previous definition
#define _BV(x) (((uint32_t)1) << (x))
^
/src/weatherlcd.cpp: In function 'void printLCD()':
/src/weatherlcd.cpp:952:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
}
^
/src/weatherlcd.cpp:954:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:956:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
retVal = -3;
^
/src/weatherlcd.cpp:969:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100); */
^
/src/weatherlcd.cpp:974:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:982:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (18,2) ; // line 2, col. 18
^
/src/weatherlcd.cpp:990:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:996:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print (LCDdegF) ;
^
/src/weatherlcd.cpp:1005:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1016:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1074:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print("Soil Moisture: ");
^
/src/weatherlcd.cpp:1076:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.println();
^
/src/weatherlcd.cpp:1082:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.println();
^
/src/weatherlcd.cpp:1087:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
//lcd.println("ft.");
^
/src/weatherlcd.cpp:1092:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print(inHg);
^
/src/weatherlcd.cpp:1095:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ftoa (mb, res, 1) ;
^
/src/weatherlcd.cpp:1098:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1101:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1105:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (P0 > P2)
^
/src/weatherlcd.cpp:1108:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" ") ; // needed for correct spacing
^
/src/weatherlcd.cpp:1112:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1116:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
case (2):
^
/src/weatherlcd.cpp:1121:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
}
^
/src/weatherlcd.cpp:1133:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("_/") ;
^
/src/weatherlcd.cpp:1135:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
case (7):
^
/src/weatherlcd.cpp:1149:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.drawLine (12*6, 12*8, 12*6+4, 12*8+6, 1) ; // "^\"
^
/src/weatherlcd.cpp:1154:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end switch
^
/src/weatherlcd.cpp:1161:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
n = minute - 20 ;
^
/src/weatherlcd.cpp:1165:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" PRESRR") ; // Pres. Rising Rapidly
^
/src/weatherlcd.cpp:1173:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100) ;
^
/src/weatherlcd.cpp:1176:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (8,13) ;
^
/src/weatherlcd.cpp:1179:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1182:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// snowin is set in main loop, near top
^
/src/weatherlcd.cpp:1185:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (snowin < 10)
^
/src/weatherlcd.cpp:1188:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1191:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
bat = batteryVoltage () ;
^
/src/weatherlcd.cpp:1194:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ftoa (bat, res, 1) ; // Convert to string w/1 dec. pt.
^
/src/weatherlcd.cpp:1197:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" V") ;
^
/src/weatherlcd.cpp:943:5: warning: unused variable 'foo' [-Wunused-variable]
else if (strstr(response, "400 Bad Request"))
^
/src/weatherlcd.cpp:944:7: warning: unused variable 'bar' [-Wunused-variable]
{
^
/src/weatherlcd.cpp: In function 'void lcdPrintWind()':
/src/weatherlcd.cpp:1220:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("FM-") ;
^
/src/weatherlcd.cpp:1223:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("LQ ") ;
^
/src/weatherlcd.cpp:1226:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("LQ-") ;
^
/src/weatherlcd.cpp:1229:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("???") ; // should never happen
^
/src/weatherlcd.cpp:1232:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end printCD
^
/src/weatherlcd.cpp:1235:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
void lcdPrintWind ()
^
/src/weatherlcd.cpp:1238:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.setHome(); // <- removed as part of test to fix double time print
^
/src/weatherlcd.cpp:1241:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// delay(100);
^
/src/weatherlcd.cpp:1244:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial1.println();
^
/src/weatherlcd.cpp:1247:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print("Wind: ");
^
/src/weatherlcd.cpp:1250:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1253:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1256:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1259:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1262:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1265:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1274:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1292:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp: In function 'void initDisplay()':
/src/weatherlcd.cpp:1518:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1522:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,1) ;
^
/src/weatherlcd.cpp:1526:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if(m<10) lcd.print("0");
^
/src/weatherlcd.cpp:1530:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// t= minutes past midnight of sunset
^
/src/weatherlcd.cpp:1534:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
h=winterSunrise.sun_Hour();
^
/src/weatherlcd.cpp:1538:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print(h);
^
/src/weatherlcd.cpp:1542:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1546:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcdPrintSRSS () ;
^
/src/weatherlcd.cpp:1549:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1551:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1555:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1557:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,4) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintSRSS()':
/src/weatherlcd.cpp:1617:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1620:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print("Application>\tResponse status: ");
^
/src/weatherlcd.cpp:1622:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1639:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("ms=") ;
^
/src/weatherlcd.cpp:1642:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("mn=") ;
^
/src/weatherlcd.cpp:1644:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1646:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (hn < 0)
^
/src/weatherlcd.cpp:1650:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (hn) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintForecastOld()':
/src/weatherlcd.cpp:1682:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("SR/SS Err ") ; // didn't get a response from the server
^
/src/weatherlcd.cpp:1712:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,15) ; // Col. 1, line 15
^
/src/weatherlcd.cpp:1664:12: warning: unused variable 'mn' [-Wunused-variable]
mn = atoi (ms) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintForecast()':
/src/weatherlcd.cpp:1748:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end lcdPrintForecastOld
^
/src/weatherlcd.cpp:1787:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("s=") ;
^
/src/weatherlcd.cpp:1732:12: warning: unused variable 'mn' [-Wunused-variable]
^
/src/weatherlcd.cpp: In function 'void BTcheck()':
/src/weatherlcd.cpp:1915:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Sensor is measured at 50" AGL, but need const. 79 to get 0.
^
/src/weatherlcd.cpp:1917:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
d = round (d * 2.0) / 2.0 ; // round to nearest 1/2"
^
lib/HttpClient/src/HttpClient.cpp: In member function 'void HttpClient::request(http_request_t&, http_response_t&, http_header_t*, const char*)':
lib/HttpClient/src/HttpClient.cpp:176:19: warning: unused variable 'firstRead' [-Wunused-variable]
unsigned long firstRead = millis();
^
In file included from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:46:0:
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:66:0: warning: "_BV" redefined [enabled by default]
#define _BV(bit) (1 << (bit))
^
In file included from ./inc/application.h:92:0,
from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:46,
from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:46:
../wiring/inc/spark_wiring_arduino.h:131:0: note: this is the location of the previous definition
#define _BV(x) (((uint32_t)1) << (x))
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp: In member function 'float Weather::readPressure()':
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:320:22: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if(IIC_Read(STATUS) & (1<<2) == 0) toggleOneShot(); //Toggle the OST bit causing the sensor to immediately take another reading
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:324:25: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
while(IIC_Read(STATUS) & (1<<2) == 0)
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp: In member function 'float Weather::readBaroTemp()':
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:360:22: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if(IIC_Read(STATUS) & (1<<1) == 0) toggleOneShot(); //Toggle the OST bit causing the sensor to immediately take another reading
^
lib/Sunrise/src/Sunrise.cpp: In member function 'int Sunrise::Compute(unsigned char, unsigned char, int)':
lib/Sunrise/src/Sunrise.cpp:101:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from lib/spark-dallas-temperature/src/spark-dallas-temperature.cpp:12:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
#include "../OneWire/OneWire.h"
^compilation terminated.
make[1]: *** [../build/target/user/platform-6spark-dallas-temperature/src/spark-dallas-temperature.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code. banjo_cowboy v0.6.1
And these are all my includes:
// This #include statement was automatically added by the Particle IDE.
#include <HttpClient.h>
#include "application.h"
// This #include statement was automatically added by the Particle IDE.
#include <Sunrise.h>
// This #include statement was automatically added by the Particle IDE.
#include <SparkFunPhant.h>
// This #include statement was automatically added by the Particle IDE.
// #include "OneWire/OneWire.h"
#include "OneWire.h"
// This #include statement was automatically added by the Particle IDE.
#include <spark-dallas-temperature.h>
// This #include statement was automatically added by the Particle IDE.
#include <SparkFun_Photon_Weather_Shield_Library.h>
#include <SparkFun_Serial_Graphic_LCD.h>
#include "math.h"
In point of fact, I'm not currently using the OneWire bus nor the Dallas temperature sensor so I don't really know. But all that code came with ehe program Sparkfun provides with their Weather Shield and that's the base for my added code. I'd rather leave that all in there in case I want it later on.
Actually you seem to have only one error right at the end of your error log
In file included from lib/spark-dallas-temperature/src/spark-dallas-temperature.cpp:12:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
#include "../OneWire/OneWire.h"
And that’s due to the fact that the Spark-Dallas-Temperature
lib has a “bad” include statement.
Try removing that lib and reimporting the updated version (if there is a working one).
I did that but unfortunately, it's still not compiling.
In file included from /src/weatherlcd.cpp:36:0:
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:66:0: warning: "_BV" redefined [enabled by default]
#define _BV(bit) (1 << (bit))
^
In file included from ./inc/application.h:92:0,
from lib/OneWire/src/OneWire.h:5,
from /src/weatherlcd.cpp:2:
../wiring/inc/spark_wiring_arduino.h:131:0: note: this is the location of the previous definition
#define _BV(x) (((uint32_t)1) << (x))
^
/src/weatherlcd.cpp: In function 'void printLCD()':
/src/weatherlcd.cpp:958:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
}
^
/src/weatherlcd.cpp:960:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:962:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
retVal = -3;
^
/src/weatherlcd.cpp:975:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100); */
^
/src/weatherlcd.cpp:980:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:988:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (18,2) ; // line 2, col. 18
^
/src/weatherlcd.cpp:996:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1002:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print (LCDdegF) ;
^
/src/weatherlcd.cpp:1011:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1022:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1080:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print("Soil Moisture: ");
^
/src/weatherlcd.cpp:1082:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.println();
^
/src/weatherlcd.cpp:1088:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.println();
^
/src/weatherlcd.cpp:1093:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
//lcd.println("ft.");
^
/src/weatherlcd.cpp:1098:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print(inHg);
^
/src/weatherlcd.cpp:1101:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ftoa (mb, res, 1) ;
^
/src/weatherlcd.cpp:1104:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1107:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1111:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (P0 > P2)
^
/src/weatherlcd.cpp:1114:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" ") ; // needed for correct spacing
^
/src/weatherlcd.cpp:1118:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1122:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
case (2):
^
/src/weatherlcd.cpp:1127:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
}
^
/src/weatherlcd.cpp:1139:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("_/") ;
^
/src/weatherlcd.cpp:1141:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
case (7):
^
/src/weatherlcd.cpp:1155:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.drawLine (12*6, 12*8, 12*6+4, 12*8+6, 1) ; // "^\"
^
/src/weatherlcd.cpp:1160:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end switch
^
/src/weatherlcd.cpp:1167:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
n = minute - 20 ;
^
/src/weatherlcd.cpp:1171:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" PRESRR") ; // Pres. Rising Rapidly
^
/src/weatherlcd.cpp:1179:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100) ;
^
/src/weatherlcd.cpp:1182:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (8,13) ;
^
/src/weatherlcd.cpp:1185:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1188:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// snowin is set in main loop, near top
^
/src/weatherlcd.cpp:1191:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (snowin < 10)
^
/src/weatherlcd.cpp:1194:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1197:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
bat = batteryVoltage () ;
^
/src/weatherlcd.cpp:1200:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ftoa (bat, res, 1) ; // Convert to string w/1 dec. pt.
^
/src/weatherlcd.cpp:1203:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (" V") ;
^
/src/weatherlcd.cpp:949:5: warning: unused variable 'foo' [-Wunused-variable]
else if (strstr(response, "400 Bad Request"))
^
/src/weatherlcd.cpp:950:7: warning: unused variable 'bar' [-Wunused-variable]
{
^
/src/weatherlcd.cpp: In function 'void lcdPrintWind()':
/src/weatherlcd.cpp:1226:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("FM-") ;
^
/src/weatherlcd.cpp:1229:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("LQ ") ;
^
/src/weatherlcd.cpp:1232:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("LQ-") ;
^
/src/weatherlcd.cpp:1235:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("???") ; // should never happen
^
/src/weatherlcd.cpp:1238:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end printCD
^
/src/weatherlcd.cpp:1241:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
void lcdPrintWind ()
^
/src/weatherlcd.cpp:1244:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.setHome(); // <- removed as part of test to fix double time print
^
/src/weatherlcd.cpp:1247:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// delay(100);
^
/src/weatherlcd.cpp:1250:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial1.println();
^
/src/weatherlcd.cpp:1253:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// lcd.print("Wind: ");
^
/src/weatherlcd.cpp:1256:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1259:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1262:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1265:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1268:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1271:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1280:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp:1298:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
break;
^
/src/weatherlcd.cpp: In function 'void initDisplay()':
/src/weatherlcd.cpp:1524:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
{
^
/src/weatherlcd.cpp:1528:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,1) ;
^
/src/weatherlcd.cpp:1532:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if(m<10) lcd.print("0");
^
/src/weatherlcd.cpp:1536:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// t= minutes past midnight of sunset
^
/src/weatherlcd.cpp:1540:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
h=winterSunrise.sun_Hour();
^
/src/weatherlcd.cpp:1544:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print(h);
^
/src/weatherlcd.cpp:1548:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1552:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcdPrintSRSS () ;
^
/src/weatherlcd.cpp:1555:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1557:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay (100) ;
^
/src/weatherlcd.cpp:1561:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
delay(100);
^
/src/weatherlcd.cpp:1563:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,4) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintSRSS()':
/src/weatherlcd.cpp:1623:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1626:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print("Application>\tResponse status: ");
^
/src/weatherlcd.cpp:1628:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1645:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("ms=") ;
^
/src/weatherlcd.cpp:1648:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("mn=") ;
^
/src/weatherlcd.cpp:1650:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
^
/src/weatherlcd.cpp:1652:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (hn < 0)
^
/src/weatherlcd.cpp:1656:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print (hn) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintForecastOld()':
/src/weatherlcd.cpp:1688:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
lcd.print ("SR/SS Err ") ; // didn't get a response from the server
^
/src/weatherlcd.cpp:1718:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
setCursor (1,15) ; // Col. 1, line 15
^
/src/weatherlcd.cpp:1670:12: warning: unused variable 'mn' [-Wunused-variable]
mn = atoi (ms) ;
^
/src/weatherlcd.cpp: In function 'void lcdPrintForecast()':
/src/weatherlcd.cpp:1754:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
} // end lcdPrintForecastOld
^
/src/weatherlcd.cpp:1793:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Serial.print ("s=") ;
^
/src/weatherlcd.cpp:1738:12: warning: unused variable 'mn' [-Wunused-variable]
^
/src/weatherlcd.cpp: In function 'void BTcheck()':
/src/weatherlcd.cpp:1921:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
// Sensor is measured at 50" AGL, but need const. 79 to get 0.
^
/src/weatherlcd.cpp:1923:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
d = round (d * 2.0) / 2.0 ; // round to nearest 1/2"
^
lib/HttpClient/src/HttpClient.cpp: In member function 'void HttpClient::request(http_request_t&, http_response_t&, http_header_t*, const char*)':
lib/HttpClient/src/HttpClient.cpp:176:19: warning: unused variable 'firstRead' [-Wunused-variable]
unsigned long firstRead = millis();
^
In file included from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:46:0:
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:66:0: warning: "_BV" redefined [enabled by default]
#define _BV(bit) (1 << (bit))
^
In file included from ./inc/application.h:92:0,
from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.h:46,
from lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:46:
../wiring/inc/spark_wiring_arduino.h:131:0: note: this is the location of the previous definition
#define _BV(x) (((uint32_t)1) << (x))
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp: In member function 'float Weather::readPressure()':
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:320:22: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if(IIC_Read(STATUS) & (1<<2) == 0) toggleOneShot(); //Toggle the OST bit causing the sensor to immediately take another reading
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:324:25: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
while(IIC_Read(STATUS) & (1<<2) == 0)
^
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp: In member function 'float Weather::readBaroTemp()':
lib/SparkFun_Photon_Weather_Shield_Library/src/SparkFun_Photon_Weather_Shield_Library.cpp:360:22: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if(IIC_Read(STATUS) & (1<<1) == 0) toggleOneShot(); //Toggle the OST bit causing the sensor to immediately take another reading
^
lib/Sunrise/src/Sunrise.cpp: In member function 'int Sunrise::Compute(unsigned char, unsigned char, int)':
lib/Sunrise/src/Sunrise.cpp:101:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from lib/spark-dallas-temperature/src/spark-dallas-temperature.cpp:12:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
#include "../OneWire/OneWire.h"
^compilation terminated.
make[1]: *** [../build/target/user/platform-6spark-dallas-temperature/src/spark-dallas-temperature.o] Error 1
make: *** [user] Error 2
I see the original contributor has updated the source on GitHub but not published a new version of it.
That’s why I suggested to use a “living” library
Umm… OK, you lost me. Living library?
A library that is actively maintained
I don’t know of any other library to use for this, so I just commented out everything to do with both OneWire and spark-dallas-temperature. But it still won’t compile!
In file included from lib/spark-dallas-temperature/src/spark-dallas-temperature.cpp:12:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
#include "../OneWire/OneWire.h"
^compilation terminated.
make[1]: *** [../build/target/user/platform-6spark-dallas-temperature/src/spark-dallas-temperature.o] Error 1
make: *** [user] Error 2
Where is this error coming from???
I have uploaded the code that compiled perfectly the last time I ran it on 12/23/16 to https://www.filesanywhere.com/fs/v.aspx?v=8b716a875e6170b1a0a8. I’m offering a six-pack of beer to the first person who can get this to compile, and tell me how it’s done.
I think - no I know - I gave you an alternative already
I could also fix your project, but that would be cheating
But I’ve already removed all references to Dallas* everywhere and it’s still complaining about it. I just tried including DS18B20 and still get the same error. Anyway, you’ve helped me enough in the past that you deserve the bounty.
You also need to remove the include statements and remove the libraries from your project.
I guess you are using Web IDE, right?
If you can post a screenshot of your IDE window with the code/project <>
drawer open it’d be easier to see what libs you’ve got imported.
Right.
There's too many to fit in one screen. Is the text version of that OK? This is what I'm currently trying. All the Dallas and OneWire stuff is commented out. Are you saying I need to remove ALL the libraries and then reinclude them?
// This #include statement was automatically added by the Particle IDE.
#include <DS18B20.h>
// This #include statement was automatically added by the Particle IDE.
#include <SparkFun_Photon_Weather_Shield_Library.h>
// This #include statement was automatically added by the Particle IDE.
// #include "OneWire.h"
// This #include statement was automatically added by the Particle IDE.
// #include <spark-dallas-temperature.h>
// weatherlcd.ino
// Backup is in C:\Program Files\Photon_Weather_Shield-master\WeatherLCDv2.txt
// Version 1.01, 9/23/16
// 1.02, 11/6/16, fixed DST code in SR/SS
// 1.03, 11/20/16 - Changed forecast API provider
// 1.04, 12/17/16 - Added BT auto-reconnect on dropped connection.
// 1.05, 12/23/16 - Added snow depth sensor
// SYSTEM_MODE (AUTOMATIC); // enable wifi + cloud (default)
// This #include statement was automatically added by the Particle IDE.
#include <HttpClient.h>
#include "application.h"
// This #include statement was automatically added by the Particle IDE.
#include <Sunrise.h>
// This #include statement was automatically added by the Particle IDE.
#include <SparkFunPhant.h>
// This #include statement was automatically added by the Particle IDE.
// #include "OneWire/OneWire.h"
// #include "OneWire.h"
// This #include statement was automatically added by the Particle IDE.
// #include <spark-dallas-temperature.h>
// This #include statement was automatically added by the Particle IDE.
// #include <SparkFun_Photon_Weather_Shield_Library.h>
#include <SparkFun_Serial_Graphic_LCD.h>
#include "math.h"
No, just these two includes and the respective libraries libraries ...
// This #include statement was automatically added by the Particle IDE.
// #include "OneWire.h"
// This #include statement was automatically added by the Particle IDE.
// #include <spark-dallas-temperature.h>
... unless you have got any other OneWire library (apart from DS18B20) in your project.
I wasn't after your code but only the list of included libraries and file tabs of your project.
I have now tried to build your project and you can stick with the original code if you do this:
- remove the
spark-dallas-temperature
library but keepOneWire
(also removeDS18B20
again) - tap the top right
(+)
icon in Web IDE - name the new file
spark-dallas-temperature
- got to https://github.com/tomdeboer/SparkCoreDallasTemperature/blob/master/firmware/spark-dallas-temperature.h
- copy/paste the contents into the respective file tab and
- got to https://github.com/tomdeboer/SparkCoreDallasTemperature/blob/master/firmware/spark-dallas-temperature.cpp
- copy/paste the contents into the respective file tab
- save the project
- try to build
OK, I'm up to step 5:
And now I'm stuck. Which is the "respective file tab"?
I have my own code in weatherlcd1.ino and then two tabs, both named "spark-dallas-te". ???
Click on the tab and see your browsers address bar.
Or if you hover with the mouse over the file tab your browser should show you the link which tells you.
Or you open the <>
drawer and select the wanted file.
Or you just make your window wider then the file tabs should expand too (at least do for me in Chrome)
But since they are ordered .cpp
left .h
the one you selected should be the .h
file.