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...) - Наука
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.
Hi! Saludos desde México.
Exelent note.
that was my error.
I already subscribed to your channel :)
Your videos are amazing, really appreciate your work.
Thank you so much!!! Always helping me.
Greetings from Brazil.
Where did you define the Pins of Ss,MOSI , MiSo and SCK ?
Is there a SD.begin(parameter1......) to fix problems?
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)
Thanks for your work!
very good video. Thanks
5:40 API Keys for people such as me is really helpful.
+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
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!
Don't be sure if you seen this ? ruclips.net/video/XgAIaVV39tk/видео.html
Great projects you should try to make the esp32 deuther
kakoulidis ioannis ?
i have a problem, Serial moniter alway show : "Card Mount Failed". i try connect Hspi or vspi but both it is error!
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?
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?
Thanks, very interesting. The commands you gave at the end, can I use these in arduino as well, or only in the ESP-IDE?
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)
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.
I have tried FAT16 for a totally unrelated thing but something had been really buggy. I have to suspect Linux (Mint).
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?
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...
How to use "WiFi Direct" on the ESP32 ?
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.
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")){
...
Thanks for the Response!
Can we use esp32 without Arduino?
The esp-idf says that the pull-up resistors are required. How to configure them?
...
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
I am getting card mount failed in the serial monitor. What would be the reason?
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.
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.
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.
Thanks a lot! Clear. :-)
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?
Do I need FS.h always to write and read to an SD card?
Germany?
..thank u
Can you make esp32 based wireless sdcard wifi drive?
how about setting up a ftp server?
why you speak like that???? :(
He is German. Are you some kind of retard?