- Fri Oct 07, 2016 6:10 pm
#56212
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):
Code: Select allString 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
is printing the expected string generated by the function, but if I write, from main program:
Code: Select allSerial.println(getMessage(host, body)
the Exception(3) error is occurring after returning back from getMessage function. The
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!