baldram / ESP_VS1053_Library

A library for VS1053 MP3 Codec Breakout adapted for Espressif ESP8266 and ESP32 boards.
https://platformio.org/lib/show/1744/ESP_VS1053_Library
GNU General Public License v3.0
114 stars 36 forks source link

using lib with VS1053 breakout board and arduino WEMOS D1 R32 (esp32) #105

Open mohtashami740 opened 1 year ago

mohtashami740 commented 1 year ago

I have tested the library with this HW config:

VS1053 breakout board and Arduino WEMOS D1 R32 (esp32)

but it seems DREQ is Always zero and any call to library goes to a forever loop.

the pins are as below:


| VS1053 | WEMOS-D1-R32 | INFO |

| 13-SCK | IO18 | SPI Clock | | 12-MISO | IO19 | SPI Master In - Slave Out | | 11-MOSI | IO23 | SPI Master Out - Slave In |

| 09-CS | IO13 | SD Card Chip Select |

| 08-XRST | IO12 | VS1053 Reset pin | | 07-XDCS | IO14 | VS1053 Data/command select pin | | 06-XCS | IO27 | VS1053 Chip Select |
| 02-XDREQ | IO26 | VS1053 Data Request |

and here is the code:

#include <VS1053.h>               //https://github.com/baldram/ESP_VS1053_Library

//wemos D1 R32
#define VS1053_CS     27
#define VS1053_DCS    14
#define VS1053_DREQ   26
#define VS1053_REST   12
#define SDCARD_CS     13

// Default volume
#define VOLUME            80

VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ);

void setup() {
    Serial.begin(115200);

    // Wait for VS1053 and PAM8403 to power up
    // otherwise the system might not start up correctly
    delay(3000);

    Serial.println("spi begin ... ");
    SPI.begin();

    Serial.println("vs1053 begin ... ");
    player.begin();

    Serial.println("vs1053: set firmware patch ... ");
    player.loadDefaultVs1053Patches();                      //it will stop here!!!!!

    Serial.println("vs1053: switch to mp3 mode ... ");
    player.switchToMp3Mode();

    Serial.println("vs1053: set volume ... ");
    player.setVolume(VOLUME);

    //...
}