-->
Page 1 of 2

Issues with nodemcu FATfs module

PostPosted: Sat Sep 30, 2017 10:53 am
by thePiGrepper
I'm using the nodeMCU environment to write some lua script for the ESP8266. It uses the FATfs module to create several files, like:
LOG_xxxxyymmdd_hhmmss.txt where: xxxx: #file(incremental), and the rest is a timestamp.

I was running a test: creating one file,filling it with small amount of data(~200bytes), closing it, and repeating this for X time. After the first hour had passed, the files stopped being created. here is the list of files created successfully:
https://pastebin.com/0xn3MBQt , and here are some filenames it couldnt create after those files were created: LOG_0193000101_005909.txt
LOG_0194000101_005908.txt
LOG_0000000000_000000.txt
LOG.txt

I'm really troubled by this. Is there some kind of filename size limit so that when searching for files during open(), it returns error because of ambiguity or something like that?? If anyone has a clue about this, please tell me so I can test it. thanks

PD: maybe there's some kind of filename size limitation from the filesystem itself. I dont understand why is this happening. any clue?

Re: Issues with nodemcu FATfs module

PostPosted: Mon Oct 02, 2017 3:29 pm
by schufti
ancient FAT FS had a limit of (254 ???) files in the root; maybe the lib is too close to the original.
Try moving your data to a subdirectory.

Re: Issues with nodemcu FATfs module

PostPosted: Mon Oct 02, 2017 4:08 pm
by marcelstoer
schufti wrote:Try moving your data to a subdirectory.


Not quite...http://nodemcu.readthedocs.io/en/latest/en/sdcard/

Accessing files on external SD cards is currently only supported from the file module. This imposes the same overall restrictions of internal SPIFFS to SD cards:

  • no support for sub-folders
  • no timestamps
  • no file attributes (read-only, system, etc.)


SPIFFS has no notion of (sub) folders even though a file name like '/foo/bar.txt' would make you think that '/foo' be a directory.

Re: Issues with nodemcu FATfs module

PostPosted: Mon Oct 02, 2017 6:29 pm
by rudy
thePiGrepper wrote:PD: maybe there's some kind of filename size limitation from the filesystem itself. I dont understand why is this happening. any clue?


I think there is a limit in name size. I'm pretty sure I saw that and made sure the path/filename was not too long. I am not certain what the current situation is.