Hi, everything works well on this project. The only thing I need help with is, after deleting the log.txt from the web server, the first Tag offered up to be read does not append to the log file, even though it says it appends on the serial monitor. The next Tag offered up gets added ok. This happens on all 3 Tabs I have. I just cannot work it out.
Help if you can, I would be grateful.
Hi again, found that if you delete the log.txt file, it now does not exist. Added lines of code to re-create the log.txt file straight after the deleting. So offering up a Tab it appends properly. Seems to work.
Just for info.
Many thanks
Start your code here
void deleteFile(fs::FS &fs, const char *path) {
Serial.printf(“Deleting file: %s\n”, path);
if (fs.remove(path)) {
Serial.println(“File deleted”);
//**************************************************
File file = SD.open(“/log.txt”);
if(!file) {
Serial.println(“log.txt file doesn’t exist”);
Serial.println(“Creating file…”);
writeFile(SD, “/log.txt”, “Date,Time,UID,Role\r\n”);
}
//*************************************************