Getting Started with ESP32 and the ESPixelstick FW

I ordered a few different ESP32 boards to play with, and decided to first start out with the ESP32 D1 mini since it's pin for pin compatible with the hardware of the 8266 D1 mini and I could use ESPixelStick3 HW to test things out...

I downloaded the branch from Martin's github, and used the d1_mini32 environment in the sketch. I went in and changed the GPIO pins to match the layout of this board. I'm not aware of another D1_mini board on the ESP32 platform so I was surprised I had to change the GPIO pins, but will save that for another day.

When I build through the IDE, things seem to work fine, although it can't read the SD card:
[ ESP] ESPixelStick v4.x-dev (Jan 25 2022 - 21:23:02)
[ ESP] v4.4-beta1-189-ga79dc75f0a
[FileMgr] Flash file system initialized.
[FileMgr] No SD card installed
[FileMgr] Configuration File: '/config.json' loaded.
[FileMgr] Configuration File: '/output_config.json' loaded.
[FileMgr] Configuration File: '/input_config.json' loaded.
[FileMgr] Configuration File: '/config.json' saved 326 bytes.
[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

When I build through PlatformIO, it is able to read the SD card, but their seems to be a problem with the file system. I loaded the file system through the IDE both times, selecting Tools -> ESP32 Sketch Data Upload -> LittleFS, and both seem to pass.

[ ESP] ESPixelStick v4.x-dev (Jan 25 2022 - 21:32:13)
[ 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
E (948) rmt: rmt_tx_stop(274): RMT CHANNEL ERR
E (949) rmt: rmt_tx_stop(274): RMT CHANNEL ERR
E (949) rmt: rmt_tx_stop(274): RMT CHANNEL ERR
[ 1015][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 ***
[ 1035][E][vfs_api.cpp:22] open(): File system is not mounted
[ 1040][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.
[ 1075][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'm fairly new to the Arduino world and assume I'm missing something basic here and hoping you guys can help. :)
I am able to program the ES8266 just fine so I believe my setup is good.

Thanks in advance!
 
After you loaded in Platformio , what happens if you then use the IDE to load just the FileSystem ?
 
Last edited:
When you build using platformio, which platform do you build for?

For the build that worked but could not access the SD card, would you please post the modified gpio file so I can review it.
 
angus - that's what I did

Martin,
Your questions are connecting the dots for me...
In Platform IO, I built for d1_mini32
In the Arduino IDE, I built for MH ET LIVE ESP32Minikit. I also used WEMOS D1 MINI ESP32 with the same result

Platform IO gives the error on the file system although I load the file system through the IDE the same way I do when I program through the IDE
Arduino IDE gives the error on no SD card
In both cases I'm loading the file system through the IDE as LittleFS

I believe there are 2 things going on here:
- The Arduino IDE isn't using the modified GPIO config file and I need to look to see how I tie the board I select in the IDE, with the GPIO config file
- The d1_mini_32 environment isn't fully configured properly for my board, and I need to figure out how that works and what all files I need to modify. Was this environment fully setup for a specific board or is it a placeholder for this board?

I think I understand the issues enough that through Google and going through the source code more I can figure it out, but any pointers would be appreciated!

Here is a link to the modified GPIO file - I only changed the GPIO pins leaving the old IO pins as comments:
https://drive.google.com/file/d/1oTCFlNy0pgGcazmKMon21k53pJa9Eken/view?usp=sharing
 
Let me get this straight. You want to use the ESPixelStick V3 base card and put your ESP32 based D1_MINI on it. In the Arduino IDE you selected "MH ET LIVE ESP32Minikit". In GPIO_Defs you added a line that defines the symbol "BOARD_ESP32_D1_MINI" (If you dont do this then the default ESP32 gets built). Then you modified "[FONT=&quot]GPIO_Defs_ESP32_D1_MINI.hpp[/FONT]". I am concerned that you mention modifying "other source files". That should not be needed. What did you modify?

I looked at the GPIO translations you made and they look fine.

FYI: I have created a GPIO_Defs file for your board. It is available on github right now. You will need to uncomment out your platform (BOARD_ESP32_MH_ET_LIVE_MiniKit) in the GPIO_Defs file to get the build to use it.
 
Using Martin's files I'm able to build through the IDE and everything seems to be working! I will now break things as I revert back slowly and figure out what I did wrong. :razz:
I am still unable to get success building through Platform IO.

The thing I'm missing is what is different between building with the IDE and building with Platform IO. The instructions say using Platform IO is recommended, and I've observed it's much faster so I'd like to use Platform IO but I'm not sure where to look at this point.

My workflow is consistent:
1 - Build/Load in Platform IO (or Arudiono IDE)
2 - Go the IDE and perform the LittleFS file system upload
3 - Go to PlatformIO, launch the Serial Monitor
4 - Reset the ESP and observe the boot process

My understanding is the error I am getting is file system related (LittleFS fails to initialize), but that the file system should be the same since it was loaded the exact same...

More details here:
Let me get this straight. You want to use the ESPixelStick V3 base card and put your ESP32 based D1_MINI on it.
Correct. I would then use the extra rows of pins on the ESP32 D1_mini for additional outputs
In the Arduino IDE you selected "MH ET LIVE ESP32Minikit".
Correct. I have also tried using WEMOS D1 MINI ESP32 as it appears that is the board you already had defined, but same results.
In GPIO_Defs you added a line that defines the symbol "BOARD_ESP32_D1_MINI" (If you dont do this then the default ESP32 gets built).
No. That line was already there from your branch that I started with (row 93 and 94).
Then you modified "[FONT="]GPIO_Defs_ESP32_D1_MINI.hpp[/FONT][/COLOR]". [/QUOTE]Correct.
[QUOTE="MartinMueller2003, post: 548263, member: 14289"]I am concerned that you mention modifying "other source files". That should not be needed. What did you modify?
No other files were modified when I made my last post. I intended to say I think I need to modify more files but Googling more after my post I no longer think I need do. This morning I have now modified platformio.ini to add a dev environment for mhetesp32devkit. I set the build flag for it to "[FONT="]build_flags = -DBOARD_ESP32_D1_MINI[/FONT][/COLOR]" so it should use the same GPIO mapping file.
[QUOTE="MartinMueller2003, post: 548263, member: 14289"]I looked at the GPIO translations you made and they look fine. FYI: I have created a GPIO_Defs file for your board. It is available on github right now. You will need to uncomment out your platform (BOARD_ESP32_MH_ET_LIVE_MiniKit) in the GPIO_Defs file to get the build to use it.[/QUOTE]Thanks! I downloaded those 2 files. With your files, everything seems to be fully functional when I build through the IDE. I don't see any change in behavior with Platform IO though.
 
If you set the board type to d1 mini in platformIo then you have the wrong board type. You need to set it to the one I made for you.
 
I have the build targets configured in the platformio.ini and am now using mhetesp32devkit, although I think d1_mini32 should also work

; Chris's D1 Mini32
[env:mhetesp32devkit]
extends = esp32git ; use until 2.0.0 core makes it into PlatformIO
board = mhetesp32devkit
build_flags =
-DBOARD_ESP32_MH_ET_LIVE_MiniKit

; Generic Wemos D1 Mini 32
[env:d1_mini32]
extends = esp32git ; use until 2.0.0 core makes it into PlatformIO
board = wemos_d1_mini32
build_flags =
-DBOARD_ESP32_D1_MINI
 
I am in the process of adding an environment for your platform. Note the slight difference in environment name. You do not want the env name and board name to be the same.

Code:
; MH ET LIVE MiniKit
[env:d1_mini_mhetesp32minikit]
extends = esp32git
board = mhetesp32minikit
build_flags =
    -DBOARD_ESP32_MH_ET_LIVE_MiniKit
[\CODE]
 
Everything is commented out in my platform_user.ini file since the autodetect of the com port seems to work fine.
Well, everything but the line [env] is commented out just like the sample user ini file.

Happy to send but it's pretty boring. :biggrin2:
 
Does the end of the output look like this:

========================================= [SUCCESS] Took 26.25 seconds =========================================


Environment Status Duration
------------------------ -------- ------------
d1_mini_mhetesp32minikit SUCCESS 00:00:26.249
========================================== 1 succeeded in 00:00:26.249 ==========================================
 
similar....
================================================================= [SUCCESS] Took 43.85 seconds =================================================================
Environment Status Duration
----------------------- -------- ------------
d1_mini_mhetesp32devkit SUCCESS 00:00:43.855
================================================================= 1 succeeded in 00:00:43.855 =================================================================
 
And the build is using the GPIO defs file I made and running the build on an ESP results in LittleFS file access errors. I have yet to get PlatformIO to upload to my target device but I suspect I am going to see the FS getting cleared by the uploader. I initially had that issue in a version of the ESPFlash tool.
 
I finally got the platformio build to upload and can reproduce your error.

Build from Arduino IDE:
Wrote 1134544 bytes (696510 compressed) at 0x00010000 in 11.9 seconds (effective 765.7 kbit/s)...
Boots and runs just fine

Same code built and uploaded on platformio:
Wrote 1146368 bytes (704521 compressed) at 0x00010000 in 11.9 seconds (effective 773.1 kbit/s)...
Boot fails:


10:02:20.375 -> [ ESP] ESPixelStick v4.x-dev (Jan 27 2022 - 09:52:39)
10:02:20.375 -> [ ESP] v4.4-beta1-189-ga79dc75f0a
10:02:20.375 -> [FileMgr] Flash file system initialized.
10:02:20.704 -> [ 1209][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
10:02:20.704 -> [ 1210][E][sd_diskio.cpp:795] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
10:02:20.983 -> [ 1516][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00

I suspect there is a difference in the core files used

So far I have not checked the ESP8266 to see if it has an issue.
 
ESP8266 is working fine. It turns out the error messages have nothing to do with LittleFS. The are all about the fact the SD Card is not installed. When I added an SD card, all of the errors went away. Not sure why the latest core is putting up messages on a platformio build and not on an arduino build. The important thing is that other than the annoying messages, the ESP32 build is working.
 
My error is different and I do have an SD card installed. I remember it outputting some of the file names installed on the SD card.

I went in the office today but when I get home tonight will get a fresh look at the error message and post it.
 
And the build is using the GPIO defs file I made and running the build on an ESP results in LittleFS file access errors. I have yet to get PlatformIO to upload to my target device but I suspect I am going to see the FS getting cleared by the uploader. I initially had that issue in a version of the ESPFlash tool.

-Ah .......those little f's again . they haunted me ! lol :)
 
Back
Top