For years I've used the code in the EFFS-FTP example to provide easy drag-and-drop access to read or write files from a PC desktop to/from an SD card on a NB platform. On the PC I've simply added a network place pointing to ftp://NB_IP_ADDR. I've always checked the boxes in Windows to allow an anonymous ftp access, which, in these cases, is not a security risk.
Recently however, I've had intermittent trouble doing this with both XP and Windows 7 PCs. Sometimes it works fine. But sometimes Windows indicates the folder has read only access. Sometimes Windows asks for a user name and password. I have intermitent trouble reading or writing individual files, as well as directories.Again, sometimes fine, then errors appear. Next, for years, I could click on a file to open it, say with a text file or a .jpeg. Now, this works sometimes, but not always. Sometimes it fails with a given file, but will work with the same file a second later.
We've had this odd beavior with several NB modules using various SD cards, on several networks, and even direct-connected to a NB board. I believe (but not sure) that all the SD cards are formatted as FAT32. We are using long file names in all cases. The directories contain > 250 files ranging in size from 1 or 2K, to >10,000K.
Any ideas? Thanks, This is quite strange...!
How would I add user and password functionality to the EFFS-FTP example?
issues w/EFFS-FTP example??
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: issues w/EFFS-FTP example??
Hi guys: Still wrestling w/ FTP code. As indicated previously, my app uses code from the EFFS-FTP example to provide easy drag-and-drop access to allow me to read or write files from a PC desktop folder to the NB SD card. We're typically moving a ~(200 - 300)MB folder from the PC to the SD. It works, but it is slow: maybe 10 15 minutes. The folder contains ~ 250 files, each about 1 - 2MB each. Long file names are used. Any thoughts on how to make this faster would be appreciated.
Re: issues w/EFFS-FTP example??
I would suspect the sdcard rather than the ftp communication is your bottleneck. Creating and deleting files on an sdcard can be painfully slow, especially if there are already several thousand files on the card already. I had similar performance issues and using a few debug print statements traced the delay to the creation of new files on the sdcard. Some sdcards are faster than others and newly formatted sdcards are always faster than cards that already have lots of files on them.
There is no visibility into the internal workings of the effs library but if I were to guess at the root cause of the slowdown: it is likely that the effs library cant cache the entire fat for the sdcard (at least when you have thousands of files) so it needs to traverse a good portion of that info every time you create or delete a file.
There is no visibility into the internal workings of the effs library but if I were to guess at the root cause of the slowdown: it is likely that the effs library cant cache the entire fat for the sdcard (at least when you have thousands of files) so it needs to traverse a good portion of that info every time you create or delete a file.
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: issues w/EFFS-FTP example??
I suspect the SD card is part of the culprit, but not all. SD card speed ranges from a spec of 2MB/sec to maybe 15MB/sec. Granted, the one I'm using is probably old, so lets say it's the minimum of 2MB/sec. I've reformatted it using FAT32. (Tests awhile ago indicated that FAT format allowed only 256 files per directory). There are no other files on the card.
It's taking about 160 secs to transfer 34 files totallling 50MB, or just 0.3MB/sec overall.
It's taking about 313 secs to transfer 65 files totallling 100MB, or just 0.3MB/sec overall.
I wrote another directory that has 50 files, each with 0 bytes per file. That takes about 30 seconds to transfer...Creating the files takes an appreciable amount of time: in this case 0.6 sec/file. Using this figure for the files that contain data in the preceeding paragraph, creating 35 files would take 21 secs of the 160 secs total, meaning the data took 140 secs for 50MB, or still only 0.35 secs/MB.
Finally, I added a lot of other files to the card, and transferred the same 100MB directory as before. I found no appreciable time difference, so the number of files on the card seems to have little impact, at least in this case.
All these figures are far under the rated throughput for the SD card, or the network, so I'm still wondering how to speed things up. I'll try to get a fast "Ultra" rated for 15 MB/sec and report on the results.
By the way, these tests were done on a network with no other traffic, with essentially the EFFS-FTP example.
It's taking about 160 secs to transfer 34 files totallling 50MB, or just 0.3MB/sec overall.
It's taking about 313 secs to transfer 65 files totallling 100MB, or just 0.3MB/sec overall.
I wrote another directory that has 50 files, each with 0 bytes per file. That takes about 30 seconds to transfer...Creating the files takes an appreciable amount of time: in this case 0.6 sec/file. Using this figure for the files that contain data in the preceeding paragraph, creating 35 files would take 21 secs of the 160 secs total, meaning the data took 140 secs for 50MB, or still only 0.35 secs/MB.
Finally, I added a lot of other files to the card, and transferred the same 100MB directory as before. I found no appreciable time difference, so the number of files on the card seems to have little impact, at least in this case.
All these figures are far under the rated throughput for the SD card, or the network, so I'm still wondering how to speed things up. I'll try to get a fast "Ultra" rated for 15 MB/sec and report on the results.
By the way, these tests were done on a network with no other traffic, with essentially the EFFS-FTP example.
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: issues w/ sloooow EFFS-FTP access?
I tried the same FTP directory transfers to a San Disk 2Gb Ultra SD card rated at 15MB/sec.
With the default FAT format, and also with FAT32 with either 32K or 4K allocation units:
It's taking about 99 secs to transfer 34 files totallling 50MB, or just 0.50MB/sec overall.
It's taking about 205 secs to transfer 65 files totallling 100MB, or just .48MB/sec overall,
These times are up from .3Mb/sec rates I saw w/ an old 2MB (?) card, but still slow based on the card's spec.
It still took ~30 secs to create a directory of 50 files, each containing 0 bytes.
Once again, all tests used longfile names (~15char.3char) format.
Ideas on speed up?
With the default FAT format, and also with FAT32 with either 32K or 4K allocation units:
It's taking about 99 secs to transfer 34 files totallling 50MB, or just 0.50MB/sec overall.
It's taking about 205 secs to transfer 65 files totallling 100MB, or just .48MB/sec overall,
These times are up from .3Mb/sec rates I saw w/ an old 2MB (?) card, but still slow based on the card's spec.
It still took ~30 secs to create a directory of 50 files, each containing 0 bytes.
Once again, all tests used longfile names (~15char.3char) format.
Ideas on speed up?
Re: issues w/EFFS-FTP example??
Hi RG,
As a quick test and to show that the network is not a bottleneck, have you tried just the transfer going without actually doing any file access?
This would show if the issue is indeed the disk access.
Cheers,
Dave....
As a quick test and to show that the network is not a bottleneck, have you tried just the transfer going without actually doing any file access?
This would show if the issue is indeed the disk access.
Cheers,
Dave....