Connect raspberry pi to control movement
-
I have a duet2 wifi and would like to connect a raspberry pi in order to control the stepper motors.
I don't understand how I can connect them, and which tools I can use to send commands
-
Any external computer, including a Pi, can connect to the Duet 2 running RepRap V2 firmware via:
- Telnet.
Enable this in your config.g. Connect to it, and everything you send will be interpreted as a G-code command.
- HTTP Web interface.
Protocol is here: https://github.com/chrishamm/DuetWebControl/tree/legacy
See RR_gcode to send g code commands.- The port that is used by the PanelDue (i.e. hardwire)
This is 3V serial TTL. If you don't know what that means, ask more questions here.
And, last, if you move to a Duet3 running RepRap V3 firmware, item (2) above changes to "websockets" instead of HTTP.
-
Could also straight up connect via usb and send g-code to the serial port the duet provides
-
@bearer said in Connect raspberry pi to control movement:
Could also straight up connect via usb and send g-code to the serial port the duet provides
Oh, yeah, duh. There is the EASY way...
-
This post is deleted! -
@Eddas said in Connect raspberry pi to control movement:
@bearer
Tried writing using pyusb but get access denied. Know any other methods for writing through usb?sounds like permissions issues, add yourself to the dialout group or look into udev rules
-
I have connected a duet3D Mini 5+ to a raspberry pi 4 with a usb cable. I am trying to send gcode commands to the duet through the serial package in python. I have a stepper motor connected to the duet. So i am trying to send a command to rotate it. when i run the python script it just stops at line (ser.write) and it doesn't execute the subsequent lines.
here is the code:
import serial
ser = serial.Serial("/dev/ttyACM0", 115200)
time.sleep(2)
print('read')
ser.write(b"G1 Y10 F5000\n")
print('write')
time.sleep(1)
ser.close()if I connect the duet to the laptop and execute the gcode line in the YAT terminal it works fine.
Am I missing something?
-
@marco13 please stick to the thread you've already created and not spam this one