ESP32 #63: Micro SD Card (SDHC)

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • Using the #ESP32 and a Micro SD Card Adapter to manipulate the contents of a SDHC Card.
    ESP-IDF Example with FileIOTests and writing random bytes
    github.com/pcb...
    Development Environment
    ubuntu 17.10 64 Bit (www.ubuntu.com/) (for videocapture and -editing switch back from wayland to unity :( )
    Eclipse Oxygen (www.eclipse.org/)
    esp-idf commit 2c95a77cf93781f296883d5dbafcdc18e4389656 Tue Oct 24 10:02:51 2017 +0800 (github.com/esp...)
    xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-61-gab8375a) 5.2.0 (dl.espressif.c...)
    Arduino 1.8.4 (www.arduino.cc/)
    arduino-esp32 commit 07685903321a1968174f1a5027be88adb77b8817 Wed Oct 25 12:11:01 2017 +0200 (github.com/esp...)
  • НаукаНаука

Комментарии • 45

  • @paborralho
    @paborralho 6 лет назад +1

    thanks, those videos are very important for starters, it gives us confidence.
    One Note, that might help others: My sd card reader uses 5v, I tried and connected it to ESP pin 19 (5v Vin) and it works, meaning that esp 5vin is connected to the 5v micro usb plug.

    • @luiscosme8346
      @luiscosme8346 5 лет назад

      Hi! Saludos desde México.
      Exelent note.
      that was my error.
      I already subscribed to your channel :)

  • @alidollar1994
    @alidollar1994 6 лет назад +3

    Your videos are amazing, really appreciate your work.

  • @pedrocavaglieri
    @pedrocavaglieri 6 лет назад

    Thank you so much!!! Always helping me.
    Greetings from Brazil.

  • @paulkirchhof9546
    @paulkirchhof9546 3 года назад +2

    Where did you define the Pins of Ss,MOSI , MiSo and SCK ?
    Is there a SD.begin(parameter1......) to fix problems?

    • @joaomorais2633
      @joaomorais2633 2 года назад

      Have you found the answer? I can't seem to get my module working on a TTGO because I don't know how to define the pins (guessing that's whats wrong but not sure)

  • @bairongarcia2498
    @bairongarcia2498 4 года назад

    Thanks for your work!

  • @mairswartz
    @mairswartz 6 лет назад

    very good video. Thanks

  • @GfastGao
    @GfastGao 6 лет назад

    5:40 API Keys for people such as me is really helpful.

    • @pcbreflux
      @pcbreflux  6 лет назад

      +Gfast Gao Hi, add also a Arduino example using the core functions to test the IO speed github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_SDCard_Test

  • @uforex911
    @uforex911 6 лет назад

    Hi, so this is basically how you integrate Arduino code and ESP-IDF on Eclipe? It will be awesome if you are gonna make this kind of videos in the future! I am learning a lot more. Thank you so much!

    • @pcbreflux
      @pcbreflux  6 лет назад

      Don't be sure if you seen this ? ruclips.net/video/XgAIaVV39tk/видео.html

  • @kakoulidisioannis2127
    @kakoulidisioannis2127 6 лет назад +1

    Great projects you should try to make the esp32 deuther

  • @hungletri9769
    @hungletri9769 4 года назад

    i have a problem, Serial moniter alway show : "Card Mount Failed". i try connect Hspi or vspi but both it is error!

  • @08Downhill
    @08Downhill 6 лет назад

    And if on my adapter memory cards other pins. You have 3v3; cs;mosi;cls;miso; gnd. And I have cs;sck;mosi;miso;vcc; gnd. Where do I connect sck ? instead of clk?

  • @andresaguilerah.959
    @andresaguilerah.959 3 года назад

    Hi, thanks a lot for the information. Do you know how to detect when the SD was removed o extracted and when it was put on again? for example, it is working normally and it is on, but someone wants to extract SD and does not turn off the device and then put again, so dont work well, but if i detect that was extracted i can do somethink. do you know somethink like that?

  • @MarcelOoms
    @MarcelOoms 6 лет назад

    Thanks, very interesting. The commands you gave at the end, can I use these in arduino as well, or only in the ESP-IDE?

    • @pcbreflux
      @pcbreflux  6 лет назад +1

      Yes, you can with the esp32.
      Add also this includes above your arduino sketch:
      #include
      #include
      #include
      #include
      #include
      And on arduino the filenames will look like this: "/sd/TEST.txt"
      (or you have to change the SD.begin(...) command to use a different virtual mount point)

  • @SA-oj3bo
    @SA-oj3bo 5 лет назад

    Hi Oliver! What would be the best and fastest way with Arduino to a/ download files available on the internet to the SD card, and b/ stream these files on the SD card to a browser connected to the ESP32? Thanks in advance.

  • @AndreasDelleske
    @AndreasDelleske 3 года назад

    I have tried FAT16 for a totally unrelated thing but something had been really buggy. I have to suspect Linux (Mint).

  • @samanedu
    @samanedu 4 года назад

    Thanks for this video.
    Have you been able to connect a micro SD card to the TTGO T-Call ESP32 SIM800L module since it uses pins 23 and 5 that belong to the SPI connection?

    • @roybran2
      @roybran2 2 года назад +1

      I have an ESP32 with TTGO. Tried this tutorial and the serial monitor shows "Card Mount Failed". Did you get it to connect using the SD_Test example?
      Note: My SD card slot is built into the ESP32...

  • @ThomasHaberkorn
    @ThomasHaberkorn 6 лет назад

    How to use "WiFi Direct" on the ESP32 ?

  • @klassichd10
    @klassichd10 6 лет назад

    Thanks a lot for the example using an SD Card. Does this SPI usage coexist with I2C in a friendly manner?
    I have been cloes to using a SDCard at the ESP8266 but I needed also the I2C, serial and digital inputs. So I run out of pins. and used an I2C Flash to store my (small amount of) data, The ESP32 has more Pins but I do not know if I2C and SPI would coexist friendly.

    • @pcbreflux
      @pcbreflux  6 лет назад

      With some exceptions you can freely choose the GPIO Pins on the ESP32 for the Interface, but you have to add some line to the examples, so my video only shows the simple (out of the box) way:
      for the SD Card sketch try this with arbitrary chosen pins :
      // PIN_NUM_MOSI 17
      // PIN_NUM_MISO 16
      // PIN_NUM_CLK 4
      // PIN_NUM_CS 2
      SPIClass mySPI(VSPI);
      ...
      setup () {
      mySPI.begin(4, 16, 17, 2);
      if(!SD.begin(2,mySPI,4000000,"/sd")){
      ...

    • @klassichd10
      @klassichd10 6 лет назад

      Thanks for the Response!

  • @brostech2210
    @brostech2210 3 года назад

    Can we use esp32 without Arduino?

  • @shashanksimhamr1005
    @shashanksimhamr1005 5 лет назад

    The esp-idf says that the pull-up resistors are required. How to configure them?

    • @pcbreflux
      @pcbreflux  5 лет назад

      ...
      gpio_config_t io_conf;
      ...
      io_conf.pull_up_en = 1;
      gpio_config(&io_conf);
      See example for details github.com/espressif/esp-idf/blob/master/examples/peripherals/gpio/main/gpio_example_main.c

  • @priyankaar9569
    @priyankaar9569 6 лет назад

    I am getting card mount failed in the serial monitor. What would be the reason?

    • @pcbreflux
      @pcbreflux  6 лет назад +1

      Hi, have to speculate... could be the filesystem (fat32?), the cardtype (sdhc, sdxc?), a contact problem or wrong or crossed gpio pins? Maybe the esp32 software don't work with all card types? But all my card worked, so have no clue.

  • @SA-oj3bo
    @SA-oj3bo 6 лет назад

    Hi Oliver! Can I redirect all SPI pins in Arduino to any free pin of the ESP32? Can I use 1 SPI to read/write the SD card and also read/write to a SPI sensor? How to redirect the pins and how to know if CS is used by the SPI library or by using just 2GPIO pins? Thanks.

    • @pcbreflux
      @pcbreflux  6 лет назад +1

      Hi Wim. In Arduino you can use SPI.setHwCs(false); to use software CS and
      SPI.begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) to set other
      GPIO pins. There are different way to use multiple SPI devices on one SPI master: the independent configuration (need multiple CS pins, just use a arbitrary GPIO Pin an set it by software) or the daisy-chain configuration (nor implemented in all devices and libraries, but only one CS Pin needed). I would prefer to use the independent configuration and use for CS a software logic before using SPI commands.

    • @SA-oj3bo
      @SA-oj3bo 6 лет назад

      Thanks a lot! Clear. :-)

    • @SA-oj3bo
      @SA-oj3bo 6 лет назад

      I see in arduino they use 3 libraries, #include "FS.h"
      #include "SD.h" #include "SPI.h" , what is the FS.h for please? What means s::FS &fs in void listDir(fs::FS &fs, const char * dirname, uint8_t levels) please?

    • @SA-oj3bo
      @SA-oj3bo 6 лет назад

      Do I need FS.h always to write and read to an SD card?

  • @jorostuff
    @jorostuff 4 года назад

    Germany?

  • @cad3175
    @cad3175 6 лет назад

    ..thank u

  • @thevivekmathema
    @thevivekmathema 6 лет назад

    Can you make esp32 based wireless sdcard wifi drive?

    • @Flix-f6q
      @Flix-f6q 4 года назад

      how about setting up a ftp server?

  • @andresflorez4259
    @andresflorez4259 6 лет назад

    why you speak like that???? :(