[SOLVED] FN-RM01 mp3 record/play module (Works great now!)

I recently bought the FN-RM01 MP3 Voice Recording and playing Module. I can record and play by index number, but need real file names for looking things up.

Has anyone succeeded at getting it to record audio by file name?

It's supposed to work as explained in the datasheet at item 4.3.17 for the root directory, and 4.3.19 for inside a folder, but I've had no luck with these.

Show us your code snippet for that playback by file name command? The datasheet provides command examples of a file named "T002.mp3" for both recording and playback.

Are you sure you're sending the correct Check Code? You probably can only use short FAT file system names (8 or fewer characters), ex: XXXXXXXX.MP3.

Borland,

I came back to delete my post, but found you'd already answered it.

Thank you for such a meaningful straight-to-the-issue answer.

Minutes ago, it started working for me. I had to "Restore" my windows computer (for other reasons). That somehow deleted my code; and when I rewrote it, it worked!

You asked for a snippet, and I'm happy to provide it.

This is the code that worked, shortened because the original accesses a digital clock (so it's a bit untested).

void clear1()
{
  while (Serial1.available() > 0)
    Serial1.read();
}

int hex(char *hex)
{
  byte n = (int)strtol(hex, NULL, 16);
  return n;
}

    byte chk;
byte addChk(byte n)
{
  chk += n;
  return n;
}

void doRecord(String s)//dohere
{// "recording of a file by name in the root directory"
  clear1();
  chk = 0;
  Serial1.write(hex("7E")); // startCode
  Serial1.write(addChk(hex("0B"))); // number
  Serial1.write(addChk(hex("D6"))); // command
  Serial1.write(addChk('1')); // monthH
  Serial1.write(addChk('1')); // monthL
  Serial1.write(addChk('2')); // dayH
  Serial1.write(addChk('2')); // dayL
  Serial1.write(addChk('1')); // hourH
  Serial1.write(addChk('3')); // hourL
  Serial1.write(addChk('3')); // minuteH
  Serial1.write(addChk('9')); // minuteL
  Serial1.write(chk); // checkCode
  Serial1.write(hex("7E")); // endCode
  delay(100);
  while (Serial1.available() > 0)
    {
      Serial.print("A(");
      Serial.print(Serial1.read());
      Serial.println(")");
    }
  Serial.println("recording...");
  delay(10000);
  endRecord();
}

void endRecord()
{// "Stop recording"
  Serial1.write(hex("7E")); // startCode
  Serial1.write(hex("03")); // number
  Serial1.write(hex("D9")); // command
  Serial1.write(hex("DC")); // checkCode
  Serial1.write(hex("7E")); // endCode
  Serial.println("end record");
  delay(100);
  while (Serial1.available() > 0)
  {
    Serial.print("B(");
    Serial.print(Serial1.read());
    Serial.println(")");
  }
}

I have discovered what my problem was, and feel I should pass that forward:

The module expects commands to be in a single string of bytes, timed relative to each other according to the 9600 BAUD rate. By sending each byte on a separate Serial.write(byte), I was throwing the timing off according to how much processing I was doing between bytes.

So the solution is to do ALL the processing FIRST, and then send the full set of instructions with ONE Serial.write command.

Here's my updated procedure, which works far more reliably:

void doRecord(String s)
{// "recording of a file by name in the root directory"
  clear1();
  chk = 0;
  char ss[15];
  ss[0] = (hex("7E")); // startCode
  ss[1] = (addChk(hex("0B"))); // number
  ss[2] = (addChk(hex("D6"))); // command
  for (byte i=0; i<8; i++)
    ss[i+3] = (addChk(s[i])); // file name
  ss[11] = (chk); // checkCode
  ss[12] = (hex("7E")); // endCode
  //
  Serial1.write(ss,13);//  <-- SEND WHOLE MESSAGE HERE!
  //
  delay(2000);
  while (Serial1.available() > 0)
    {
      Serial.print("A(");
      Serial.print(Serial1.read());
      Serial.println(")");
    }
  Serial.println("recording...");
  delay(10000);
  endRecord();
}

doRecord("15221430");

CosmickGold:
I have discovered what my problem was....

I wonder if you could please upload a photo of the module? The links from the various posts I see on the subject of something like "audio recording module FN-RM01" do not work any more, and I would very much like to know how to find the module you are talking about. I was not able to find what I think may be the module you are talking about, and would like to try one out.


The above picture is not to scale. The module is actually only 1.5 inches long.

I fixed the link in my first comment above, to where you can buy it. And the second link -- to the datasheet -- is also good.

The price shown is for two. I have no idea why they sell them in pairs, not one at a time.

The datasheet shows +5V connected to pin one. This won't work since pin #1 is N/C (not connected). +5V must be connected to pin #5 instead.

I'm very happy with this module. Works great.

I see, thanks. I was using too many words to search on Aliexpress. Searching on just the one word FN-RM01 shows this module. That looks interesting.

Hi..

i am using FN-RM01 recorder module, i need to delete the files before i start new recording. so how can i delete the files in the SD card without using serial commands and not formatting SD card. can i use any port pins to delete the files.

Thanks
Regards
Swathi

hey i am using FN-RM01 MP3 i can able to create T002.mp3 file but ,i can't able to create any other file link T001.mp3,T003.mp3 etc ,please help me ??