aJson Parsing problem

I'm working on taking a json file...
contents:

{"mode":"1","xval":"48","yval":"54","udlr":"","cmdVal":""}

And using the aJson library to parse the variables out.

I'm grabbing the content of the file (including brackets) into a char array and using the following code:

Serial.print("json data: ");
Serial.println(json_data);

aJsonObject* jsonObject = aJson.parse(json_data);
aJsonObject* mode = aJson.getObjectItem(jsonObject , "mode");
Serial.print("Mode: ");
Serial.println(mode->valuestring);  
aJsonObject* xval = aJson.getObjectItem(jsonObject , "xval");
Serial.print("Xval: ");
Serial.println(xval->valuestring);

My serial output shows that the char array is correct, and the code pulls out variables a couple times but then stops pulling them out. Here is my output from the above:

Connect to 173.255.229.121:80
json data: {"mode":"1","xval":"48","yval":"54","udlr":"","cmdVal":""}
Mode: 1
Xval: 48


Connect to 173.255.229.121:80
json data: {"mode":"1","xval":"48","yval":"54","udlr":"","cmdVal":""}
Mode: 1
Xval: 48


Connect to 173.255.229.121:80
json data: {"mode":"1","xval":"48","yval":"54","udlr":"","cmdVal":""}
Mode: 
Xval: 


Connect to 173.255.229.121:80
json data: {"mode":"1","xval":"48","yval":"54","udlr":"","cmdVal":""}
Mode: 
Xval: 

Any ideas as to why the parser would work a few times and then stop working?
Thanks!!

chien_fu:
Any ideas as to why the parser would work a few times and then stop working?

I don't know how that library works, but JSON parsing sounds to me like the sort of thing that might involve dynamic memory allocation. In that case, the problem may be that you're running out of heap memory. You could use the freememory() function in the playground to monitor how much memory your sketch has left to see whether you have a leak.