Ok, I am nearly there, but I have a problem with the rMP3 module. It has problems to sync when the baudrate is different from 9600.
I have tried to include the baudrate change in the code because I first thought that the problem was coming from the SD card. So I start th communication at 9600, change to 57600, ask a confirmation by checking the baudrate parameters from the rMP3 (it gives a '3', indicating that it has changed correctly and it is still woking), and then I use the sync function and the program stops. What is the problem?
I upgraded the rMP3 firmware last December to reduce the latency between two files. Could there be a problem in the new firmware?
Here is the section of code I use for changing the baudrate:
Serial.println("starting rmp3");
rmp3_serial.begin(9600); // default baudrate
char setbaud = 0x44; //D
uint8_t baudratecode = 3; //230400: parameter D7 in the config file
//rmp3.changesetting(setbaud, baudratecode);
Serial.println(rmp3.getsetting(setbaud));
rmp3.changesetting(setbaud, baudratecode);
delay(1000);
rmp3_serial.begin(57600);
Serial.println(rmp3.getsetting(setbaud)); // check that everything is fine
// // back to 9600, for debugging purposes (so you don't have to power off the arduino every time)
// baudratecode = 0;
// rmp3.changesetting(setbaud, baudratecode);
// delay(1000);
// rmp3_serial.begin(9600);
// Serial.println(rmp3.getsetting(setbaud));
Serial.println("Sync");
rmp3.sync();
Serial.println("Stop");
rmp3.stop();
Serial.println("Set volume");
rmp3.setvolume(volume);
Serial.println("Sync filesystem");
filecommands.sync();
Serial.println("ready");