The code builds but the parser is failing to parse. The code is here and following is the JSON from console
parser.clear(); //Clear the parser state
String parserbeat = String(beat);
parser.addString(parserbeat); //Add the string command, and parse it
if (parser.parse())
{
String thisNodeID;
if (!parser.getOuterValueByKey("DID", thisNodeID)) {Serial.println("failed to get nodeID");}
else Serial.println(thisNodeID);
String thisNom;
if (!parser.getOuterValueByKey("NOM", thisNom)) {Serial.println("failed to get isNominal");}
else Serial.println(thisNom);
float floatValue;
if (!parser.getOuterValueByKey("BV", floatValue)) {Serial.println("failed to get BV");}
else Serial.printlnf("%f",floatValue);
int thisSoC;
if (!parser.getOuterValueByKey("SOC", thisSoC)) {Serial.println("failed to get State of Charge");}
else Serial.printlnf("%i",thisSoC);
String thisPWR;
if (!parser.getOuterValueByKey("PWR", thisPWR)) {Serial.println("failed to get Powered");}
else Serial.println(thisPWR);
String thisCHG;
if (!parser.getOuterValueByKey("CHG", thisCHG)) {Serial.println("failed to get Charging");}
else Serial.println(thisCHG);
//bool boolValue;
//if (!parser.getOuterValueByKey("TST", boolValue)) {Serial.println("failed to get bool value");}
}
else
{
Serial.println("parsing failed heartbeat command");
}
This is a copy from the console (which appears like this) - I don’t believe it is a double quotes issue. Not least because the JSON is valid - the console can Prettify it OK.
It means that parsing failed for some reason. Either the input string is corrupted, invalid, or the buffers are too small (when using the Static version).