Hello. I use an Arduino Uno R3 board and I try to collect some data from my solar panel and send it via "printTo()" to my ESP8266 board to finally send data o database.
CODE:
...
#include <ArduinoJson.h> // pentru transmiterea datelor
....
setup(){
...
Serial.begin(9600);
...
}
void loop(){
// POWER LOGGER
...
// SOLAR TRACKER
...
// SEND DATA TO ESP
JsonObject& root = jbuffer.createObject();
// root["voltage"] = loadvoltage;
// root[ "current"] = current_mA;
// root["power"] = power;
// root["energy"] = energy;
root["v"] = 12; // DUMMY DATA
root[ "c"] = 50;
root["p"] = 22;
root["e"] = 33;
root.printTo(Serial);
root.remove("v");
root.remove("c");
root.remove("p");
root.remove("e");
Serial.println(); // clear buffer
// DELAY TIME = 1000ms
delay(delayTime);
}
and my serial monitor looks like this:
21:33:04.585 -> {"v":12,"c":50,"p":22,"e":33}
21:33:05.608 -> {"v":12,"c":50,"p":22,"e":33}
21:33:06.632 -> {"v":12,"c":50,"p":22,"e":33}
21:33:07.611 -> {"v":12,"c":50,"p":22,"e":33}
21:33:08.632 -> {"v":12,"c":50,"p":22,"e":33}
21:33:09.611 -> {"v":12,"c":50,"p":22,"e":33}
21:33:10.637 -> {"v":12,"c":50,"p":22,"e":33}
21:33:11.609 -> {"v":12,"c":50,"p":22,"e":33}
21:33:12.632 -> {"v":12,"c":50,"p":22,"e":33}
21:33:13.611 -> {"v":12,"c":50,"p":22,"e":33}
21:33:14.636 -> {"v":12,"c":50,"p":22,"e":33}
21:33:15.613 -> {"v":12,"c":50,"p":22,"e":33}
21:33:16.637 -> {"v":12,"c":50,"p":22,"e":33}
21:33:17.612 -> {"v":12,"c":50,"p":22,"e":33}
21:33:18.637 -> {"v":12,"c":50,"p":22,"e":33}
21:33:19.615 -> {"v":12,"c":50,"p":22,"e":33}
21:33:20.635 -> {"v":12,"c":50,"p":22,"e":33}
21:33:21.608 -> {"v":12}
21:33:22.629 -> {}
21:33:23.602 -> {}
21:33:24.628 -> {}
I running out of RAM ?
Sketch uses 12874 bytes (39%) of program storage space. Maximum is 32256 bytes.
Global variables use 675 bytes (32%) of dynamic memory, leaving 1373 bytes for local variables. Maximum is 2048 bytes.
Or what is the problem? How can I simplify ?