I hope you all well.
Recently after view unknown crashes I decided it can be related with me messing with "heap"
After reading few sources on heaps and how it works it kind of confusing. Some sources mention that you can F() everything and it will be fine and others mention reserving space for strings with "reserve()"
I am looking for suggestions how possibly eliminate or or control?
I will post snapshot of code below where the evil "String" is used few times.
////////sending data
senddata(String(temp), String(hum), String(dis), String(flood), String(heaterstatus), String(humidifierstatus));
//////////sending data
void senddata(String temp1, String hum1, String dis1, String flood1, String heater1, String humid1) { /////sending all field values in one go
//////////sending data
String getData = "GET /update?api_key=" + API + "&field1=" + temp1 + "&field2=" + hum1 + "&field3=" + dis1 + "&field4=" + flood1 + "&field5=" + heater1 + "&field6=" + humid1;
sendCommand("AT+CIPMUX=1", 5, "OK");
sendCommand("AT+CIPSTART=0,\"TCP\",\"" + HOST + "\"," + PORT, 15, "OK");
sendCommand("AT+CIPSEND=0," + String(getData.length() + 4), 4, ">");
esp8266.println(getData); delay(1500); countTrueCommand++;
sendCommand("AT+CIPCLOSE=0", 5, "OK");
}