LittleFS not showing uploaded files (2)

Using a ESP8266 NodeMCU LUA CP2102 ESP-12E. First time with littleFS having previously used SPIFFS.

Installed the "ESP8266 LittleFS Data Upload", seems to work:

[LittleFS] data    : /home/andy/Arduino/oiltank3/data
[LittleFS] size    : 2024
[LittleFS] page    : 256
[LittleFS] block   : 8192
/ssid.txt
/settings.txt
[LittleFS] upload  : /tmp/arduino_build_348749/oiltank3.mklittlefs.bin
[LittleFS] address : 0x200000
[LittleFS] reset   : --before default_reset --after hard_reset
[LittleFS] port    : /dev/ttyUSB0
[LittleFS] speed   : 115200
[LittleFS] python   : /home/andy/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3
[LittleFS] uploader : /home/andy/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py

esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: cc:50:e3:c7:03:c2
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 2072576 bytes to 2793...
Writing at 0x00200000... (100 %)
Wrote 2072576 bytes (2793 compressed) at 0x00200000 in 0.2 seconds (effective 66558.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

V similar topic here https://forum.arduino.cc/t/littlefs-not-showing-uploaded-files/704027

Borrowed the function void littleFsListDir(const char * dirname) in the link:

void littleFsListDir(const char * dirname) {
  Serial.printf("Listing directory: %s\n", dirname);

  Dir root = LittleFS.openDir(dirname);

  while (root.next()) {
        File file = root.openFile("r");
        Serial.print(" FILE: ");
        Serial.print(root.fileName());
        Serial.print(" SIZE: ");
        Serial.println(file.size());
        file.close();
        }
Serial.println("");
}

and ran it in my setup function to try and find my files:

  LittleFSstart();   // start the file system 
  Serial.println("list empty dir");
  littleFsListDir("");
  Serial.println("list root dir");
  littleFsListDir("/");
  Serial.println("list data dir");
  littleFsListDir("/data");

no sign of settings.txt or ssid.txt in the serial output (format.txt is a file I had previously created):

list empty dir
Listing directory: 
 FILE: format.txt SIZE: 17

list root dir
Listing directory: /
 FILE: format.txt SIZE: 17

list data dir
Listing directory: /data

I did find this on the web:

Before you upload data to LittleFS make sure to put your NodeMCU into flashmode (do this by: hold flash and reset, then release flash) When you have done these steps, just reboot your NodeMCU. And plug it back into your OTGW, and hook it up.

No idea if this is relevant or exactly what it means.

What am I doing wrong?

I still use SPIFFS even if depreciated, but:

Install ESP8266 NodeMCU LittleFS Filesystem Uploader in Arduino IDE | Random Nerd Tutorials

I followed the instructions posted (at that site and others), otherwise I would have not got the output previously posted, so not helpful.

Now reverted to what I did previously, use ftp.

  • I was using ESP8266FtpServer, but that is hard coded for SPIFFS - it will work if you go through the code and replace SPIFFS with LittleFS and there is a further change to stop it chopping the first character in filenames (to delete /). So not using that.

  • FTPClientServer looked promising, but that failed to compile

https://github.com/dplasa/FTPClientServer/issues/20

  • So ended up using SimpleFTPServer, that works, gives warnings on compile.
warning: 'packed' attribute ignored for field of type 'uint8_t [1024]' {aka 'unsigned char [1024]'} [-Wattributes]

One wins a few, loses more; but I made an effort. I am now familiarizing myself with:
https://github.com/littlefs-project/littlefs/blob/master/DESIGN.md

But, the fact remains that SPIFFS is still in the ESP8266 Arduino core. Depreciated does not mean worthless.

Anyway, glad you found a work-around. randomnerdtutorials.com generally has a good record for instructions and usage. As with many problems I and other members attempt to solve in this forum, every PC environment is different: always a best-effort at solving inquiries.

Ray

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.