Serial.readString() problem

Hi !
I have problem whit Serial.readString()...Program is work fine until i add much more strings in one of my function for translating strings to another language.

Seams to me that when i fill global variables memory over 60%,Serial.readString() don't work properly.
It only read first character of string, sometime not even the first!

When i comment some of that strings in that function , it work normal.

All of that is happening even i do not call that function for translating!
Is it possible that is happening because of that percent off memory usage?

Tnx advanced!

Is it possible that is happening because of that percent off memory usage?

Very possible if you are using Strings (capital S) which are notorious for fragmenting memory. Consider using C style strings (zero terminated arrays of chars) instead

Please post your program as it is now for further advice. Could the data be held on an SD card to avoid using memory ?

I think that is problem...yes, i m using String(capital S)
My usage ofdynamic memory is 70% . Now i make new skech whit some Strings ony to fill memory obout 70% and i have same problem when i try to read incoming string like this

If (Serial.available()>0)
{

incoming = Serial.readString();
Serial.println (incoming);

}

You have still not posted any code for us to see what you are doing and how

it is complex...i now :slight_smile: And comments are not on english language...check changing_language () function in tab

gsm_2.7.ino (9.13 KB)

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. This can happen after the program has been running perfectly for some time. Just use cstrings - char arrays terminated with '\0' (NULL).

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

...R

Tnx for answers !!!