hi
I have a question, maybe someone can help me
I store outputs of several different sensors on one file in SD.
After a day, the file reaches a maximum of about 4 MB in size
I wanted to send this file to my server from the internet (with post.request or FTP client or ... )
My problem is when I want to read this file from SD
file.readstring();
It cannot handle all data on a file and can only hold up to 63kg
at first, I thought that it's on limitation on sending data which that can not send the whole file but after making a file again that I just read I found out that its reading string problem
String cer = fie.readString();
File file = SD.open("/temp.txt");
if (!file) {
writeFile(SD, "/temp.txt", cer.c_str());
}
else {
Serial.println("File already exists");
}
file.close();
What do you think I can do or what way should i use to read a full size of a file?
and if there is a better way to send a file with this size?
read file on SD with big size
Re: read file on SD with big size
You have a limited amount of memory to work with so you cannot load the whole file into a string, you need to read the file in chunks and upload to the server.
See an example from the SDK here:
https://github.com/espressif/esp-idf/bl ... e_server.c
See an example from the SDK here:
https://github.com/espressif/esp-idf/bl ... e_server.c
Re: read file on SD with big size
that shows me the way THANK YOU
Who is online
Users browsing this forum: No registered users and 64 guests