Hello,
in
I've started a new project on the MKR1010 board and part of that process included experimenting with adding "things" through the IoT cloud.
Everything was working fine a few days ago when I added both a boolean thing (the state of an LED) and the values returned from a DHT22 sensor (humidity and temperature). Everything compiled, uploaded and updated cleanly until yesterday (March 28th, 2019) when I added some unrelated code and tried to compile. I got the error during compile shown below. I stripped out my new code thinking that was the issue, but it was not.
The issue is related to the addProperty function calls in the thingProperties.h library. Specifically in my case when the function tries to pass a real number (float)
Note that the addProperty function call for the boolean operator works fine. I experimented with removing all of the things and only leaving the boolean one and it compiled fine. As soon as the addProperty function is for a real number (float) it gives the compile error shown below.
I am assuming these functions come from the ArduinoIoTCloud.h library. Was something changed recently to that library that is causing this?
Compile error seen:
In file included from /tmp/415556697/build/sketch/thingProperties.h:1:0,
from /tmp/415556697/Wifi_experiment_mar22a/Wifi_experiment_mar22a.ino:21:
/tmp/415556697/build/sketch/thingProperties.h: In function 'void initProperties()':
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:96:66: error: no matching function for call to 'ArduinoIoTCloudClass::addPropertyReal(float&, const char [15], permissionType, const long int&, NULL, double)'
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
^
/tmp/415556697/build/sketch/thingProperties.h:16:16: note: in expansion of macro 'addProperty'
ArduinoCloud.addProperty(DHT22_Humidity, READ, ON_CHANGE, NULL, 0.100000);
^
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:96:66: note: candidates are:
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
^
/tmp/415556697/build/sketch/thingProperties.h:16:16: note: in expansion of macro 'addProperty'
ArduinoCloud.addProperty(DHT22_Humidity, READ, ON_CHANGE, NULL, 0.100000);
^
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:103:8: note: template<class T, class N> void ArduinoIoTCloudClass::addPropertyReal(T&, String, permissionType, long int, void (*)(), void (*)(ArduinoCloudProperty<T>), N)
void addPropertyReal(T & property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, void(*synFn)(ArduinoCloudProperty<T> property) = CLOUD_WINS, N minDelta = N(0)) {
^
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:103:8: note: template argument deduction/substitution failed:
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:96:66: note: mismatched types 'void (*)(ArduinoCloudProperty<T>)' and 'double'
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
^
/tmp/415556697/build/sketch/thingProperties.h:16:16: note: in expansion of macro 'addProperty'
ArduinoCloud.addProperty(DHT22_Humidity, READ, ON_CHANGE, NULL, 0.100000);
^
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:117:27: note: template<class T> ArduinoCloudProperty<T> ArduinoIoTCloudClass::addPropertyReal(T&, const String&, Permission)
ArduinoCloudProperty<T> addPropertyReal(T & property, String const & name, Permission const permission) {
^
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:117:27: note: template argument deduction/substitution failed:
/home/builder/opt/libraries/latest/arduinoiotcloud_0_5_4/src/ArduinoIoTCloud.h:96:66: note: cannot convert 'READ' (type 'permissionType') to type 'Permission'
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
^
/tmp/415556697/build/sketch/thingProperties.h:16:16: note: in expansion of macro 'addProperty'
ArduinoCloud.addProperty(DHT22_Humidity, READ, ON_CHANGE, NULL, 0.100000);
^
exit status 1
NOTE: I did try adding an integer based "thing" to see what would happen and it also threw a compile error, but it returned absolutely no related messages, only a message to report this to the forum.
I'd appreciate anyone's insight on what may be happening here.
Kind Regards,
-Mark-