-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDCard file manager does not show size of SDCard #21830
Comments
With a 2 GB SD card, I'm seeing: |
Thanks for answering so quickly! Yes, the card is FAT32 formatted but it is 8 GByte, this might be a problem. However, I can still put stuff on it while on my desktop machine (Linux Mint) and am able to download a file even from a folder but I can not upload anything via the Tasmota file manager while in SDCard mode, I am able to upload (small enough) files to the built in flash. Just in order to test, I reformatted the SDHC with Linux's disk manager but apparently it is not possible to "shrink" the "volume" or partition only a part of the card. As it is hard already to buy SDCards that are that "small", I hope there will be a solution somehow. Another really minor thing (that I have to say only as I am an UI developer and Tasmota is already great so I hope to improve): In File manager, the switching to internal flash (and back to SDCard) works by clicking on "SDCard" because it contains a link. However, we have to click the link "SDCard" to get away from the SDCard. This might be a little confusing for beginners. Maybe just show where we are as text wothout link and then add a "toggle" button? |
The issue you encounter is not caused by Tasmota. Tasmota uses the provided functions from Arduino for accessing SD Card. The issue should be opened at espressif32 github. |
Thank you but sorry to come back, do you mean this repo? https://github.com/tasmota/platform-espressif32 I could not find Espressif's github aparently.. glad for any help! |
No espressif Arduino repo. This one https://github.com/espressif/arduino-esp32 |
Over 32 GB would be where I'd "expect" trouble with FAT32, not smaller than that. I have a vague recollection of some brands working better than others, but do not remember details. Here's what I got after formatting an 8 GB FAT32 partition on a 128 GB SD cart using Gnome Disks under Linux: One risk zone may be if your setup can't deliver good power to the SD card. |
I have 16Gbyte SD Cards from Sandisk which work perfectly fine with PC and mobile Phone. |
@Jason2866 that means 16 and 32 GByte SDCards do not only show up in Tasmota's file manager but are writeable as well? Also thanks for the right repo! @sfromis many thanks I'll examine both of your hints! I am connected to a USB power supply that is able to serve about 65 W in total.. but I will add a beefy electrolytic capacitor just to test / and test with PoE, maybe that changes the outcome. |
The power situation is not "just" about your power supply or an added decoupling capacitor, but also how much is available at 3.3V, from the voltage regulator. Basically about the total power budget at that potential, and a SD card (with the MCU running) might even need 100 mA, but power consumption can vary a lot across different cards. |
I don't believe power supply is the reason for showing "0". |
Maybe updating the Arduino core to the newer maintained libs from https://github.com/greiman/SdFat/tree/master solves the issues? Interesting post from greiman about which tool should be used for formatting |
Thanks to all of you: I tested various SDCards: 8, 16 GB from Intenso, one 32 GB from Sandisk, all show the same (0,000 MB), even if I use PoE, no other current consumption. I'm also using Tasmota on a "Cheap Yellow Display" but could not make the SDCard run there, despite swapping software serial around. What confuses my a little is that on the Olimex, I am using I2C (SCL, SDA) to access the SDCard, the Cheap Yellow Display seems to connect the SDCard with SPI: SCLK 18, MISO 19, MOSI 23, CS 5. May I need to ise I2C but then what is SDA, what is SCL? |
SD Cards are connected via SPI. There is a nice wiring diagram here https://github.com/espressif/arduino-esp32/tree/master/libraries/SD |
I'd not expect I2C to be relevant to using a SD card from Tasmota. What is that "I am using" based on? Did you configure I2C pins for the SD card? Silk screen labeling on the board tells nothing, as ESP32 allow basically any pin anywhere (except for analog and Ethernet). Also, it is not too uncommon that SPI pins are labeled SDA/SCL for MOSI/CLK. Inserting the 128/8 card mentioned already in a "CYD family" Sunton ESP32-8048S070 showed it working there too. Not sure what you mean by "swapping software serial around", software serial is not used on ESP32. Another detail. I've seen issues inserting a SD card, but working after re-seating the card. There seemed to be a bit of transverse wiggling room in the spring-less socket. |
Yes, and the protocol shows the Olimex board understood: 00:00:00.001 HDW: ESP32-D0WDQ6 v1.0
00:00:00.036 UFS: FlashFS mounted with 304 kB free
00:00:00.054 CFG: Loaded from File, Anzahl 53
00:00:00.066 QPC: Count 1
00:00:00.070 I2C: Bus1 using GPIO16(SCL) and GPIO13(SDA)
00:00:00.133 UFS: SDCard mounted (SDIO 1-bit) with 0 kB free
00:00:00.134 SCR: ufilesystem found
00:00:00.172 BRY: Berry initialized, RAM used 3184 bytes
The "CYD" needs three SPI busses, two hardware busses are available and normally are being used for display (mandatory) and touchscreen. I tried to connect the touchscreen chip via "SSPI" (software SPI) so I had a hardware SPI to offer to the SDCard.. |
To track down where exactly the problem is the IDF example should be used with the problem SD Cards. If this works the issue is in Arduino code (which is an layer over IDF and uses the functions from IDF via APIs). If not IDF does not support "some" cards |
OK I will try to "go back" to Arduino and report. It might take a little while.. thanks to all of you! |
But yes, wrong configuring GPIOs can end in half working SD Card |
The Olimex only offers pins 2 (which I interpret as "chip select", maybe wrongly so?), then pin 14 (Clock, obvious) and then pin 15 where I am unsure whether to configure it a s MOSI or MISO.. I tried several permutations but I am back to this to make it work: GPIO2: SDIO D0 I'll try the official formatter next.. |
I'll give you an update: I installed micropython 1.23 fpr ESP32 on the same Olimex board. Wifi and Ethernet work. As an example, I provided an empty, FAT32 formatted SDHC of 4GBytes, it contained just an empty folder and a file in it. Micropython is able to read and write the disk. In order to query the total space, I have to do this
The third integer ist the total size, meaning 4096 * 968088 = 3781,594 MBytes. So, I would conclude that mPy is able to read the value. According to the latest release notes here: https://micropython.org/download/OLIMEX_ESP32_POE/ it seems to use IDF version v5.0.5 or v5.2. Not exactly sure if that gives you the right hints. If there is a debug version to install or other debug method, I would be happy to use it.. |
I will look as well. I'm wondering if it's linked to some weird formatting options. Since all your SD cards show the same problem, it could be linked to the way you formatted them in the first place. How did you proceed? |
Different devices but I guess, most of them Linux. I will try the official formatter on Windows but I am on my way to a week of holidays, will report back. Thanks so far! |
PROBLEM DESCRIPTION
On Tasmocompiler, I've compiled (german language) Tasmota32 for my Olimex ESP32-POE (chip is ESP32-D0WDQ6 v1.0), Ethernet works and it is able to use my SDCard, can read Bosch sensors (compiled it that way). So far so good.
It does also display files on the SDcard and in the filemanager, I am able to switch between both filesystems. When browsing built-in flash, the size is shown correctly (304 kByte) but when the contents of the SDCard is supposed to be shown, it reads only "Größe 0,000 MB - Frei 0,000 MB [SDCard]"
I hope I can attach a screenshot.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
EXPECTED BEHAVIOUR
Should state something like 4.00 GByte
SCREENSHOTS
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: