Put tape on the 5V pin - Why and how

Ultimately, I think a smart-cable or smart-adapter approach makes sense. I worked on one of those yesterday with a lot of fussy soldering to tiny wires.

I assume someone makes data only cables that don't have that 5v pin connected, right?

1 Like

Yeah but they're not necessarily shielded and the wires are usually tiny. I don't know of anyone now who sources a great solution for this to be honest. I've spec'd things to Adafruit and have asked them to come up with something.

So, I heard that we can remove the USB cable and install jumpers between the Pi and motherboard. I figured out how to do it and wrote this: https://www.tardigradeoutdoors.com/blog/how-to-print-without-a-usb-cable-on-an-ender-3-and-octoprint

Is this a good solution?

3 Likes

Yeah looks good :slight_smile:

If you experience interference you could add a ferrit bead

1 Like

You also want to demote the Pi's Bluetooth use of the good UART down to the mini-UART so that it leaves the good one for the GPIO pins.

/boot/config.txt:

dtoverlay=pi3-miniuart-bt
3 Likes

Thank you!
I'll edit my config file and then I will read through the books that I have and try to understand that.
There is so much to learn!

The Raspberry Pi UARTs.

2 Likes

If you have a Creality Ender 3 mainboard, you can simply remove diode DP2 to prevent the Pi supplying power to the board. If you would like to be able to flash the firmware without the mainboard being powered by the power supply, you can also disconnect one side of the diode and add a switch in between. That way you can choose if the Pi should send power to the board or not.
Ender_3_Mainboard_altered|690x476

I ended up buying a cheap USB extension cable, cutting it open and I removed a piece of the 5v wire. A little nicer than the tape option IMO, but less permanent than soldering, but it does look a little messy!

3 Likes

Jeez. You'd think they'd incorporate a jumper then for that.

3 Likes

There is probably a reason this is a bad idea but I kill the power to my usb via software to prevent "backfeeding" the motherboard.

Stop and start the usb power respectively:

$echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/unbind
$echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/bind

Copypasta example to register everything with Octoprint stop power at boot and use an external relay for main power

  1. /home/pi/scripts/powerPrinter.py
#!/usr/bin/python

#import modules
import RPi.GPIO as GPIO
import sys
#Set to pin connected to relay
pin = 18
usage = "start|stop"
try:
  GPIO.setwarnings(False)
  GPIO.setmode(GPIO.BCM)
  GPIO.setup(pin,GPIO.OUT)
  # check arguments and act
  if sys.argv[1] == "start":
    GPIO.output(pin,0)
  elif sys.argv[1] == "stop":
    GPIO.output(pin,1)
  else :
    print usage
except:
  print "error"

2 /home/pi/scripts/powerPrinter

#!/bin/bash
# Start / stop printer 

case "$1" in
    start)
        #start the main power
        /home/pi/scripts/powerPrinter.py start
        #start the usb power
        echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/bind
        echo "$0: started"
        exit 0
        ;;
    stop)
        #stop the usb power first to prevent 
        #powing the board and LCD from the Pi
        echo '1-1' | sudo tee /sys/bus/usb/drivers/usb/unbind
        #stop the main power by turning off the relay
        /home/pi/scripts/powerPrinter.py stop
        echo "$0: stopped"
        exit 0
        ;;
    *)
        echo "Usage: $0 {start|stop}" >&2
        exit 1
        ;;
esac

3 /home/pi/.octoprint/config.yaml

    -   action: printeron
        command: /home/pi/scripts/powerPrinter start
        name: Turn On Printer
    -   action: printeroff
        command: /home/pi/scripts/powerPrinter stop
        confirm: true
        name: Turn Off Printer

  1. cronjob to kill power at boot
$crontab -e

# turn the printer or or stop powering the LCD
@reboot ~/scripts/powerPrinter stop

3 Likes

It might be good to plug something else into another of the USB Type A connectors to see if the power also is turned off for those devices as well.

I'm fairly certain it does however the pi for my printer is dedicated and only has the printer connected to USB so this process works for me.

On a related project I need to write a UDEV rule to automount a usb drive and decrypt a volume with the key on the the drive. First attempt didn't work as hoped so I'll probably be reading up on USB bus stuff and may be able to refine this procedure.

1 Like

Yep, yep... I think it's just good that everybody knows this. Their situation might be different.

Everybody using a Pi pretty much has this problem, get one of these, https://www.tindie.com/products/brianlough/power-blough-r/
Problem solved - Brian made this device specifically to disconnect the +5 feed from the Pi's USB port. It works :slight_smile: I have a couple of these, but need some more.. one for each Octoprint printer. I do not like cutting cables, this is perfect.

It looks like a dumbed-down version of my project.

Yep, dumbed down, but they work, I've just ordered a stack of USB breakout boards from Aliexpress to make the next batch. Might even make a 3D printed case for them :smile:

1 Like

They don't work for my own Robo control board (Robo 3D). It will throw an error in OctoPrint if there's no 5V line.

Hello,

I tried to apply this tape fix on the cable to my Prusa MK3S.
But it doesn't work: the octoprint can not connect anymore to the printer...

Do I have the correct understanding that the picutures on top of the page are the plug on the wire side to identify pin1 +5V?

Is it normal with my printer or I missed a trick?

Thank you for your help

Olivier