Serial Communication on Beaglebone Black

I have been trying to communicate with a CNC machine through RS 232 to the Beaglebone Black.
Following are the Serial Port settings at the Machine
Baudrate=9600
Databits=8
Stopbits=1
Parity=None
CR only

When i tried connecting it to my desktop(windows 10-using python) directly(done without using BBB) and i set the same parameters i got the response from the machine like i had expected.

Although, when done using the BBB (debian), also using python, i just received the string command i sent to the machine. Following is the python code.

import Adafruit_BBIO.UART as UART

import serial, string

UART.setup(“UART1”)
with serial.Serial(port="/dev/ttyO0",baudrate=9600,timeout=2) as ser: #i also tried mentioning databits and stopbits and other parameters but they still did not work
ser.write(b"Q100\r")
c=ser.readline().decode(“utf-8”,“ignore”)
print©
ser.close()

This works all fine in windows(gives the serial no. as the output) but simply gives back Q100 as output (same as input).

I was wondering if it could be due to the different OS on my laptop and BBB. Should i try installing windows ce on the BBB and work with that?

Thank you