This data is coming from a file on a sd card.
{"Password":"xxxxx","SSID":"xxxxx","IP":"10.0.0.122","UPHighWaterMark":"","DOWNHighWaterMark":""}
When I try to get the IP from the json it comes back as null or blank. When I try to get the SSID it does work.
Here is the code snippet.
StaticJsonDocument<512> doc;
DeserializationError error = deserializeJson(doc, fileData);
String sIP = doc["IP"]; //Not working
const char* cIP = doc["IP"]; //Not working
Serial.print("IP: ");
Serial.println(sIP);
Thanks is advance.
Describe the issue
A clear and concise description of what you're trying to do.
You don't need to explain every aspect of your project: focus on the problem you're having.
Troubleshooter report
Here is the report generated by the ArduinoJson Troubleshooter:
[Paste the report here]
Environment
Here is the environment that I'm using':
Microconroller: [e.g. ESP8266]
Core/runtime: [e.g. ESP8266 core for Arduino v3.0.2]
IDE: [e.g. Arduino IDE 1.8.16]
Reproduction
Here is a small snippet that demonstrate the problem.
This data is coming from a file on a sd card. {"Password":"xxxxx","SSID":"xxxxx","IP":"10.0.0.122","UPHighWaterMark":"","DOWNHighWaterMark":""}
When I try to get the IP from the json it comes back as null or blank. When I try to get the SSID it does work. Here is the code snippet. StaticJsonDocument<512> doc; DeserializationError error = deserializeJson(doc, fileData); String sIP = doc["IP"]; //Not working const char* cIP = doc["IP"]; //Not working Serial.print("IP: "); Serial.println(sIP);
Thanks is advance.
Describe the issue
A clear and concise description of what you're trying to do. You don't need to explain every aspect of your project: focus on the problem you're having.
Troubleshooter report
Here is the report generated by the ArduinoJson Troubleshooter:
[Paste the report here]
Environment
Here is the environment that I'm using':
Reproduction
Here is a small snippet that demonstrate the problem.
Program output
If relevant, include the program output.
Expected output:
Actual output: