bblanchon / ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.
https://arduinojson.org
MIT License
6.7k stars 1.12k forks source link

IP Address Issue #2063

Closed KenFellows closed 6 months ago

KenFellows commented 7 months ago

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.

JsonDocument doc;

DeserializationError error = deserializeJson(doc, "{\"hello\":\"world\"}");

// insert code here

Program output
If relevant, include the program output.

Expected output:

[insert expected output here]

Actual output:

[insert actual output here]
bblanchon commented 7 months ago

What does the troubleshooter say?