Error: Ambiguous overload for 'operator='
This page covers ArduinoJson 5.13.5, consider upgrading to version 6.21.2.
Most of the time you can rely on implicit casts.
But there is one notable exception: when you convert a
JsonVariant to a
String ssid = network["ssid"]; ssid = network["ssid"];
The first line will compile but the second will fail with the following error:
error: ambiguous overload for 'operator=' (operand types are 'String' and 'ArduinoJson::JsonObjectSubscript<const char*>')
The solution is to remove the ambiguity with any of the following replacement:
ssid = (const char*)network["ssid"]; ssid = network["ssid"].as<const char*>(); ssid = network["ssid"].as<String>();