Is there anyone mount Sdcard successfully on ESP32 ??

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
wasdwasd0105
Posts: 3
Joined: Tue Feb 06, 2018 7:27 pm

Is there anyone mount Sdcard successfully on ESP32 ??

Post by wasdwasd0105 » Wed Feb 07, 2018 2:34 pm

I have tried few days on mounting the sdcard using the official driver https://github.com/micropython/micropyt ... /sdcard.py
(One this document,it does not show the information for ESP32) It keeps on failing showing message "OSError: no SD card". I have tried different spi order. So, is there anyone mount this sdcard successfully?

ALSO, on the ESP32 module, it contains the SDIO interface, however the official micropython doesn't provide a driver. So is it possible to add one?

symac
Posts: 11
Joined: Thu Jan 04, 2018 2:01 pm

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by symac » Tue Mar 20, 2018 8:35 am

Just like you, I am quite new to micropython on esp32 and the first step for my project was/is to be able to read the content of a SD card and I am stucked there. I am still trying different pins configurations but for the time being, I always get the no sd card message.
Will update this thread if/when I am able to get something to work, but it would be great to have a precise howto regarding this point.

OutoftheBOTS_
Posts: 516
Joined: Mon Nov 20, 2017 10:18 am

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by OutoftheBOTS_ » Tue Mar 20, 2018 9:53 am

There is a number of different ports for MicroPython on ESP32. I am using the unofficial one known as the the Laboris port. I have not had a problem with using the SD card with it in both 4 line mode and 1 line mode and do believe SPI mode has now been added to the port as well.
see laboris port wiki for info https://github.com/loboris/MicroPython_ ... ilesystems

symac
Posts: 11
Joined: Thu Jan 04, 2018 2:01 pm

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by symac » Tue Mar 20, 2018 10:15 am

OutoftheBOTS_ wrote:
Tue Mar 20, 2018 9:53 am
There is a number of different ports for MicroPython on ESP32. I am using the unofficial one known as the the Laboris port. I have not had a problem with using the SD card with it in both 4 line mode and 1 line mode and do believe SPI mode has now been added to the port as well.
see laboris port wiki for info https://github.com/loboris/MicroPython_ ... ilesystems
Thanks for this lead. I will have a look at it tonight as "Loboris" seems to be something that is mentioned in other threads I have read regarding sdcards and micropython. Knowing it also works for you, confirms I need to have a look at it.

LoRaTracker
Posts: 30
Joined: Sat Feb 25, 2017 8:24 am

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by LoRaTracker » Tue Mar 20, 2018 12:56 pm

Not directly related but I was just testing a micro SD card setup on a NodeMcu32s under Arduino.

The ESP32 hardware seems fussy about the type of SD card, the one I was intially testing with was not recognised at all, but it works fine on say a Arduino Pro Mini.

There have been quite a few comments on some SD cards not mounting with ESP32 Arduino port.

symac
Posts: 11
Joined: Thu Jan 04, 2018 2:01 pm

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by symac » Wed Mar 21, 2018 5:27 am

Just tried to see if I got more luck using Loboris port and for the time being I am stucked. If someone reading this thread managed to use the SPI mode for a sdcard adapter, don't hesitate to commend on the edicated thread

rogierlodewijks
Posts: 5
Joined: Sat Jul 15, 2017 7:13 pm

Re: Is there anyone mount Sdcard successfully on ESP32 ??

Post by rogierlodewijks » Thu Apr 05, 2018 11:25 am

Don't know if this helps, but this code works for me, using the loboris uPy fork and using a FAT32 formatted SD card!

[code]
import uos
uos.sdconfig(uos.SDMODE_SPI, clk=14, mosi=15, miso=2, cs=13)
uos.mountsd(True)
uos.listdir()
[/code]

The pinning is for one of my ESP32 board (a TTGO with the 18650 battery on the back), so adjust pinout for your board.

Post Reply