- This topic has 6 replies, 2 voices, and was last updated 10 months, 3 weeks ago by
BrunoPicard.
-
AuthorPosts
-
-
20 June 2024 at 12:29 #30833
Hello from France,
First of all, thanks to Renzo for all his work.
I have adapted one of Renzo’s examples (Arduino_esp32_SD) to transfer files via FTP between an SD CARD and my PC. When I upload files to the SD CARD, everything works perfectly. However, if I download files from the SD CARD to the PC, the file is created in the destination directory, but it’s empty.
I use the SD / ESP8266WiFi / SimpleFTPServer libraries.
I’ve tried this with several FTP clients and files of different sizes: the target file is always empty.
I should add that I read the file on the SD CARD with this code:File config_SD = SD.open("config.txt","r"); if (!config_SD.available()) { while (config_SD.available()){ Serial.println(config_SD.readStringUntil('\n')); } } config_SD.close();
Could you please give me a hint?
Thank you and have a nice day.
Bruno-
This topic was modified 11 months ago by
BrunoPicard.
-
This topic was modified 11 months ago by
BrunoPicard.
Attachments:
You must be logged in to view attached files. -
This topic was modified 11 months ago by
-
20 June 2024 at 22:49 #30844
Hi,
You have set the filezilla whit the correct parameter?
Bye Renzo -
21 June 2024 at 07:51 #30850
Hi Renzo,
Thanks for the feedback 🙂
Filezilla is well configured: upload to SD CARD works perfectly. It’s the same using WinFTP.
With the same settings, FTP works with another project that uses flash memory storage.The only changes to Arduino_esp32_SD.ino are :
#include <WiFi.h>
becomes
#include <ESP8266WiFi.h>
and
SPI.begin(14, 12, 15, 13); //SCK, MISO, MOSI,SS if (SD.begin(13, SPI)) {
becomes
#define CS_PIN D8 [...] if (SD.begin(CS_PIN )) {
-
This reply was modified 11 months ago by
BrunoPicard.
-
This reply was modified 11 months ago by
BrunoPicard.
-
This reply was modified 11 months ago by
BrunoPicard.
-
This reply was modified 11 months ago by
BrunoPicard.
-
This reply was modified 11 months ago by
BrunoPicard.
-
This reply was modified 11 months ago by
-
24 June 2024 at 10:30 #30866
Hi,
I traced the code and found out why the file is empty. The file.read() function always returns nb=0. Now I just need to find out why…
boolean FtpServer::doRetrieve() { if (data.connected()) { int16_t nb = file.readBytes(buf, FTP_BUF_SIZE); if (nb > 0) [...]
-
24 June 2024 at 11:47 #30867
I can confirm that this is a bug in the SimpleFtpServer librairy, so there’s no need to check the FTP client settings.
-
27 June 2024 at 13:12 #30871
Hi, the
stream.readBytes
must return the number of bytes read, as the documentation specifies, so I think it’s an ESP core temporary bug.
But I check better next.
Thanks for your feedback, RM -
27 June 2024 at 13:43 #30873
Hi, This is not a core bug.
-
-
AuthorPosts
- You must be logged in to reply to this topic.