Ok, so here is a recap of what I've done this morning:
- upgraded firmware via arduino (btw, the java updater doens't find any COM port, I had to use the command line method)
- installed arduino 21, then installed the arduino stream pack (18/10/10), rogue MP3 pack (v3), rogue SD pack (v4), NewSoftSerial pack (18/10/10) and ethershield pack (v1.1)
- Tested the ethernet board: I needed to rename the files from 'etherShield' to EtherShield', but then I could access the web page from my house network

*moment of happiness*
- Then I placed a file on the root folder of the rMP3 SD card with the characters 'D3' and carriage return to set the rMP3 module baudrate to 57600 bauds
- I uploaded a script and it works fine!

(Well, I had to work a bit)
- Then I tried to upload a song from the serial port using the following script and it caused problem: the quality of the music is degraded during uploading (there are small pauses of ~100ms every 100ms) and the file is not copied correctly. The function below is called when the user send 'w' on the USB port:
void writeFile()
{
int8_t filehandle;
uint8_t v = 8;
Serial.println("Enter the name of the file:");
Serial.read(); // flush the data
while(!Serial.available()) // wait for data to arrive
{
Serial.print(".");
delay(500);
}
int length = 0;
name[length] = Serial.read();
while (1)
{
delay(10); // wait for the next character
if (Serial.available())
{
length++;
name[length] = Serial.read();
}
else
{
break;
}
}
// at that point we have the name of the file to write, so we can open a file
filehandle = filecommands.open(strcat("/", name),open_mode(OPEN_WRITE));
if (filehandle<1) // in case of an error during the opening
{
Serial.println("Error: cannot open the file.");
return;
}
// next ask for the data to write in it
Serial.println("Load the data:");
while(!Serial.available()) // wait for data to arrive
{
delay(10);
}
Serial.println("");
Serial.println("Loading...");
int i = 0;
while (1)
{
i++;
if (Serial.available())
{
char buf = Serial.read();
filecommands.write(filehandle,1,&buf);// write the buffer
//Serial.print(buf);
i = 0;
}
if (i>10000)
{
break; // ends on timeout (maybe 10000 is a bit large)
}
}
// finally, close the file
filecommands.close(filehandle);
updateSongList();
Serial.println("Done!");
}
It is probably not the best way to copy a file of th SD card. Is there any obvious mistake or suggestions?