Quantcast
Channel: Reprap Forum - RAMPS Electronics
Viewing all articles
Browse latest Browse all 1807

My RAMPS1.4 doesn't work when controlled by Raspberry PI 5 via Python3 (no replies)

$
0
0
Hello,
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. And now, I don't know how to solve it.

Viewing all articles
Browse latest Browse all 1807

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>