• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 RFID User Management System with Web Server

Q&A Forum › Category: ESP32 › ESP32 RFID User Management System with Web Server
0 Vote Up Vote Down
Richard Funnell asked 3 months ago

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.

2 Answers
0 Vote Up Vote Down
Richard Funnell answered 3 months ago

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”);
  }

//*************************************************

 

0 Vote Up Vote Down
Sara Santos Staff answered 3 months ago

Hi.
Thanks for the feedback.
You’re probably right.
We’re currently out of the office and will be for the next few weeks. I’ll test it out when we came back and make the necessary corrections.
 
Thanks for taking the time to share this.
 
Regards.
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.