CAUTION: SLIPPERY FLOORThe Arduino Library Manager installs the ArduinoJson version 6 by default.
However, using version 5 is highly recommended because version 6 is still in beta stage.
Open the Arduino Library Manager and make sure that ArduinoJson version 5 is installed.
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>();