I am modifying the esp8266easyiot_temperature_humidity by Igor to acomodate 5 diffrent sensor data. It works with 3 sensors but with 4 I am getting: Global variables use 1,622 bytes (79%) of dynamic memory, leaving 426 bytes for local variables. Maximum is 2,048 bytes. The program does not work. I am running it on Arduino Uno.
How can I optimize memory. Can I create Esp8266EasyIoTMsg when I need it and dump it from memory after posting data?
Best option to start with if you have not done it already is to delete or remark out as many serial print statements as possible. You may get to a point where you have to re-enable maybe one of them. You will find that the sketch operates quicker without them anyway and may help with any timing issues.
easyiot dht as is
33,872 bytes (41%) of dynamic memory leaving 48,048 bytes for local variables, maximum is 81920 bytes
serial prints remarked out
33,716 bytes (41%) of dynamic memory leaving 48,204 bytes for local variables, maximum is 81920 bytes
You can scrounge a bit more if you also remark out the Serial.begin statement too.
It does still compile just fine here
Do unto others before they get chance to scr3w you over