2

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?

0scar
  • 37,708
  • 12
  • 68
  • 156

1 Answers1

2

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
  • 818
  • 5
  • 10