Can anyone help me to solve this problem?

c:\Users\User\Documents\Arduino\libraries\SD\src\sd_diskio.cpp: In function 'bool sdcard_mount(uint8_t, const char*, uint8_t, bool)':
c:\Users\User\Documents\Arduino\libraries\SD\src\sd_diskio.cpp:821:19: error: 'MKFS_PARM' does not name a type
const MKFS_PARM opt = {(BYTE)FM_ANY, 0, 0, 0, 0};
^~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\SD\src\sd_diskio.cpp:822:32: error: 'opt' was not declared in this scope
res = f_mkfs(drv, &opt, work, sizeof(BYTE) * FF_MAX_SS);
^~~

exit status 1

Compilation error: exit status 1

We can't fix what we can't see.

Post your code.

Which board are you compiling for? The standard AVR installation does not have a file called sd_diskio.cpp in its SD library.

How did you install the library; or is it part of the unknown board package?

#include <WiFi.h>
#include <FirebaseESP32.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

#define FIREBASE_HOST "aaaa"
#define FIREBASE_AUTH "bbbb"
#define WIFI_SSID "xxx"
#define WIFI_PASSWORD "yyy"

FirebaseAuth auth;
FirebaseConfig config;

#define GPS_TX 12 // GPS TX pin to ESP32 RX2 pin
#define GPS_RX 14 // GPS RX pin to ESP32 TX2 pin

FirebaseData firebaseData;
SoftwareSerial gpsSerial(GPS_RX, GPS_TX); // Create a software serial port

TinyGPSPlus gps; // Create a TinyGPS++ object

void setup() {
  Serial.begin(115200);
  gpsSerial.begin(9600); // Start the software serial port for GPS

  // Connect to Wi-Fi
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nConnected to WiFi");

  // Initialize Firebase
  Firebase.begin(&config, &auth);

  // Wait for the GPS module to start
  delay(1000);
}

void loop() {
  // Read data from GPS
  while (gpsSerial.available() > 0) {
    if (gps.encode(gpsSerial.read())) {
      if (gps.location.isValid()) {
        // Get latitude and longitude
        double latitude = gps.location.lat();
        double longitude = gps.location.lng();
        
        // Push latitude and longitude data to Firebase
        if (Firebase.setDouble(firebaseData, "/location/latitude", latitude) &&
            Firebase.setDouble(firebaseData, "/location/longitude", longitude)) {
          Serial.println("Location data sent to Firebase");
        } else {
          Serial.println("Failed to send location data to Firebase");
        }
      }
    }
  }

  // Handle errors or no data received from GPS
  if (millis() > 5000 && gps.charsProcessed() < 10) {
    Serial.println("No GPS data received: check wiring or GPS module");
    while(true);
  }

  // Wait a while before sending more data to Firebase
  delay(5000);
}

[sterretej edit]
credentials modified
[/sterretje edit]

i use esp32

I've removed the credentials that looked like real ones for security reasons.

You don't have to post code twice :wink:

1 Like

thanks bro. Do you know how to fix errors in my program?

Unfortunately not. I have an older version of the ESP32 board package installed (I can not upgrade it) and I do not see the specific file sd_diskio.cpp in there. Further I'm not a user of ESP based boards.

It's strange that the code that you posted does not include the SD library but you still get errors about it.

The location of your SD library is slightly strange as the SD library comes with the core and is not installed in c:\Users\User\Documents\Arduino\libraries as far as I know (newer ESP32 cores might be different); I'm not using Windows at this moment so can't verify. So the question (for me) is still which library you did install.

Post a link to where you found this code.

Which exact type of ESP32?

  • ESP32?
  • ESP32-S2?
  • ESP32-S3?
  • ESP32-C3?
  • ESP32-C6?

post two pictures upside and downside of the ESP32-board if you don't know

why would you use SoftwareSerial on an ESP32 ? you have hardware UART you can use

Seems the issue is with the SD library which is not used in your code. May be you have a bad install. You should try to remove the ESP32 stuff and reinstall

Which version of the ESP32 do you have installed?

I think SD.h may be #include(d) by FirebaseESP32.h.

For providing this detail-information and all other details that might become relevant

EDIT: The most verbose compiler-log for ESP32s can be bigger than 120.000 bytes which is the limit for a single posting.

If the forum-website complains too many characters attach the compiler-log as a *.txt-file

I adjusted Arduino IDE 1.8.19 to ESP32 dev module and compiled your code successfully.
So it seems a faulty installation of the ESP32-core

Testing the upload of the compiler-log
OMG 4 MB!
ESP32-verbose-Compiler-Log.txt (3.9 MB)

1 Like

Can I have your contact? I want to ask you a lot

No. You either ask in the forum or not.
This forum is a community and the community shall have the possability to share knowledge

I'm trying to make changes like reinstalling libraries and board managers, but this happens to me. I've tried following a video and forums, but this keeps happening. How do I fix this?

`Arduino: 1.8.19 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None, Disabled"

C:\Users\User\Documents\Arduino\libraries\SD\src\sd_diskio.cpp:20:10: fatal error: esp32-hal-periman.h: No such file or directory

#include "esp32-hal-periman.h"

      ^~~~~~~~~~~~~~~~~~~~~

compilation terminated.

Multiple libraries were found for "Update.h"

Used: C:\Users\User\Documents\Arduino\libraries\Update

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Update

Multiple libraries were found for "WiFi.h"

Used: C:\Users\User\Documents\Arduino\libraries\WiFi

Not used: C:\Program Files (x86)\Arduino\libraries\WiFi

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\WiFi

Multiple libraries were found for "LittleFS.h"

Used: C:\Users\User\Documents\Arduino\libraries\LittleFS

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\LittleFS

Multiple libraries were found for "FS.h"

Used: C:\Users\User\Documents\Arduino\libraries\FS

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\FS

Multiple libraries were found for "SD.h"

Used: C:\Users\User\Documents\Arduino\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SD

Multiple libraries were found for "SPI.h"

Used: C:\Users\User\Documents\Arduino\libraries\SPI

Not used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI

exit status 1

Error compiling for board DOIT ESP32 DEVKIT V1.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

Hi @setyanug,

You should post such compiler-logs and error-messages as code-section or if too big attach them as a text-file

You should change the compiler-log settings in the Arduino-IDE
here is a tutorial how to do that

@setyanug, do you intend to answer this question???

I guess as a beginner she/he does not know how to provide this detail-information.
Hence the beg for verbose compiler-log which will include this information.

One of the errors is

I googled for this filename. But I did not find anything for this filename
esp32-hal-periman.h

Are you sure that this is the correct filename?

You should really post a LINK where you found this code that you have posted.