I cannot read text correctly through the serial port

Im a Newbie on Programs and i'm creating a personal MP3 device.
I can already send strings to Change the music track, play, pause, etc.
This mp3 module sends through the UART port information such as the name of the song and so many other information.
The problem I face is that the letters are not read correctly, only the numbers are displayed. Letters become a square character.
I'm using Serial Software to communicate with this module.

This module comes with a UART test software.
All characters are perfectly displayed when I connect this MP3 module directly to the UART/USB converter. But when the information passes through the Arduino, everything goes wrong.

=========================================================

#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 4);
SoftwareSerial mySerial(10, 9); // RX, TX
String seriala; 

byte volumeUP[13] = {0x41,0x54,0x2b,0x43,0x42,0x0d,0x0a}; 

void setup()  
{
 
  pinMode (7, INPUT_PULLUP);
  Serial.begin(115200);
  mySerial.begin(115200);
     lcd.init();
    lcd.backlight();
}

void loop() // run over and over
{

   if(digitalRead (7) == 0) {mySerial.write(volumeUP,13);
   Serial.println ("Funcionou");
   delay (200);} 
   
   if (mySerial.available() > 0 ) {
    seriala = (mySerial.readString());
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(seriala);
    Serial.println(seriala);
    }

    
}

====================================================================

FOLLOW THE PICS

THIS IS THE REAL INFO SENT BY MODULE.

Hello, do yourself a favour and please read How to get the best out of this forum

please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. It’s barely readable as it stands. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlT on a PC or cmdT on a Mac)


Don’ t trust SoftwareSerial at 115200 bauds…

16x4 ? I knew 16x2 and 20x4, do you really have a 16x4 LCD ?

1 Like

Yes. I have 16x4.

What the best speed COM to work with ?

SoftwareSerial has a reputation for not working well at such high baud rates

Which Arduino board are you using ?

1 Like

At what rate does the data come in?
9600 would be a good start

1 Like

The default is 115200 on this module. I can Change this speed for test.

I'll seach on datasheet how to do it.

An arduino with 2 hardware serial ports would be better (or use Serial for your device)

1 Like

Hence my unanswered question about which Arduino was being used

1 Like

I'm using a Generic Arduino Nano.
Atmega328 using ch304 for communication.
This have only one serial port. I can't connect the mp3 module on native serial, cuz the this port is used to Arduino communication too.

I'm living on Brazil. Arduino is too hard and expensive on my city.

AtMega328
Ch304 for communication

Sorry about my late to answer, I'm tripping

Your tip worked. Reduced Baud Rate to 9600.
Letters finally started to display correctly.
Now I have another problem. The manufacturer does not recommend using RATE below 115200. This causes HARDWARE instability in the MP3 module and in fact it is happening. The module now displays the same track name for all songs for a while, as if the song name buffer was stuck for a few seconds with that data.

I will try to accelerate as fast as possible to solve this problem, if the problem persists I will have to change the Arduino board to one that has two UART ports

Ok
That would be the easiest route

1 Like

After all, we shouldn't trust on SoftwareSerial at high BAUDS speeds.

Thank you for all your attention. People like you make the world better

I Have Another question. How can i take only Music name info? Without another chars?

For Example:

QM+02
M1+0000000D
M2+00000012    -  THIS IS THE MUSIC NUMBER
MT+00000113    -  THAT'S HOW MANY SONGS ARE ON THE TF CARD
MK+00000000
MF+y2mate.com - music example 1213121414 - asdnasd.mp3

How can i divide this info in parts to write on memory?

I would suggest to study Serial Input Basics to handle this

1 Like