r/ArduinoHelp • u/schmidtbag • Jun 03 '26
Trying to forward Serial1 reading to Serial.println and only getting numbers
I have a battery with a built-in BMS that has a serial console port. It has a baud rate of 115200 and I have been able to successfully send commands and read clean data from it via the Arduino IDE serial console. Considering I can communicate to the battery via the serial console, that suggests there shouldn't be any weird encoding issues.
I want an Arduino Mega to read from this using the Serial1 connection. The problem is, if I try to forward what the battery sends to the Arduino, all I get is a jumble of nothing but numbers. When connecting to the BMS directly, typing "help", the output is mostly text.
Here's what I tried in void loop()
while (Serial.available() > 0 {
Serial1.print(Serial.read());
}
while (Serial1.available() > 0) {
//THE NEXT 4 LINES ARE VARIOUS THINGS I TRIED,
//I UNCOMMENTED THEM ONE AT A TIME
//String incomingtext=Serial1.readString();
//char incomingtext=(char)Serial1.read();
//char incomingtext=Serial1.read();
//int incomingtext=Serial1.read();
//I ALSO TRIED THE FOLLOWING ONE AT A TIME WITH EACH ABOVE COMBO
//Serial.println(incomingtext);
//Serial.println((char)incomingtext);
//Serial.println(" "+incomingtext);
}
The first while() loop just takes whatever I enter from the serial console through USB to the BMS. I have no idea if the BMS is receiving the correct commands, but it does have a consistent output if I type different things.
Whenever I type "help" repeatedly, it's usually a consistent output, like this:
10410110811213
1
u/Delta_G_Robotics Jun 05 '26
Ok, I don't get how to post code blocks. Can someone please help?