We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I declare the following constant string sensor:
auto *mode = new StringConstantSensor("managed", 1000, "/config/mode");
I get the following error:
line 26 in main.cpp is
#include "sensesp/sensors/constant_sensor.h"
It looks like it has something to do with ArduinoJson 6.2
In file included from src/main.cpp:26: .pio/libdeps/esp32dev/SensESP/src/sensesp/sensors/constant_sensor.h: In instantiation of 'bool sensesp::ConstantSensor<T>::set_configuration(const ArduinoJson::V6215PB2::JsonObject&) [with T = String]': .pio/libdeps/esp32dev/SensESP/src/sensesp/sensors/constant_sensor.h:72:16: required from here .pio/libdeps/esp32dev/SensESP/src/sensesp/sensors/constant_sensor.h:75:14: error: ambiguous overload for 'operator=' (operand types are 'String' and 'ArduinoJson::V6215PB2::detail::enable_if<true, ArduinoJson::V6215PB2::detail::MemberProxy<ArduinoJson::V6215PB2::JsonObject, const char*> >::type' {aka 'ArduinoJson::V6215PB2::detail::MemberProxy<ArduinoJson::V6215PB2::JsonObject, const char*>'}) value_ = config["value"]; In file included from .pio/libdeps/esp32dev/NMEA2000-library/src/N2kDef.h:57, from .pio/libdeps/esp32dev/NMEA2000-library/src/N2kStream.h:39, from .pio/libdeps/esp32dev/NMEA2000-library/src/N2kMsg.h:44, from .pio/libdeps/esp32dev/NMEA2000-library/src/N2kMessages.h:57, from src/main.cpp:13: /Users/johan/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:104:18: note: candidate: 'String& String::operator=(const String&)' String & operator =(const String &rhs); ^~~~~~~~ /Users/johan/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:105:18: note: candidate: 'String& String::operator=(const char*)' String & operator =(const char *cstr); ^~~~~~~~ /Users/johan/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:106:18: note: candidate: 'String& String::operator=(const __FlashStringHelper*)' String & operator = (const __FlashStringHelper *str) {return *this = reinterpret_cast<const char*>(str);} ^~~~~~~~ /Users/johan/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:108:18: note: candidate: 'String& String::operator=(String&&)' String & operator =(String &&rval); ^~~~~~~~ /Users/johan/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:109:18: note: candidate: 'String& String::operator=(StringSumHelper&&)' String & operator =(StringSumHelper &&rval);
if I open the source file in visual code / platformio, it show an error in this function below on this line
value_ = config["value"];
virtual bool set_configuration(const JsonObject &config) override { // Neither of the configuration parameters are mandatory if (config.containsKey("value")) { value_ = config["value"]; } if (config.containsKey("interval")) { send_interval_ = config["interval"]; } return true; }
The text was updated successfully, but these errors were encountered:
Found the solution
You have to change line 75 in constant_sensor.h with the following:
old line:
new line:
` value_ = config["value"].as<T>();`
Sorry, something went wrong.
No branches or pull requests
I declare the following constant string sensor:
auto *mode = new StringConstantSensor("managed", 1000, "/config/mode");
I get the following error:
line 26 in main.cpp is
#include "sensesp/sensors/constant_sensor.h"
It looks like it has something to do with ArduinoJson 6.2
if I open the source file in visual code / platformio, it show an error in this function below on this line
value_ = config["value"];
The text was updated successfully, but these errors were encountered: