Ender3v2 board to RPI with screen connector

I was wondering if it is possible to use the screen connector serial port on the creality v4.2.2 mainbord to connect to a raspberry pi instead of using the USB port.
These are the pins from that connector in the stms datasheet

I have already tried this but can’t get it to work. Should it show up as a normal serial port with ls /dev/serial/by-id/*?

Why would you do this?

The USB connection is well defined, more than fast enough and cheap, good quality USB cables are easy to find.

1 Like

It should work, but you have to flash Klipper with that port defined as the connection interface.
Plain serial ports won’t show as by-id.

@mykepredko Some Pi models only have a single USB port, which is freed up by using serial instead, i.e. for an USB camera or USB ADXL device.

@Arakon Although some boards only 1 USB have one physical port, many GPIOs are allocated for USB use. You can attach a cut off USB cable to the 40(/26) pin header. See also Dtoverlay in the raspi documentation.

[Edit]
My memory seems to failed me here. Many people have tried and failed to use GPIO for USB. The problem is the internal hubs within the BCM chip can’t be re-routed onto a GPIO. Some claim to have managed to emulate the hub in software, only for the it to fail in use because timings are too variable depending on other tasks running

The moral is to use an external hub or buy a RasPi hat that has a USB on board.

What about an USB hub?

1 Like

Thank you @Arakon.
And I know that USB is probably the easiest option @mykepredko but I wanted something that is as space efficient as possible and the usb ports use up a lot of space towards the side of the board as well as on the side of the pi.
AND I was just curious because I couldn’t find a lot of information about it.

I’m not sure what you mean by “space efficient” - does this mean that there isn’t a connector that comes out of the side of the printer?

I’d caution against thinking that the left over USB port can be used for a webcam as, from what I’ve seen, the small rPi systems with only one built in USB port are generally pretty marginal in the MIPs department and have trouble running Klipper with a webcam.

While I would recommend doing this only when you have the proper experience, in a nutshell you need:

  1. Identify the RX / TX pins of the printer board
  2. Match these pins to the Communication interface setting during make menuconfig
  3. Build and flash the new firmware
  4. Prepare your SBC to accept serial connections
    • Can involve quite some research
    • Might depend on the Linux distribution
    • Needs some shenanigans with boot configs etc.
  5. Identify the proper GPIO pins on the SBC, which can equally be tricky, especially, e.g. on a RPi 3
  6. Connect the board and the SBC
    • RX to TX
    • TX to RX
    • GND to GND
  7. Set the correct /dev/... path in the printer.cfg. Refer back to No 4 and 5 as the same applies. Usual suspects are /dev/ttyAMA0, /dev/ttyS0, /dev/serial0
  8. Restart Klipper and pray

Notes:

  • On OS level (e.g. dmesg) you will not see if a proper connection exists or not. A UART connection is not plug’n’play and does not announce itself to the OS
  • Some diagnosis could be done with the setserial command
  • Messing up the connection or shorting some GPIO pins, especially when the SBC is powered up, can easily kill it.

@mykepredko I litterally dont have space for the usb connectors sticking out the side of the pi and mainboard.

Thank you very much @Sineos for the detailed instructions. I have already done exactly that and following the scematic from this post I have selected the PB11/PB10 serial port in the menu config flashed the new firmware connected the pins correctly, enabled uart in the pi, and set the path in printer.cfg to /dev/ttyAMA0 but it still won’t connect. I’m gonna do more troubleshooting later but if anyone has some suggestions what to test please let me know.

Try /dev/serial0, that’s how my SKR is hooked up via serial.
Also, did you cross TX and RX? RX on board to TX on Pi and vice versa.

Thanks for the suggestion I tried that but didn’t work either. And yes I tripple no quadrupple checked the wiring but it still won’t work.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.