Comments on: ESP32 Datalogger: Download Data File via Web Server (Arduino IDE) https://randomnerdtutorials.com/esp32-datalogger-download-data-file/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Thu, 26 Jun 2025 15:04:33 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Sara Santos https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1061197 Thu, 26 Jun 2025 15:04:33 +0000 https://randomnerdtutorials.com/?p=151210#comment-1061197 In reply to Peter Obermeier.

Hi.
I’ll send you an email.
Regards,
Sara

]]>
By: Peter Obermeier https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1061194 Thu, 26 Jun 2025 14:56:02 +0000 https://randomnerdtutorials.com/?p=151210#comment-1061194 Hi Sara,
Have used your great tutorial “esp32-send-email-smtp-server-arduino-ide” and modified it only in one line and it worked with my M5Stack Core1.
att.file.storage_type = esp_mail_file_storage_type_sd;
Instead of:
att.file.storage_type = esp_mail_file_storage_type_flash;

There is a little disadvantage of the email solution, it needs internet.
If we do not find an answer for my original question, then I will go for this email solution.
Thank you very much!
Peter
PS: Should I send you my whole sketch or publish it here in the comments?

]]>
By: Peter Obermeier https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1061147 Thu, 26 Jun 2025 10:57:24 +0000 https://randomnerdtutorials.com/?p=151210#comment-1061147 Hi Sara,
I have no clue what lines of code it need to send a request with the file in the main loop. My simple try to enter the line „ request->send(SD, “/tag” + tag + “.csv”, “text/csv”); „ was not successful. Not a big surprise. I am an 72 year old electronic engineer and started to program with 19. I am a jack in all trades, but a master in none. If it is not possible to receive an asynchron request, set a flag and send the file in main loop, then I try to send the file via email.
Will be happy to see your answer.
Peter

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1061126 Thu, 26 Jun 2025 09:59:05 +0000 https://randomnerdtutorials.com/?p=151210#comment-1061126 In reply to Peter Obermeier.

Hi.
Can you be a little more specific?
Do you get any errors in the Serial Monitor?
Regards,
Sara

]]>
By: Peter Obermeier https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1060946 Wed, 25 Jun 2025 19:25:47 +0000 https://randomnerdtutorials.com/?p=151210#comment-1060946 Thank you Sara and Rui for all your very helpful great tutorials!

The code in this tutorial is working perfect as long the file on the sd card ist tiny. If the download takes too long, it is not working. Have googled several days now and found two proposals. One proposal is telling to increase the timeout, but it is not working for me.The second one is telling to set a flag and complete the download in the main loop. But I have not found a line of code which is doing that.

Proposal 1: These lines are in the setup:
server.on(“/d”, HTTP_GET, [](AsyncWebServerRequest *request) {
request->client()->setRxTimeout(60000);
request->send(SD, “/day1.csv”, “text/csv”);
});

Proposal 2: These lines are in the setup:

server.on(“/d”, HTTP_GET, [](AsyncWebServerRequest *request) {

downloadflag = 1;
});

But what should I write in the loop? A simple request->send is not working. The compile is saying: “Compilation error: ‘request’ was not declared in this scope”

void loop() {
if (downloadFlag == 1) {

request->send(SD, "/tag" + tag + ".csv", "text/csv");

});
downloadFlag = 0;

}

}

Any help is welcome and I am happy to send somethiing via paypal.

Sunny greetings from Freiburg, Black Forest, Germany
Peter

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1019921 Wed, 26 Mar 2025 10:27:03 +0000 https://randomnerdtutorials.com/?p=151210#comment-1019921 In reply to Andreas Deckers.

Hi.
That’s probably not the isssue.
You should have more information about the error, not just that warning.

Can you share more info?

Regards,

Sara

]]>
By: Andreas Deckers https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-1019694 Tue, 25 Mar 2025 11:31:03 +0000 https://randomnerdtutorials.com/?p=151210#comment-1019694 Hi
the upload of the code was not successful due to the following error code:
Mehrere Bibliotheken wurden für “SD.h” gefunden
Benutzt: C:\Users\Deckers\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\libraries\SD
Nicht benutzt: C:\Users\Deckers\AppData\Local\Arduino15\libraries\SD
Nicht benutzt: C:\Users\Deckers\Documents\Arduino\libraries\SD
exit status 1

Compilation error: exit status 1

I´m sure that only one sd-card library is installed. What went wrong?

Desperately waiting for an answer
Andreas

]]>
By: john errington https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-996294 Wed, 01 Jan 2025 09:58:36 +0000 https://randomnerdtutorials.com/?p=151210#comment-996294 Sorry this is so long.
I was using the hardware on a powered usb hub.
I’ve now connected the hardware directly to a usb port on the main PC, and added a 10uF cap across the SD card supply pins (5V)
The system now seems robust.
The data.txt file is created in setup.
When the “delete file” is run I dont see how that file is re-created in your code.?

]]>
By: john errington https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-994263 Wed, 25 Dec 2024 09:12:22 +0000 https://randomnerdtutorials.com/?p=151210#comment-994263 “My best guess is that the error relates to access to the sd card.”
I’ve added this to the write, append and delete functions. connSDCard();

// Reconnect microSD card
void connSDCard(){
if(!SD.exists(dataPath)){
Serial.println(“File not accessible”);
SD.begin();
Serial.println(“Reconnected SD card “);
}
return;
}

It no longer fails after a file view: but the delete still fails :

HTTP: Deleting data file Deleting file: /data.txt
– delete failed
Saving data: Wed 25/12/2024 09:09:47, 22.5, 47.2, 1018.8
Appending to file: /data.txt
File not accessible
Reconnected SD card
Failed to open file for appending
Saving data: Wed 25/12/2024 09:10:50, 22.5, 47.2, 1018.7
Appending to file: /data.txt
File not accessible
Reconnected SD card
Failed to open file for appending

]]>
By: john errington https://randomnerdtutorials.com/esp32-datalogger-download-data-file/#comment-994225 Wed, 25 Dec 2024 03:40:31 +0000 https://randomnerdtutorials.com/?p=151210#comment-994225 Connecting to WiFi ……connected
192.168.1.57
SD Card Type: SDHC
SD Card Size: 3768MB
File already exists
Saving data: Wed 25/12/2024 03:15:08, 20.2, 52.0, 1016.7
Appending to file: /data.txt
Message appended
Saving data: Wed 25/12/2024 03:16:08, 20.2, 52.4, 1016.7
Appending to file: /data.txt
Message appended
Saving data: Wed 25/12/2024 03:17:08, 20.2, 52.4, 1016.7
Appending to file: /data.txt
Message appended
Saving data: Wed 25/12/2024 03:18:08, 20.2, 52.4, 1016.6
Appending to file: /data.txt
Message appended
Saving data: Wed 25/12/2024 03:19:08, 20.3, 52.4, 1016.6
Appending to file: /data.txt
Message appended (yes that shows on the sd card file)
Saving data: Wed 25/12/2024 03:20:30, 20.5, 51.8, 1016.6 (that does not)
Appending to file: /data.txt
Deleting file: /data.txt
– delete failed
Failed to open file for appending
Saving data: Wed 25/12/2024 03:21:34, 20.5, 51.7, 1016.7 (not saved)
Appending to file: /data.txt
Failed to open file for appending

The web page is now not displayed, but I can still ping the server.
On removing the sd card the delete has indeed failed.
At this point the server displays a blank page.
(now replaced the sd card)
Following a reset

Connecting to WiFi …..connected
192.168.1.57
SD Card Type: SDHC
SD Card Size: 3768MB
File already exists
Saving data: Wed 25/12/2024 03:33:19, 21.4, 50.8, 1016.7
Appending to file: /data.txt
Failed to open file for appending (web page not displayed)

Connecting to WiFi ……connected
192.168.1.57
SD Card Type: SDHC
SD Card Size: 3768MB
File already exists
Saving data: Wed 25/12/2024 03:34:41, 21.3, 50.9, 1016.7
Appending to file: /data.txt
Message appended (web page now displayed)

My best guess is that the error relates to access to the sd card.

Another issue is that the amount of data that is shown is limited.
Could it be that the data transfer is interrupted when a new reading is taken?

]]>