Cardputer SD-Card issues / how to format?
-
Hello,
it's a really fun device, but I somehow struggle to get the SD-card working…
Tried Uniflow2.0 and it all works - except the SD.
No matter what I try, I always get:
Traceback (most recent call last):
File "<stdin>", line 74, in <module>
File "<stdin>", line 47, in loop
OSError: [Errno 19] ENODEVUsing the CLI:
>>> os.listdir("/")
['system', 'flash']So the SD isn't seen.
I tried formating on OSX, OSX (Terminal), in Win10, Fat16 / FAT 32.
Both with a 8GB Card and two small 128MB cards.Is there a known good sample sketch to handle the SD in Cardputer to format / get Infos?
I am using PIO, but I guess that can broadly be be considered "Arduino IDE"?
-
What code are you using?
-
@ajb2k3 said in Cardputer SD-Card issues / how to format?:
What code are you using?
Basically just UIFlow2 > SDCard > listdir
Or the CLI in UIFlow for the os.listdir()
-
Hello @Brainzilla
try adding the
Init SDCard with
block before accessing the SD card. See below.Thanks
Felix -
it seems that there is something happening.
#1 Started with card
File "<stdin>", line 18, in <module>
File "<stdin>", line 11, in setup
OSError: [Errno 22] EINVAL#2 Removing the card
File "<stdin>", line 18, in <module>
File "<stdin>", line 9, in setup
File "hardware/sdcard.py", line 19, in SDCard
OSError: [Errno 116] ETIMEDOUT: ESP_ERR_TIMEOUT#3 Running it again
File "<stdin>", line 18, in <module>
File "<stdin>", line 9, in setup
File "hardware/sdcard.py", line 16, in SDCard
OSError: (-259, 'ESP_ERR_INVALID_STATE')Inserting the card back at runtime changes the error back to #1
Pretty sure the solution lies somewhere in correctly formatting the card.
That's why I would like to format it with the ESP itself. -
OK, it works now.
Seems there was a <space> in the "empty" listdir path facepalmAnd it does require the SD card init block as you suggested.
I thought that would be included in the "init built-in hardware" step, but the code shows otherwise.Even hot-swapping multiple works – neat.
Thank you so much!
-
I'm glad to hear the issue is resolved! The SD card initialization step is indeed essential. For future troubleshooting, make sure the SD card is properly formatted and always include the initialization code in your sketch. If you run into similar issues, checking for hidden characters or formatting errors on the card can also be helpful. Thanks for updating us on the solution!