Low memory available, stability problems may occur

I'm having the Low Memory Available problem when I try to compile my code. I already tried all the optimization techniques I know. Can somebody look if there is any optimization left for me to do, or do it for me? (Sorry for my bad english)
:confused:

PS.: I'm sending the code and a print of the error in the attachments!

SistemaFrotas1.0.ino (6.19 KB)

You could get rid of these String

Strip out ALL instances of String class and use C style char arrays instead. This along should pull you into the clear.

const String IP = "192.168.0.23";

All of them? You missed a huge one.

There is NO excuse for making this a String.

SoftwareSerial GPSmodulo(4, 5);
SoftwareSerial WIFImodulo(6, 7);

Only one instance of SoftwareSerial can listen at a time. Which one is it OK to lose data from?

String dadosdatahora;

Pissing more memory away.

 dadosdatahora = String(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6) + ",";
  dadosdatahora += String(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6) + ",";
  dadosdatahora += String(GPS.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : GPS.satellites()) + ",";
  dadosdatahora += String(GPS.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : GPS.hdop()) + ",";
  dadosdatahora += String(ano) + "-";
    if(mes < 10) dadosdatahora += "0";
  dadosdatahora += String(mes) + "-";
    if(dia < 10) dadosdatahora += "0";
  dadosdatahora += String(dia) + ",";
    if(hora - 3 < 10) dadosdatahora += "0";
  dadosdatahora += String(hora - 3) + ":";
    if(minu < 10) dadosdatahora += "0";
  dadosdatahora += String(minu) + ":";
    if(seg < 10) dadosdatahora += "0";
  dadosdatahora += String(seg);

Writing data one literal or value at a time takes no longer, takes no more code, and uses a lot fewer resources. Quit pissing away memory uselessly.

I've made the changes you guys suggested, now I have 83% of memory used, but the Low memory error is still there. Any other changes? In the library perhaps?

Post your new code.

but the Low memory error is still there.

Error? That is a message that says that you MIGHT have a problem.

And, we do need to see the new code.

I can't write in the SD card when a have de low memory mesage, and I need to write the data I receive from the GPS from time to time, that's the problem.

that's the problem.

No. The problem is that you changed your code and didn't post it. Nor have you answered all of the questions.

It's probably time for you to quit beating you head against the wall, and get a Mega.