OS: Ubuntu 14.04.6 LTS
Main board: Creality CR-10 mainboard
Printer Firmware: Marlin v1.19
Arduino IDE 1.6.8
My goal is to control the movement of the 3D printer by sending gcode over the serial port to the printer. I am starting with sending the M115 command and I expect the printer to respond back with its firmware information. The printer is on /dev/ttyUSB0.
In one terminal I send the M115 command:
echo -e "M115\n" >> /dev/ttyUSB0
I monitor the reply from the printer in a second terminal with:
tail -f /dev/ttyUSB0
The output I get is garbled characters:
It seems like a baud rate mismatch between my computer and the printer. But i have confirmed that Marlin is using baud 115200. It says this in the configuration.h file.
#define BAUDRATE 115200
Linux is also using baud 115200 for /dev/ttyUSB0. To confirm this I typed:
stty < /dev/ttyUSB0
and got the following output:
speed 115200 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
Next, I used Arduino IDE Serial Montor to send the M115 command. I set the baud in the Monitor to 115200 and the printer replied back to the Monitor with the firmware info. So I was able to communicate over the Arduino Serial Monitor just fine.
Why is the communication through the Linux terminal coming out garbled?