Go Down

Topic: * MP3 Shield * - Rogue Robotics rMP3 (Read 44 times) previous topic - next topic

LB01

That is great! Thanks a lot bhagman!
So I need to upgrade the firmware before I do anything now. I will try something either tonight or tomorrow morning. Cross fingers! ;)

LB01

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?

LB01

I have another problem now: the rMP3 won't synchronise. It stops when I use the sync method.

LB01

Its getting somewhere:
I am using the ethershield library from nuelectronics, and I can now download data from a server. I have tried with google.com, and it (sort of) works :)
About the rmp3, I can sync again (it was a problem with the compiler) but the SD card has been damaged beyond repair the last time I tried to use the module. I am not sure if that is due to a bug in the new version of the firmware, if it comes from the sync problems or if the card is just dead from old age...
Anyway, I wont have time for it before a few days. Merry christmas to you all!

bhagman

Hey LB01,

Same with me... Holidays are here.  I'll help out more in the new year!

Enjoy, be safe, and happy holidays!

b

Go Up