Hello PauS, sorry to take your time again...
Now I can write to the txt file fine from my windows app TCP client...
It's works fine if I send a string like "12345678" per secont, I can't speed up that...
I have declared:
char rec[12];
And here is the code to write to the file:
while (client.connected()) {
if (client.available()) {
int charCount = client.read((uint8_t *)rec, 11);
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("abc.txt", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to abc.txt...");
myFile.print(rec);
Serial.print(rec);
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
If I try to speedup the write process, and I open the txt file to check ou, the format looks like this:
12345617
12345617
12345617
1345617
112345617
112345617
12345617
1345617
112345617
112345617
Do you know why and how to fix it ?
Thanks Again!