Need help on Exception (3) runtime error
Posted: Fri Oct 07, 2016 6:10 pm
Been working for a while with Arduino and ESP8266, I'm going crazy with a portion of code which is giving me the Exception (3) at runtime. Checked the code different times, without finding where the problem could be. Portion of the code is this (I don't want to annoy with all the code, only portion that I think could be useful):
The problem is that
the Exception(3) error is occurring after returning back from getMessage function. The
Code: Select all
String getMessage(String toHost, JsonObject& body) {
StaticJsonBuffer<1024> jsonBuffer1;
...
...
...
String httpBody;
root2.printTo(httpBody);
Serial.print(F("[DEBUG] Message: "));
Serial.println(httpBody);
return httpBody;
}
The problem is that
Code: Select all
is printing the expected string generated by the function, but if I write, from main program:Serial.println(httpBody);
Code: Select all
Serial.println(getMessage(host, body)
the Exception(3) error is occurring after returning back from getMessage function. The
Code: Select all
is returning on serial port the right string, so I can't imagine why the error is occurring only when returning the String to the main program. Any hints on this problem? Maybe the solution is simpler than I could imagine... please, help me!Serial.println(httpBody);