Operating Arduino with Repetier Firmware from Python
Hi!
I'm looking for ways of operating stoppers via Arduino with Repetier Firmware avoiding Repetier-Host. I have Mega 2560 + Ramps1.4 + 4 drivers DRV8825 for 3D printers "REPRAP" class and MT-1703HS120AW stepper.
So my goal is to find out how to:
1. send gcode directly from python to arduino
2. set min/max position using 2 click buttons
Could anyone help me do that?
I'm looking for ways of operating stoppers via Arduino with Repetier Firmware avoiding Repetier-Host. I have Mega 2560 + Ramps1.4 + 4 drivers DRV8825 for 3D printers "REPRAP" class and MT-1703HS120AW stepper.
So my goal is to find out how to:
1. send gcode directly from python to arduino
2. set min/max position using 2 click buttons
Could anyone help me do that?
Comments
Alternatively write your own host to communicate with the board. If you manage that it does not reset on connect you can simply send the command as string without checksum and line number to the serial stream. Not most secure way, but will work in 99%.
is the basic for communication. See bottom. A stable connection with error detection and correction is not that simple. That is why I suggested to use repetier-server so all you need to learn is how to call a web api to achieve it.
Python is not my language so can not say much about that. Have a look at pronterface if you want to know more about python and serial connection.
Now the question is should repetier firmware board react on just sending gcode to it from arduino IDE or Python or I need to send something else...
I'd prefer using gcode motor control because I got used to it already and all my scenarios saved from repetier as gcode files, so it's much easier to deal with gcode then just "spin left, spin right" commands
The normal checksum is easy to compute. xor all bytes left from * and write result as *value. That prevents at least firmware executing wrong line.
If you also add line number Nxxx firmware will even request a resend of the correct line.
That is the most basic operation the hosts do. Add numbers and checksums and correct errors. Also handle timeouts if returned "ok" did not come due to com error.