Controlling a 3D printer with another Arduino device over serial

1

1

If this is a silly question I apologize but I am trying to establish a serial connection between a 3D printer (Ender 3) and an Arduino Nano over the USB port.

I am able to connect the 3D printer to a serial monitor on my PC and send G-code to it and control the printer. I am also able to connect my Arduino to the serial monitor and also send and receive strings.

When I connect the Arduino directly to the 3D printer using a USB cable and separately powering the Arduino the 3D printer does not seem to respond to the G-code being sent over serial.

What am I missing?

Sebastian Pelletier

Posted 2019-03-11T04:13:25.093

Reputation: 11

Welcome to 3dPrinting.SE! Are you sure your communications settings are correct going from the Arduino to the printer? You might want to double check to make sure. – Pᴀᴜʟsᴛᴇʀ2 – 2019-03-11T12:32:06.993

I'm not sure if I understand this correctly: You want to print by sending all commands via computer->ardunio->3dprinter? If yes: Bad idea, because if the computer gets a problem (e.g. a little hickup, auto turn off, and so many more) the print will fail. And have a hickup while a eg. 10h print is way too easy. – Horitsu – 2019-03-12T05:41:23.137

Do you try to do Something Like Octoprint? – Trish – 2019-03-12T10:25:33.360

Answers

1

This isn't really a 3D-printing issue as much as it is about Arduino, USB, and how serial connections over USB differ from a generic UART serial connection.

For a UART-based serial connection, there are only two devices, and both devices are peers - either can send data to the other with no real restrictions as long as the speeds are set correctly.

USB allows multiple devices to be connected, and is much more complicated. One device must be a "host", which manages everything. The other devices can be much simpler as they don't need to be a host. Typically, your PC is the host, and your keyboard, mouse, memory stick, Arduino, printer, etc. are all just attached devices.

If you've managed to connect your Arduino's USB port to your printer's USB port, the problem is most likely that neither device has hardware or software to be a host, so the USB connection won't work.

There was a "USB Host Shield" for Arduino, but is is no longer in production. Perhaps you can still find one somewhere, or somebody else makes an equivalent.

There is also an Arduino "USBHost" library, which is compatible with the Arduino Due only.

mbmcavoy

Posted 2019-03-11T04:13:25.093

Reputation: 758