Baud rate issue in Raspberry Pi 5 and Arduino connection with USB in Python3

50 Views Asked by At

when I connect Arduino (Mega Arduino and RAMPS 1.4) to my laptop, I can control my board with g code via Python by baud rate=250000 (pyserial code= myPort = serial.Serial('COM7', 250000, parity='N')). Next, I connect this board by USB to Raspberry Pi 5 and program in Python this code: myPort = serial.Serial('/dev/ttyACM0', 250000, parity='N'), everything is good, and the program run without any error, and the Arduino board light is flashing to tell us the connection is established. But my g code did not work and the step motors remained motionless. I know this problem occurs when the baud rate number in the code is not true. So to solve this problem I tried to change the baud rate in Raspberry Pi 5 via this code stty -F /dev/ttyACM0 115200 and checked it again, but that did not work too. Also, I tried any other standard baud rate and failed at all of them. And now, I don't know how to solve it.

0

There are 0 best solutions below