Hello everyone!
I done a project with my personala account for a weather station that registers two PT100 values, everything worked properly and now I want to take this out of my personal account and upload it to an account created for the user so they can use the dashboard and everything withous using my acount.
The thing is that verifying the code in arduino editor it says everything is fine. Once I upload it to the board MKR WIFI 1010 it starts to connec and disconnect and obiously is not working. I sove that with reset, and with blink example board works perfectly. As soon as I try to reload the sketch I want i get the error again.
Now I managed to return to the IoT Cloud and verifying the sketch there I get this error message:
Start verifying
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino: In function 'void loop()':
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:37:24: error: expected ')' before ';' token
#define RREF 430.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:76:53: note: in expansion of macro 'RREF'
Serial.print("Air Resistance = "); Serial.println(RREF*ratioair,8);
^~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:76:58: error: invalid type argument of unary '*' (have 'float')
Serial.print("Air Resistance = "); Serial.println(RREF*ratioair,8);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:73: note: in expansion of macro 'RNOMINAL'
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:81: error: expected primary-expression before ',' token
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:87: error: expected primary-expression before ')' token
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:29: note: in expansion of macro 'RNOMINAL'
Tair = maxAIR.temperature(RNOMINAL, RREF);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:37: error: expected primary-expression before ',' token
Tair = maxAIR.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:43: error: expected primary-expression before ')' token
Tair = maxAIR.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:37:24: error: expected ')' before ';' token
#define RREF 430.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:87:55: note: in expansion of macro 'RREF'
Serial.print("Track Resistance = "); Serial.println(RREF*ratiotrack,8);
^~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:87:60: error: invalid type argument of unary '*' (have 'float')
Serial.print("Track Resistance = "); Serial.println(RREF*ratiotrack,8);
^~~~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:77: note: in expansion of macro 'RNOMINAL'
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:85: error: expected primary-expression before ',' token
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:91: error: expected primary-expression before ')' token
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:33: note: in expansion of macro 'RNOMINAL'
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:41: error: expected primary-expression before ',' token
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:47: error: expected primary-expression before ')' token
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^
Multiple libraries were found for "WiFiNINA.h"
Used: /home/builder/opt/libraries/wifinina_1_8_14
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
Multiple libraries were found for "ArduinoECCX08.h"
Used: /home/builder/opt/libraries/arduinoeccx08_1_3_7
Not used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0
Multiple libraries were found for "SPI.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.13/libraries/SPI
Not used: /home/builder/opt/libraries/eventethernet_1_0_0
Multiple libraries were found for "Adafruit_SPIDevice.h"
Used: /home/builder/opt/libraries/adafruit_busio_1_14_3
Not used: /home/builder/opt/libraries/vegaiot_busio_1_0_0
Error during build: exit status 1
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino: In function 'void loop()':
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:37:24: error: expected ')' before ';' token
#define RREF 430.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:76:53: note: in expansion of macro 'RREF'
Serial.print("Air Resistance = "); Serial.println(RREF*ratioair,8);
^~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:76:58: error: invalid type argument of unary '*' (have 'float')
Serial.print("Air Resistance = "); Serial.println(RREF*ratioair,8);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:73: note: in expansion of macro 'RNOMINAL'
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:81: error: expected primary-expression before ',' token
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:77:87: error: expected primary-expression before ')' token
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:29: note: in expansion of macro 'RNOMINAL'
Tair = maxAIR.temperature(RNOMINAL, RREF);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:37: error: expected primary-expression before ',' token
Tair = maxAIR.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:78:43: error: expected primary-expression before ')' token
Tair = maxAIR.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:37:24: error: expected ')' before ';' token
#define RREF 430.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:87:55: note: in expansion of macro 'RREF'
Serial.print("Track Resistance = "); Serial.println(RREF*ratiotrack,8);
^~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:87:60: error: invalid type argument of unary '*' (have 'float')
Serial.print("Track Resistance = "); Serial.println(RREF*ratiotrack,8);
^~~~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:77: note: in expansion of macro 'RNOMINAL'
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:85: error: expected primary-expression before ',' token
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:88:91: error: expected primary-expression before ')' token
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:40:24: error: expected ')' before ';' token
#define RNOMINAL 100.0;
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:33: note: in expansion of macro 'RNOMINAL'
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^~~~~~~~
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:41: error: expected primary-expression before ',' token
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^
/tmp/4197161203/Weather_sep05a/Weather_sep05a.ino:89:47: error: expected primary-expression before ')' token
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
^
Multiple libraries were found for "WiFiNINA.h"
Used: /home/builder/opt/libraries/wifinina_1_8_14
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
Multiple libraries were found for "ArduinoECCX08.h"
Used: /home/builder/opt/libraries/arduinoeccx08_1_3_7
Not used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0
Multiple libraries were found for "SPI.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.13/libraries/SPI
Not used: /home/builder/opt/libraries/eventethernet_1_0_0
Multiple libraries were found for "Adafruit_SPIDevice.h"
Used: /home/builder/opt/libraries/adafruit_busio_1_14_3
Not used: /home/builder/opt/libraries/vegaiot_busio_1_0_0
Error during build: exit status 1
Any help will be welcome
Here the code:
// Arduino Low Power - Version: Latest
#include <ArduinoLowPower.h>
// Adafruit MAX31865 library - Version: Latest
#include <Adafruit_MAX31865.h>
/*
Sketch generated by the Arduino IoT Cloud Thing "Weather"
https://create.arduino.cc/cloud/things/2c55b4ac-3ee9-47e6-aee5-d4b3db503b52
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float Tair;
float Ttrack;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
// Tair sensor software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 maxAIR = Adafruit_MAX31865(9, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(10);
// Ttrack sensor software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 maxTRACK = Adafruit_MAX31865(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(9);
// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF 430.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL 100.0
unsigned long previousMillis = 0;
const long interval = 1000; //milliseconds
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
uint16_t rtdair = maxAIR.readRTD();
Serial.print("Air RTD value: "); Serial.println(rtdair);
float ratioair = rtdair;
ratioair /= 32768;
Serial.print("Air Ratio a = "); Serial.println(ratioair,8);
Serial.print("Air Resistance = "); Serial.println(RREF*ratioair,8);
Serial.print("Air Temperature = "); Serial.println(maxAIR.temperature(RNOMINAL, RREF));
Tair = maxAIR.temperature(RNOMINAL, RREF);
Serial.print(Tair);
Serial.print("");
uint16_t rtdtrack = maxTRACK.readRTD();
Serial.print("Track RTD value: "); Serial.println(rtdtrack);
float ratiotrack = rtdtrack;
ratiotrack /= 32768;
Serial.print("Track Ratio a = "); Serial.println(ratiotrack,8);
Serial.print("Track Resistance = "); Serial.println(RREF*ratiotrack,8);
Serial.print("Track Temperature = "); Serial.println(maxTRACK.temperature(RNOMINAL, RREF));
Ttrack = maxTRACK.temperature(RNOMINAL, RREF);
Serial.print(Ttrack);
Serial.print("");
// Check and print any faults
uint8_t faultair = maxAIR.readFault();
if (faultair) {
Serial.print("AIR max31865 Fault 0x"); Serial.println(faultair, HEX);
if (faultair & MAX31865_FAULT_HIGHTHRESH) {
Serial.println("AIR max31865 RTD High Threshold");
}
if (faultair & MAX31865_FAULT_LOWTHRESH) {
Serial.println("AIR max31865RTD Low Threshold");
}
if (faultair & MAX31865_FAULT_REFINLOW) {
Serial.println("AIR max31865 REFIN- > 0.85 x Bias");
}
if (faultair & MAX31865_FAULT_REFINHIGH) {
Serial.println("AIR max31865 REFIN- < 0.85 x Bias - FORCE- open");
}
if (faultair & MAX31865_FAULT_RTDINLOW) {
Serial.println("AIR max31865 RTDIN- < 0.85 x Bias - FORCE- open");
}
if (faultair & MAX31865_FAULT_OVUV) {
Serial.println("AIR max31865 Under/Over voltage");
}
maxAIR.clearFault();
}
Serial.println();
uint8_t faulttrack = maxTRACK.readFault();
if (faulttrack) {
Serial.print("TRACK max31865 Fault 0x"); Serial.println(faulttrack, HEX);
if (faulttrack & MAX31865_FAULT_HIGHTHRESH) {
Serial.println("TRACK max31865 RTD High Threshold");
}
if (faulttrack & MAX31865_FAULT_LOWTHRESH) {
Serial.println("TRACK max31865 RTD Low Threshold");
}
if (faulttrack & MAX31865_FAULT_REFINLOW) {
Serial.println("TRACK max31865 REFIN- > 0.85 x Bias");
}
if (faulttrack & MAX31865_FAULT_REFINHIGH) {
Serial.println("TRACK max31865 REFIN- < 0.85 x Bias - FORCE- open");
}
if (faulttrack & MAX31865_FAULT_RTDINLOW) {
Serial.println("TRACK max31865 RTDIN- < 0.85 x Bias - FORCE- open");
}
if (faulttrack & MAX31865_FAULT_OVUV) {
Serial.println("TRACK max31865 Under/Over voltage");
}
maxTRACK.clearFault();
}
Serial.println();
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
//code here will update every 1 second
//without blocking the program and the cloud update
}
LowPower.sleep(550000);
}