Setting up SD card on ESP32S on Tasmota 13.4.0

94 views
Skip to first unread message

Dirk Eisner

unread,
Apr 13, 2024, 2:54:51 AMApr 13
to TasmotaUsers
Hi all, I have been trying to set up an SD card on my ESP32 S3 and have some basic questions.

1. Does the standard build have the SD card reader enabled or does it need to be enabled and custom compiled?
2. I'm using a 4-line SD card module, is this supported?
3. How do I know the filesystem is present? If I run the UfsType command should I see 3 & 1.
4. Is there some instruction, somewhere?


I had a look a good search but could not find anything.

Any help would be greatly appreciated.

Regards

Justin Adie

unread,
Apr 13, 2024, 4:15:45 AMApr 13
to Dirk Eisner, TasmotaUsers
Hi

I recall SD cards being available by default in esp32 builds.  There are directives for using SD cards and one for the CS pin but again I think the first is available by default and the second is configurable at run time.  I don't have one to hand to test with.  SPI is supported on tasmota.  

If you're having trouble then make doubly sure that the SD card you are using is formatted properly first otherwise there are reports of tasmota not recognising it at all.  Formatting using OS functions does not seem to work.  This formatter has been reported as successful https://www.sdcard.org/downloads/formatter/




--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/0878b2b0-0a83-4718-846c-1372b67ad7cen%40googlegroups.com.

Philip Knowles

unread,
Apr 13, 2024, 4:26:44 AMApr 13
to Dirk Eisner, Justin Adie, TasmotaUsers
A lot of the detail required is in the UFS commands on the Commands page and in the Berry scripts.

From: 'Justin Adie' via TasmotaUsers <sonof...@googlegroups.com>
Sent: 13 April 2024 09:15
To: Dirk Eisner <dirk....@gmail.com>
Cc: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Setting up SD card on ESP32S on Tasmota 13.4.0
 

Dirk Eisner

unread,
Apr 13, 2024, 10:35:52 PMApr 13
to TasmotaUsers
Thanks Justin, that was the problem! I formatted the card in Linux and Windows and both failed. I used the above-mentioned formatter and it worked beautifully, first go. for anyone who needs to know. Here are some answers to my original question questions.

1. Does the standard build have the SD card reader enabled or does it need to be enabled and custom compiled?
A: No it is in the standard precompiled built for the ESP32 
2. I'm using a 4-line SD card module, is this supported?
A: Yes 4 lines is supported.
3. How do I know the filesystem is present? If I run the UfsType command should I see 3 & 1.
A: Yes when you run UfsType you should see 03:29:06.020 CMD: UfsType
03:29:06.028 MQT: stat/tasmota_791184/RESULT = {"UfsType":[1,3]}
4. Is there some instruction, somewhere?
I

Dirk Eisner

unread,
Apr 14, 2024, 6:55:12 PMApr 14
to TasmotaUsers
I have tested the SD_Cards and it works as expected, the only thing I noticed is that there is no size of the partition reported. I'm using a 16 GB card ( the smallest I had) and I assume that is the problem. In the file system interface, it is reported as 0, and from the command line the same.
23:53:44.975 CMD: UfsType
23:53:44.982 MQT: stat/tasmota_791184/RESULT = {"UfsType":[1,3]}
23:48:40.216 CMD: UfsSize
23:48:40.235 MQT: stat/tasmota_791184/RESULT = {"UfsSize":[0,4416]}

However, I can write to the card fine. I assume it is only a reporting issue. I'm only using a few MB but I need it as it is for an offline application.
Cheers

Philip Knowles

unread,
Apr 15, 2024, 5:26:34 AMApr 15
to Dirk Eisner, TasmotaUsers
UFS is available in all bins with more than 1MB flash (both ESP828 and 32 varieties)

The GPIOs are here

On the Scripting page Scripting Language - Tasmota it says
File System Support
#define USE_UFILESYS
optional for SD_CARD:
#define USE_SDCARD
#define SDCARD_CS_PIN X X = GPIO of card chip select
SD card uses standard hardware SPI GPIO: mosi,miso,sclk
depending on used linker file you get a flash file system with the same functionality but very low capacity (e.g. 2 MB)
A maximum of four files may be open at a time


Have you tried UfsFree? Ufs commands are in the Management section of the Commands page.

From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Dirk Eisner <dirk....@gmail.com>
Sent: 14 April 2024 23:55
To: TasmotaUsers <sonof...@googlegroups.com>

Dirk Eisner

unread,
Apr 16, 2024, 4:14:35 PMApr 16
to Justin Adie, TasmotaUsers
Thanks Justin, that was the problem! I formatted the card in Linux and Windows and both failed. I used the above-mentioned formatter and it worked beautifully, first go. for anyone who needs to know. Here are some answers to my original question questions.

1. Does the standard build have the SD card reader enabled or does it need to be enabled and custom compiled?
A: No it is in the standard precompiled built for the ESP32 
2. I'm using a 4-line SD card module, is this supported?
A: Yes 4 lines is supported.
3. How do I know the filesystem is present? If I run the UfsType command should I see 3 & 1.
A: Yes when you run UfsType you should see 03:29:06.020 CMD: UfsType
03:29:06.028 MQT: stat/tasmota_791184/RESULT = {"UfsType":[1,3]}
4. Is there some instruction, somewhere?
I



--
“What I hear, I forget;
What I see, I remember; 
What I do, I understand.”
Reply all
Reply to author
Forward
0 new messages