Civil.Shakeri
Civil.Shakeri

Reputation: 43

My RAMPS1.4 doesn't work when controlled by RPI5 via Python3

When I use my Windows device to control ramps1.4 (mounted on mega Arduino) via Python3, by g code like this:

import serial
import time

myPort = serial.Serial('COM7', 250000, parity='N')
time.sleep(1)

myPort.write('M302 S0\n'.encode())
myPort.write('G1 Z-50 F1000000\n'.encode())
myPort.write('M84\n'.encode())

everything is good and my step motors work. Next, when I connect this board to my Raspberry Pi5 device and change the myPort code to myPort = serial.Serial('/dev/ttyACM0', 250000, parity='N') connection is established and RAMPS1.4 light flashing to tell us that port is connected but my g code does not work and step motors remain motionless (without any error). First I thought that's issue relates to the Baud rate. 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 either. Also, I tried any other standard baud rate and failed at all of them. I tried this solution too but doesn't work: https://stackoverflow.com/a/59966088/23310292 / https://stackoverflow.com/a/76734740/23310292 . Next, I thought maybe this console was inactive, so I tried this code sudo systemctl enable [email protected], and not work either. And now, I don't know how to solve it.

Upvotes: 1

Views: 38

Answers (0)

Related Questions