ESP32 Firebase SD_MMC

cypherap
Posts: 4
Joined: Tue Oct 17, 2023 6:57 am

ESP32 Firebase SD_MMC

Postby cypherap » Tue Oct 17, 2023 5:44 pm

Hello everyone, I'm new here, and I probably wouldn't be here if it weren't for my issue with ESP32 libraries. I'm using Firebase with the Firebase_ESP_Client library, specifically for Storage. I wanted to upload a file from the SD card. When I use the SD_MMC library, which works fine on my ESP32-CAM, as it can read and write to the card without issues. However, when I try to use it with the Firebase library, it doesn't recognize the SD card and gives me the error message "Upload failed, SD Storage is not ready. SD Storage is not ready."

If I use the SDHelper.h library, the card is visible, and I can place a file in Storage. Unfortunately, this library doesn't provide the file appending function that I need, or at least I haven't found such a command in that library. This function is available in SD_MMC.h. I've tried many things, but none of them have worked. Is there a way to make the card and files visible to Firebase Storage using SD_MMC.h, or does SDHelper actually have a file appending function?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32 Firebase SD_MMC

Postby lbernstone » Wed Oct 18, 2023 7:00 pm

I really don't know anything about those libraries (which you did not provide links for), but another option would be to read the file into psram, and then give Firebase that array. Not sure what exactly you need append for if you are uploading the file...

cypherap
Posts: 4
Joined: Tue Oct 17, 2023 6:57 am

Re: ESP32 Firebase SD_MMC

Postby cypherap » Thu Oct 19, 2023 11:10 am

I will try to explain more. I create a log file that is saved on the SD card, this file is updated after each event by adding another line of text. Then I want to send this file to firebase every hour. The SD_MMC library allows me to operate on the file, including adding subsequent lines of text. Unfortunately, the Firebase library does not see the memory card using the SD_MMC library. Firebase sees it using the <addons/SDHelper.h> library. Unfortunately, it does not allow adding subsequent lines to the file, at least I haven't found anything about it. It would be possible, of course, to read the entire file and add another line to the memory, deleting the current file and saving a new one to the SD card, but I don't know if I have enough RAM for such an operation. Especially since the file will add new lines for 24 hours.

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32 Firebase SD_MMC

Postby lbernstone » Thu Oct 19, 2023 5:15 pm

If you look through FirebaseFS.h, it has info about changing the filesystem to SD_MMC.

cypherap
Posts: 4
Joined: Tue Oct 17, 2023 6:57 am

Re: ESP32 Firebase SD_MMC

Postby cypherap » Fri Oct 20, 2023 9:11 am

I've already tried this, although I'm not sure if I'm doing it right.

Who is online

Users browsing this forum: No registered users and 132 guests