BT_201 track names

Hi all. Help me please. I can’t find how to display the name of an mp3 track. I am using the BT_201 module. The name is output to the port but how to get it from there?

Show the code you have...
Can you print 'hello' on your display?

void setup() {
   Serial.begin(115200);
  Serial1.begin(115200);

}

void loop() {
 if (Serial.available() > 0) { String str = Serial.readString();  Serial.println(str); Serial1.print(str+"\r\n"); }  if (Serial1.available() > 0) { String str = Serial1.readString(); Serial.println(str); } 

}

There is no special code. More precisely, it exists, but the question is different. How to write the name that comes to the port into a variable. This comes to the port
OK
QM+03
M1+00000002
M2+00000065
MT+00002C48
MK+00000000
MF+/PLAYLISTMP3

For screen output I use the library MCUFRIEND_kbv.h
I output the text via

 tft.setCursor(100, 190);
    tft.setTextColor(WHITE);  tft.setTextSize(2);
    tft.println("Hello world");

And yes it appears on the screen. For example I have a String filename; but how to write PLAYLISTMP3 into it?

Make tempstr global.
Read what comes from port into that String.
Cut off the stuff that you do not need.

tempstr.substring(12);

Print what is left...

Tip: put each statement on a new line.
I am already lost with your code...

What arduino are you using? On uno R3 like arduino's the use of String is not recommended. Use char tempstr[] instead...

Thank you very much for your help, it worked.

Thank you very much for your help, it worked. Please help if you know anything else about this module. The module displays shortened names rather than long ones. Is it possible that this can be solved by firmware? If so, do you have it or if someone is reading this thread, help with the firmware. I found the firmware, but when I try to download there is just a low squeak for a short time, then silence and then again a squeak and so on ad infinitum. I also don’t understand how to track the change of melody. When the next melody starts playing, I would like to paint over the place where the name of the previous one was.
By the way, I use Arduino Mega but this is for ease of connection. In the future I plan to use esp32
Now the code looks like this.

#define LCD_CS 33 // Chip Select goes to Analog 3
#define LCD_RS 15 // LCD_RS = Register Select or LCD_CD = Command/Data goes to Analog 
#define LCD_WR 4 // LCD Write goes to Analog 1
#define LCD_RD 2 // LCD Read goes to Analog 0
#define LCD_RESET 32 // Can alternately just connect to Arduino's reset pin

//#include <SPI.h>          // f.k. for Arduino-1.5.2
//#include "Adafruit_GFX.h"// Hardware-specific library  ----------------------------------------------- 
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

String tempstr;

void setup() {
  
  Serial.begin(9600);
  Serial1.begin(9600);
    tft.reset();                 //hardware reset
    uint16_t ID = tft.readID(); //

    if (ID == 0xD3D3) ID = 0x9481; // write-only shield

    tft.begin(ID);
    tft.setRotation(3); 
    tft.fillScreen(BLUE);

    delay(3000); Serial1.println("AT+CM03");

}

void loop() {
if (Serial.available() > 0) { tft.fillScreen(BLUE); String str = Serial.readString();  Serial.println(str); Serial1.print(str+"\r\n"); } 
if (Serial1.available() > 0) { String str = Serial1.readString(); Serial.println(str); } 

tempstr=Serial1.readString();






    tft.setCursor(0, 10);
    tft.setTextColor(WHITE);  tft.setTextSize(2);
    tft.println(tempstr.substring(55));

}
1 Like

Is the serial buffer 64 characters?
64-55 = 9 characters left...

Maybe yes. I just removed unnecessary characters based on the advice above.

If the buffer has 64 chars, and you cut off the first 55, you will have only 9 left...
No idea how you would solve that...
...so I hope someone else will jump in.
Maybe you should have your topic moved to 'programming questions'.... as your problem may have to do with serial communication instead of audio...
You can flag your own topic and ask for moderation...

This is what I cut off. I can’t say that the problem has been completely resolved because the issue with short track names remains.

I suggest you mark this thread unsolved...
That might attract attention...

I do not know what to do. I'll leave the thread open because maybe someone will be able to help one day, but I have little hope. The module is good, but there seems to be little discussion about it.I left the problem unresolved.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.