Edzelf / ESP32Radio-V2

New version of the well known ESP32 Radio. Now optional I2S output!
Apache License 2.0
200 stars 49 forks source link

build error #37

Open valera39 opened 2 years ago

valera39 commented 2 years ago

Hi Ed! When building in PlatformIO, with the uncommented #define SDCARD function in config.h, a warning appears in the terminal: Library Manager: Installing SD(esp32) @ ^1.0.5 Warning! Could not find the package with 'SD(esp32) @ ^1.0.5' requirements for your system 'windows_amd64' then the build fails with the following error: Compiling .pio\build\esp32\src\main.cpp.o Compiling .pio\build\esp32\src\utils.cpp.o Generating partitions .pio\build\esp32\partitions.bin Compiling .pio\build\esp32\lib1a0\Wire\Wire.cpp.o Compiling .pio\build\esp32\libc45\PubSubClient\PubSubClient.cpp.o Compiling .pio\build\esp32\lib274\SPI\SPI.cpp.o Archiving .pio\build\esp32\lib1a0\libWire.a Compiling .pio\build\esp32\libcb0\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o Archiving .pio\build\esp32\lib274\libSPI.a In file included from src/main.cpp:616: include/SDcard.h: In function 'void handle_ID3_SD(String&)': include/SDcard.h:338:13: error: 'SD' was not declared in this scope mp3file = SD.open ( path ) ; // Open the file ^~ include/SDcard.h:338:13: note: suggested alternative: 'SS' mp3file = SD.open ( path ) ; // Open the file ^~ SS include/SDcard.h: In function 'bool mount_SDCARD(int8_t)': include/SDcard.h:458:11: error: 'SD' was not declared in this scope if ( !SD.begin ( csPin, SPI, SDSPEED ) ) // Yes, try to init SD card driver ^~ include/SDcard.h:458:11: note: suggested alternative: 'SS' if ( !SD.begin ( csPin, SPI, SDSPEED ) ) // Yes, try to init SD card driver ^~ SS include/SDcard.h:464:36: error: 'CARD_NONE' was not declared in this scope SD_okay = ( SD.cardType() != CARD_NONE ) ; // See if known card ^~~~~ include/SDcard.h:464:36: note: suggested alternative: 'INADDR_NONE' SD_okay = ( SD.cardType() != CARD_NONE ) ; // See if known card ^~~~~ INADDR_NONE include/SDcard.h: In function 'void scan_SDCARD()': include/SDcard.h:485:17: error: 'SD' was not declared in this scope getsdtracks ( SD, "/", SD_MAXDEPTH ) ; // Build file list ^~ include/SDcard.h:485:17: note: suggested alternative: 'SS' getsdtracks ( SD, "/", SD_MAXDEPTH ) ; // Build file list ^~ SS Compiling .pio\build\esp32\libcb0\Adafruit BusIO\Adafruit_I2CDevice.cpp.o Archiving .pio\build\esp32\libc45\libPubSubClient.a Compiling .pio\build\esp32\libcb0\Adafruit BusIO\Adafruit_SPIDevice.cpp.o *** [.pio\build\esp32\src\main.cpp.o] Error 1 How can this be fixed?

Edzelf commented 2 years ago

SD is still experimental. Try to add: "lib_ignore = SD" to your platformio.ini

valera39 commented 2 years ago

Thanks for the quick response. Unfortunately, this did not help, the build still fails.

Edzelf commented 2 years ago

Try the new version of platformio.ini.

valera39 commented 2 years ago

i have the latest version PlatformIO Core 5.2.5·Home 3.4.1 Same error on Arduino IDE

Edzelf commented 2 years ago

I mean the file platformio.ini on the ESPRadio github.

valera39 commented 2 years ago

Replaced platformio.ini, Now like this: In file included from src/main.cpp:616: include/SDcard.h:36:12: fatal error: SD.h: No such file or directory


define SDCARD // For SD card support (reading MP3-files)

define FIXEDWIFI "MYWIFI/password" // Add a fixed SSID to the list

// Define (just one) type of MP3/AAC decoder

define DEC_VS1053 // Hardware decoder for MP3, AAC, OGG

//#define DEC_VS1003 // Hardware decoder for MP3 //#define DEC_HELIX // Software decoder for MP3, AAC. I2S output //#define DEC_HELIX_INT // Software decoder for MP3, AAC. DAC output

// Define (just one) type of display. See documentation. //#define BLUETFT // Works also for RED TFT 128x160 //#define ST7789 // 240x240 TFT //#define OLED1306 // 64x128 I2C OLED SSD1306 //#define OLED1309 // 64x128 I2C OLED SSD1309 //#define OLED1106 // 64x128 I2C OLED SH1106 //#define DUMMYTFT // Dummy display //#define LCD1602I2C // LCD 1602 display with I2C backpack //#define LCD2004I2C // LCD 2004 display with I2C backpack

define ILI9341 // ILI9341 240*320

//#define NEXTION // Nextion display. Uses UART 2 (pin 16 and 17) //

// Define ZIPPYB5 if a ZIPPY B5 Side Switch is used instead of a rotary switch ///#define ZIPPYB5`

Edzelf commented 2 years ago

I just downloaded the release version of ESP32Radio-V2 on a different test machine. I copied your config.h file. Compiled okay. So it is a big mystery. My SD.h is located at: C:\Users\ed\.platformio\packages\framework-arduinoespressif32\libraries\SD\src\SD.h There is also one at C:\Users\ed\.platformio\lib\SD, but if I delete this one, there is no difference in compiling.

Edzelf commented 2 years ago

Bingo! After update of pio, I got SD compile errors. Now I have something to look for.

valera39 commented 2 years ago

Yes, it's definitely a mystery. Thanks for the answers, I'll try again in the evening on another computer. Have a nice day! Р.S. So it's not a mystery!

Edzelf commented 2 years ago

I included the SD library to the "lib" directory. That seems to cure the compilation error. Will test the result later.

valera39 commented 2 years ago

I didn't wait for the evening :) Everything came together without errors, thanks for the excellent work! But it looks like my ESP32 has failed so I can't download and test it yet. How to add Cyrillic support? Have a nice day!