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.
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).
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.
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.