How to capture gcode from USB and reuse

I have an M3D 3D printer. It's awful, but I want to control the motion of the head for another task. I'd like to record specific G code commands sent from the printer's software to the printer onto my Arduino so I know the format to send commands directly to the printer from the Arduino.

Is this possible?

You need to provide more information.

Does your printer use an Arduino and RAMPS type of driver board?

Where does the GCode come from in order to be sent to the printer?

GCode is just a text file that can be read by any text editor.

I suspect you would make better use of your time if you study one of the many online GCode tutorials. The instructions are actually very simple.

...R

Does your printer use an Arduino and RAMPS type of driver board? No idea. That's why I want to capture the gcode commands sent from the printer's program then break down the protocol to decipher it.

Where does the GCode come from in order to be sent to the printer? The printer software can send individual gcode commands from the program's UI.

You are being very stingy with your supply of information - keep in mind that we know nothing other than what you tell us.

Post links to the documentation for the printer.

When you say "The printer software can send individual gcode commands from the program's UI" where does the UI exist? Is it running on a PC, or within the printer.

Presumably if you want to make something with the printer you need a file of GCode instructions - not just commands that are entered in a GUI. Where does the file come from? How do you get it to the printer?

I have an ANET A2 3d printer so I know a little about them.

...R

This may be a dumb question, but I find no documentation on-line to prove the printer actually uses "G-code" text lines. What is your source for that information?

Paul

If I knew more, I would share. My question is more generically about the ability to capture the commands on my arduino coming from my PC USB and then use that data to understand what I could do to control the printer from my arduino.

Search for the "usb sniffer" for a program that works on your OS. Wireshark USB sniffing works on Linux but I am not sure about Win and Mac.