Hi, I bought the Grove MP3 V4 and I needed help in writing data to its SD Card. I’m using it with a Realtek AMB82 Mini Board and wanted to send an MP3 File from the board’s SD card to the Grove MP3’s SD card to play it but it does not seem like it is possible. Is there a fix or a way to make it work?
Hi there, and Welcome,
can you post the code, We can look and suggest some helpful tips.
Seems as though it should be possible. synchronizing the buffers and , being sure the receiving file is open is Hughley necessary.
What MCU? you getting any LED indicators?
HTH
GL PJ
Hi @PJ_Glasso ,
I am working on the AMB82 Mini (based on 32 bit ARM V8M) platform. The problem I am encountering is that the MP3 Module is just connected via the UART Pins and the VCC and the GND, and the provided libraries for the MP3 Module ( this and this ) do not directly allow for files to be directly transferred from AMB82 Mini to the MP3 Player. The code we have right now is just sending play / stop / volume signals to the MP3 Player.
What we want to achieve is when our server sends us a MP3 file on the AMB82 Mini, we want to play it on the Grove MP3 but we can’t find a way to do so. Your advice would be helpful on how we can “synchronize the buffers” as you mentioned.
Following is our code that just sends the signals to play/ stop/ volume functions.
#include "WT2605C_Player.h"
#include "Arduino.h"
#define COMSerial Serial1
#define ShowSerial Serial
WT2605C<HardwareSerial> Mp3Player;
void setup() {
while (!ShowSerial);
ShowSerial.begin(115200);
COMSerial.begin(115200);
ShowSerial.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
Mp3Player.init(COMSerial);
ShowSerial.println("0...");
}
void loop() {
if(ShowSerial.available()) {
String input = Serial.readString();
input.trim();
if(input.startsWith("v")) {
int vol = input.substring(1).toInt();
Mp3Player.volume(vol);
ShowSerial.println("Volume set to: " + String(vol));
}
else if(input.startsWith("m")) {
if(input.substring(1) == "1"){
ShowSerial.println("1");
int err = Mp3Player.playMode(static_cast<PLAY_MODE>(0x00));
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "2"){
ShowSerial.println("2");
int err = Mp3Player.playMode(static_cast<PLAY_MODE>(0x01));
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Single song loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "3"){
ShowSerial.println("3");
int err = Mp3Player.playMode(static_cast<PLAY_MODE>(0x02));
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Folder loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "4"){
ShowSerial.println("4");
int err = Mp3Player.playMode(static_cast<PLAY_MODE>(0x03));
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Random mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "5"){
ShowSerial.println("5");
int err = Mp3Player.playMode(static_cast<PLAY_MODE>(0x04));
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Single song mode.");
else ShowSerial.println("ERROR");
}
}
else if(input.startsWith("b")){
int index = input.substring(1).toInt();
Mp3Player.playSDRootSong(index);
ShowSerial.println("Play music: " + String(index));
}
else if(input.startsWith("+")){
int err = Mp3Player.volumeUp();
if(!err) ShowSerial.println("Volume up");
else ShowSerial.println("ERROR");
}
else if(input.startsWith("-")){
int err = Mp3Player.volumeDown();
if(!err) ShowSerial.println("Volume down");
else ShowSerial.println("ERROR");
}
else if(input.startsWith("n")){
Mp3Player.next();
ShowSerial.println("Next song");
}
else if(input.startsWith("p")){
Mp3Player.previous();
ShowSerial.println("Previous song");
}
}
}