Getting Started with ESP32 and the ESPixelstick FW

Here's the latest output...
I do not get the corrupted dir pair when I build through the IDE. I used to before I updated the ESP32FS tool to the latest. It is the latest, and I do select LittleFS when I do the file system upload... Like banging my head against the wall....



[ ESP] ESPixelStick v4.x-dev (Jan 27 2022 - 20:03:14)
[ ESP] v4.4-beta1-189-ga79dc75f0a
./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}
E (39) esp_littlefs: mount failed, (-84)
E (39) esp_littlefs: Failed to initialize LittleFS
[ 50][E][LittleFS.cpp:94] begin(): Mounting LittleFS failed! Error: -1
[FileMgr] *** Flash file system did not initialize correctly ***
[FileMgr] SD Card Size: 29818MB
[FileMgr] > System Volume Information
[FileMgr] WPSettings.dat - 12
[FileMgr] IndexerVolumeGuid - 76
[FileMgr] Owen.fseq - 391748
[FileMgr] UGA.fseq - 767108
[ 936][E][vfs_api.cpp:22] open(): File system is not mounted
[ 937][E][vfs_api.cpp:22] open(): File system is not mounted
[ 993][E][vfs_api.cpp:22] open(): File system is not mounted
[FileMgr] ***Configuration File: '/output_config.json' Could not open file for writing..***
[OutputMgr] *** Error Saving Output Manager Config File ***
[ 1012][E][vfs_api.cpp:22] open(): File system is not mounted
[ 1018][E][vfs_api.cpp:22] open(): File system is not mounted
[FileMgr] ***Configuration File: '/input_config.json' Could not open file for writing..***
[InputMgr] *** Error Saving Input Manager Config File ***
[FileMgr] ERROR: Cannot open 'wificonfig.json' for reading. File does not exist.
[FileMgr] SD file: 'wificonfig.json' not found.
[ 1052][E][vfs_api.cpp:22] open(): File system is not mounted
[FileMgr] ***Configuration File: '/config.json' Could not open file for writing..***
[WiFiDrv] WiFi Entering State: Connecting Using Default Credentials
[WiFiDrv] Using DHCP
[WiFiDrv] Connecting to 'heldWireless' as esps-E415F9A3C9C8
[WiFiDrv] WiFi Entering State: Connected To AP
[WiFiDrv] Connected with IP: 192.168.86.38
[ WebMgr] Web server listening on port 80
[ FPPD] Listening on port 32320
 
I compared the 2 complier outputs (PlatformIO and IDE) and the differences seem inconsequential:
  • PlatformIO autodetects the 4MB flash size (already configured in IDE)
  • PlatformIO erases the flash locations sequentially, IDE jumps around a bit
  • Slightly different program sizes at 2 of the flash locations - this seems odd to me, but matches what Martin posted
    • 17088 vs 17104 at 0x00001000
    • 1080176 vs 1079488 at 0x00010000
  • Slightly different compression and upload times
  • PlatformIO programs the flash locations sequentially, IDE jumps around a bit
 
I started over... downloaded the latest Martin branch from github... added my secrets.h... copied in my user.ini... uncommented the #include secrets.h...

Same results - little F's not happy when loading from Platform IO.... little Fs happy when loading from the IDE (it couldn't read the SD card though until I remembered to go uncomment my board in GPIO_Defs...

Not sure where to go here.... I have a ESP32-CAM and and a LOLIN D32 Pro - would trying to build on them help diagnose the issue?
 
I'm not sure if this will be any help. I had similar issues when I was playing around with adding the SD Card on the ESP8266 and D1miniESP32.

I managed to get this working by using 16GB cards formatted in Fat32 The 32 cards I was trying at first would only format exFat and couldn't be read.

Confirm the pin selection is correct in the software. My SD card shields needed to be changed to Pin5 on the admin page.
On the Device setup page on output two - I changed it to Remote and when I pressed save and rebooted the board, the file management option became available.

Might not be related to your issue, but the symptoms where very similar to your issue.
 
Martin - I assume for the Lolin D32 Pro I set the environment to d32_pro? I gave it a quick go but it seems I need to pull a pin high/low or something to program, it times out trying to connect. It did autodetect the COM port which is positive. I will look at that tonight.

On my mini board I had to either put a capacitor between RST and GND or pull IO0 low to program it (I was using the capacitor out of convenience - with IO0 low it wouldn't boot - it would be waiting for a file upload so I would remove the resistor after programming; the capacitor I can just leave there)

Townshend - thanks for the suggestion. I will look more into that once I see if I can get the Lolin working. I didn't think its' SD card related because even with the liffle Fs errors, it's reading what files are on the SD card, but some of this seems like black magic so who knows!
 
Hi Chris.

Yes the device is d32_pro

For the LoLin D32 PRO card, for both the Arduino and PlatformIO IDEs all I do is connect a usb cable to the card. No manipulation of GPIO-0 is needed. The card uses the RTS DTR signals from the built in UART to drive GPIO-0 as needed. Dont add anything to that pin. I did not use com port auto detect. I specify the ports in my PlatformIO users file.

You are correct, internal flash and external SD card use different pins/signals to access the respective devices.
 
Last edited:
I assume for the Lolin D32 Pro I set the environment to d32_pro? I gave it a quick go but it seems I need to pull a pin high/low or something to program, it times out trying to connect. It did autodetect the COM port which is positive. I will look at that tonight.

If there is an SD Card installed on your D32 Pro then remove it and try the upload again. I have to do this on my ESP32 TTGO-T8 boards and perhaps the Lolin D32 is the same.

If you decide to use Platformio for uploading, and get tired of having to jump back to the Arduino IDE for the LITTLEFS data flashing, then see this:
https://github.com/forkineye/ESPixelStick/issues/451
If you add the LITTLEFS script (highly recommended) you will never have to leave Platformio to build/flash your ESP32 devices. One stop shopping, so to speak.


- Thomas
 
If there is an SD Card installed on your D32 Pro then remove it and try the upload again. I have to do this on my ESP32 TTGO-T8 boards and perhaps the Lolin D32 is the same.
I have not had this issue. I upload a new image with the SD Card plugged in all the time.
 
I've got it working! I know how, but I don't know why.... LOL.
The D32 pro had the same issues for me as the D1 mini. I did need to pull IO0 low to get it to program. Looking online it seems this could by my laptop's issue. Some people use a USB hub and the problem goes away... Weird.
SD card being installed or not has no effect.

To get it working, I followed Thomas's instructions above and if I upload the file system through Platform IO all is good!!!

This is consistent with both the mini D1 and the D32 pro. After I had it working with Platform IO to confirm I hadn't fixed it some other way I went back to the IDE, did the little F's upload, reboot, little F's can't mount. Went back to Platform IO, just did a Filesystem load, reboot, all is good with the world.

I'm happy I can get things working by ignoring the IDE. The engineer in me wants to understand why I have issues with the IDE, but I'm going to drop that for a bit and instead focus on making pixels flash. :)

Thank you much Martin and Thomas for your help!!!

If you have any suggestions on why if I build and load through the IDE, I can do the file system load through the IDE; but I can't load the file system through the IDE if I do the build and load through Platform IO it would be a good learning opportunity for me.
 
If you have any suggestions on why if I build and load through the IDE, I can do the file system load through the IDE; but I can't load the file system through the IDE if I do the build and load through Platform IO it would be a good learning opportunity for me.

My best hunch is that the build partition sizes are not exactly the same on the two build platforms. For example, check the "board_build.partitions" environmental condition stated in platformio.ini. If the Arduino IDE does not use the same partition specs then that can cause grief if you use it to upload data files to the Platformio flashed device.

To get it working, I followed Thomas's instructions above and if I upload the file system through Platform IO all is good!!!

That's fantastic news. Plus now you can skip the Arduino IDE and do everything in Platformio.


- Thomas
 
Last edited:
I've got it working! I know how, but I don't know why.... LOL.
The D32 pro had the same issues for me as the D1 mini. I did need to pull IO0 low to get it to program. Looking online it seems this could by my laptop's issue. Some people use a USB hub and the problem goes away... Weird.
SD card being installed or not has no effect.

To get it working, I followed Thomas's instructions above and if I upload the file system through Platform IO all is good!!!

This is consistent with both the mini D1 and the D32 pro. After I had it working with Platform IO to confirm I hadn't fixed it some other way I went back to the IDE, did the little F's upload, reboot, little F's can't mount. Went back to Platform IO, just did a Filesystem load, reboot, all is good with the world.

I'm happy I can get things working by ignoring the IDE. The engineer in me wants to understand why I have issues with the IDE, but I'm going to drop that for a bit and instead focus on making pixels flash. :)

Thank you much Martin and Thomas for your help!!!

If you have any suggestions on why if I build and load through the IDE, I can do the file system load through the IDE; but I can't load the file system through the IDE if I do the build and load through Platform IO it would be a good learning opportunity for me.


Some windows 10 laptops do have known issues . USB Power surge is one in particular . My wife's work laptop (Gov. issued) suffers this and plays havoc from time to time with wireless keyboard/mouse dongles .
 
Last edited:
My best hunch is that the build partition sizes are not exactly the same on the two build platforms. For example, check the "board_build.partitions" environmental condition stated in platformio.ini. If the Arduino IDE does not use the same partition specs then that can cause grief if you use it to upload data files to the Platformio flashed device.
That would make sense, but this may be a little over my head...

platformio.ini has this: board_build.partitions = min_spiffs.csv
in my boards.txt file which is what I think the IDE uses it has: mhetesp32minikit.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs

I compared the min_spiffs.csv file in the ArduinoData folder and the .platformio folder and they match. Also, the different starting memory addresses being written to in the build were the same as well when I compared the serial monitor logs...
 
Just in case it's set to the wrong partition size, check the Arduino IDE settings. The Partition type is chosen in the Tools->Partition Scheme setting.

Interesting problem. Wish I had more suggestions. I suspect someone will figure it out and explain what is going on. That would put this hair pulling oddity to rest.

- Thomas
 
Am I missing it? I don't see any real detail here.
Good question. I abandoned the Arduino IDE when I migrated to ESP boards, so those ESP32 build choices are a mystery to me. However, I would choose the entry that says "Minimal SPIFFS (Large Apps with OTA)"). Perhaps that is the equiv of Platformio's min_spiffs.csv partition file. Or maybe not.

- Thomas
 
That was it! I changed the partition scheme in the IDE from default spiffs to minimal spiffs and no more error messages! Case closed.

Thanks again everyone.
 
Back
Top