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
@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.
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:
Identify the RX / TX pins of the printer board
Match these pins to the Communication interface setting during make menuconfig
Build and flash the new firmware
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.
Identify the proper GPIO pins on the SBC, which can equally be tricky, especially, e.g. on a RPi 3
Connect the board and the SBC
RX to TX
TX to RX
GND to GND
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
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.