(Context) I'm creating demo code to test out a feature that is to be implemented into a bigger piece of code and was testing out downloading and saving API requests with the HTTPClient, WiFi and SdFat libraries which worked successfully. However, as the code is going to be running on a portable device, it made sense to create a method of changing the connected network if required by the user. I then looked into replacing the WiFi library with the WiFiManager library to provide a configuration portal.
The problem is, attempting to merge WiFiManager code snippets to replace code relying on the WiFi library, the error Compilation error: 'File' does not name a type; did you mean 'SdFile'?
appears when compiling. I have traced this down to a conflict between the SdFat library and WiFiManager which supposedly cannot be used at the same time as commenting out #include <WiFiManager.h>
resolves the issue. Is there an easy way to use both libraries at the same time or should I resort to using the default SD library? Any help is appreciated!
Code used to test the conflict (modified SoftwareSpi example code from the SdFat library):
#include <WiFiManager.h>
#include "SdFat.h"
//#include <HTTPClient.h>
//#include <SPI.h> // include the SPI library
#if SPI_DRIVER_SELECT == 2 // Must be set in SdFat/SdFatConfig.h
// SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h,
// 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT.
#define SD_FAT_TYPE 0
//
// Chip select may be constant or RAM variable.
const uint8_t SD_CS_PIN = 10;
//
// Pin numbers in templates must be constants.
const uint8_t SOFT_MISO_PIN = 12;
const uint8_t SOFT_MOSI_PIN = 11;
const uint8_t SOFT_SCK_PIN = 13;
// SdFat software SPI template
SoftSpiDriver<SOFT_MISO_PIN, SOFT_MOSI_PIN, SOFT_SCK_PIN> softSpi;
// Speed argument is ignored for software SPI.
#if ENABLE_DEDICATED_SPI
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SD_SCK_MHZ(0), &softSpi)
#else // ENABLE_DEDICATED_SPI
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, SHARED_SPI, SD_SCK_MHZ(0), &softSpi)
#endif // ENABLE_DEDICATED_SPI
SdFat sd;
File file;
void setup() {
}
//------------------------------------------------------------------------------
void loop() {}
#else // SPI_DRIVER_SELECT
#error SPI_DRIVER_SELECT must be two in SdFat/SdFatConfig.h
#endif //SPI_DRIVER_SELECT
Sorry if I've done something incorrectly as this is my first time on the Arduino forum : )