Hi,
I have been running this code for 8 months. It monitors the temperature in a very old and large church. We decided to add 3 more sensors to see if we can lower heat. I copied code from the successfully running sensors. I went to check code after changing ThingSpeak IDS. And got an error. I went back tot he original code that has been running and did code check on that and have the same error. I am at a loss as to what is happening as the original sensor is happily sending back data. I will add that I am barely understanding the code as I cut and pasted from other projects.
The error is:
This is expanded error:
Processing temperaturechurch.ino
Checking library Adafruit_DHT…
Checking library ThingSpeak…
Installing library Adafruit_DHT 0.0.2 to lib/Adafruit_DHT …
Installing library ThingSpeak 1.5.1 to lib/ThingSpeak …
Library ThingSpeak 1.5.1 installed.
Library Adafruit_DHT 0.0.2 installed.
make -C …/newlib_nano
make[1]: Entering directory ‘/firmware/newlib_nano’
make[1]: Nothing to be done for ‘all’.
make[1]: Leaving directory ‘/firmware/newlib_nano’
make -C …/user
make[1]: Entering directory ‘/firmware/user’
Building cpp file: src/temperaturechurch.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p …/build/target/user/platform-0-ltosrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F10X_MD -DPLATFORM_THREADING=0 -DPLATFORM_ID=0 -DPLATFORM_NAME=core -DUSBD_VID_SPARK=0x1D50 -DUSBD_PID_DFU=0x607F -DUSBD_PID_CDC=0x607D -DSPARK_PLATFORM -DFLASHEE_EEPROM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -flto -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=0 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=1.4.2 -DRELEASE_BUILD -I./inc -I…/wiring/inc -I…/system/inc -I…/third_party/miniz/miniz -I…/services/inc -I…/third_party/nanopb/nanopb -I…/communication/inc -I…/hal/inc -I…/hal/shared -I…/hal/src/core -I…/hal/src/stm32 -I…/platform/shared/inc -I…/platform/MCU/STM32F1xx/STM32_StdPeriph_Driver/inc -I…/platform/MCU/STM32F1xx/STM32_USB_Device_Driver/inc -I…/platform/MCU/STM32F1xx/SPARK_Firmware_Driver/inc -I…/platform/MCU/shared/STM32/inc -I…/platform/MCU/STM32F1xx/CMSIS/Include -I…/platform/MCU/STM32F1xx/CMSIS/Device/ST/Include -I…/platform/NET/CC3000/CC3000_Host_Driver -I…/dynalib/inc -Isrc -I./libraries -Ilib/Adafruit_DHT/src -Ilib/ThingSpeak/src -I. -MD -MP -MF …/build/target/user/platform-0-ltosrc/temperaturechurch.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=CC3000 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DMODULE_VERSION=1404 -DMODULE_FUNCTION=3 -DMODULE_DEPENDENCY=0,0,0 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="“app”" -fno-exceptions -fno-rtti -fcheck-new -std=gnu++14 -c -o …/build/target/user/platform-0-ltosrc/temperaturechurch.o src/temperaturechurch.cpp
temperaturechurch.ino: In function ‘void setup()’:
temperaturechurch.ino:40:3: error: ‘Cellular’ was not declared in this scope
In file included from …/wiring/inc/spark_wiring.h:50:0,
from ./inc/application.h:40,
from src/temperaturechurch.cpp:1:
temperaturechurch.ino: In lambda function:
temperaturechurch.ino:42:15: error: ‘Cellular’ is not captured
…/wiring/inc/spark_wiring_system.h:462:70: note: in definition of macro ‘waitFor’
#define waitFor(condition, timeout) System.waitCondition({ return (condition)(); }, (timeout))
^
…/wiring/inc/spark_wiring_system.h:462:59: note: the lambda has no capture-default
#define waitFor(condition, timeout) System.waitCondition({ return (condition)(); }, (timeout))
^
temperaturechurch.ino:42:7: note: in expansion of macro ‘waitFor’
temperaturechurch.ino:40:3: note: ‘Cellular’ declared here
In file included from …/wiring/inc/spark_wiring.h:50:0,
from ./inc/application.h:40,
from src/temperaturechurch.cpp:1:
…/wiring/inc/spark_wiring_system.h: In instantiation of ‘static bool SystemClass::waitConditionWhile(Condition, While) [with Condition = setup()::<lambda()>; While = SystemClass::waitCondition(Condition, system_tick_t) [with Condition = setup()::<lambda()>; system_tick_t = long unsigned int]::<lambda()>]’:
…/wiring/inc/spark_wiring_system.h:257:34: required from ‘static bool SystemClass::waitCondition(Condition, system_tick_t) [with Condition = setup()::<lambda()>; system_tick_t = long unsigned int]’
temperaturechurch.ino:42:7: required from here
…/wiring/inc/spark_wiring_system.h:245:39: error: could not convert ‘_condition.setup()::<lambda()>()’ from ‘void’ to ‘bool’
while (_while() && !_condition()) {
^
…/wiring/inc/spark_wiring_system.h:245:28: error: in argument to unary !
while (_while() && !_condition()) {
^
…/wiring/inc/spark_wiring_system.h:248:27: error: void value not ignored as it ought to be
return _condition();
^
…/build/module.mk:277: recipe for target ‘…/build/target/user/platform-0-ltosrc/temperaturechurch.o’ failed
make[1]: *** […/build/target/user/platform-0-ltosrc/temperaturechurch.o] Error 1
make[1]: Leaving directory ‘/firmware/user’
…/build/recurse.mk:11: recipe for target ‘user’ failed
make: *** [user] Error 2
Hide raw
Ready.
And the code that I think it is referencing is this:
//set timer soft delay
inline void softDelay(uint32_t t) {
for(uint32_t ms = millis(); millis() - ms < t; Particle.process());
}
void setup() {
//line 34 5o 36 added in order to make sure cellular module working see https://community.particle.io/t/cellular-network-unhealthy/47802/6
Cellular.on(); // just to be on the safe side due to open issue
Cellular.connect();
if (waitFor(Cellular.ready, 300000)) { // wait up to 5 minutes for the connection to establish
// Connect to ThingSpeak
ThingSpeak.begin(client);
// Give power to the sensor
pinMode(DHT_5V_PIN, OUTPUT);
pinMode(DHT_GROUND_PIN, OUTPUT);
digitalWrite(DHT_5V_PIN, HIGH);
digitalWrite(DHT_GROUND_PIN, LOW);
// Wait for the sensor to stabilize
softDelay(5000);
// Initialize sensor
dht.begin();
// Read Sensor
double temperature = dht.getTempCelcius();
double humidity = dht.getHumidity();
//Temperature here to see if code was upated being sent to ThinkSpeak
double tempf = dht.getTempFarenheit();
// Update the 2 ThingSpeak fields with the new data
ThingSpeak.setField(1, (float)temperature);
ThingSpeak.setField(2, (float)humidity);
ThingSpeak.setField(3, (float)tempf);
// Write the fields that you've set all at once.
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
// Give time for the message to reach ThingSpeak
softDelay(5000);
}