Failed to autodetect serial port, please set it manually (when I add tape to USB connection)

What is the problem?
So I'm new to my Ender 3 and octoprint. But my Ender 3 turns on and off mid print and it just continues printing but it doesn't print the way its suppose to. Someone on Reddit assumed it was the 5v port that is messing with the power so they suggested that I put tape on the 5v pin on the USB. I did that but it gave me: "Error: Failed to autodetect serial port, please set it manually."
What did you already try to solve it?
I tried multiple USB ports in the RSP, removing the tape (it does work but then it still stops mid print randomly).
I tried to set the Serial port manually but it only has the "AUTO" option
Additional information about your setup
I have an Ender 3 that has a relay to turn on and off from octoprint.
OctoPrint 1.3.11 running on OctoPi 0.16.0
Raspberry Pi 3B+
5.25V power supply

If adding tape to the USB connector causes serial connection errors, then don't do this.

As for the part where the Ender 3 is "turning on and off mid-print" then you'll need to describe this better. If my printer (itself) turned off during a print, I would suspect the power connection for the printer, not OctoPrint or my Raspi. I always plug my 3D printer and the Raspberry into something that looks like this:

  • UPS (makes sure that good 115VAC power is supplied to everything)
    • TP-Link SmartPlug (allows me to toggle the power ON/OFF remotely)
      • Ikea 3-connector power strip (connects multiple connections to a single TP-Link)
        • Power brick for the printer
        • Power adapter for the Raspberry (5V @ 2.5A)

Until you provide solid power to the printer, I wouldn't waste time with other troubleshooting paths.

Yeah sorry. Apparently the LCD screen is causing the problem because of the 5V pin in the USB. I just tested out a print by unplugging the LCD screen and it worked like a charm. But I really want like the LCD screen to display. Is there an option I can do to remove the 5V pin and also have the LCD screen? I’ve tired cutting the 5V wire but it still didn’t work. And I’m assuming I have to do software modification to achieve this. But I’m really new to this and I have no clue on what to do or where to start.

I'm really not following you.

"the LCD is causing the problem..."

What is the problem? I suppose I mean: what symptoms do you see? You indicated before that the entire Ender 3 turns OFF. Are you saying that only the LCD screen on the Ender 3 blanks out?

Are you suggesting that the Ender 3 is sinking power from the Raspberry Pi and the latter is now displaying an undervoltage lightning bolt in the header?

Is the LCD physically a part of the Ender 3 itself or something that you added later?

Read the entire README for my plugin and see if any of this makes sense to you.

Again sorry i just did some research and all I have to do make USB Data only.

You believe that you need to make your serial connection data-only because someone on Reddit said so. But as you noticed and as I documented in that README, this sometimes results in a non-functional setup.

There are four connections in a typical USB connector: ground, transmit, receive and 5V. The first three are necessary for the data communications. The 5V + ground are needed so that the two devices can know that there's a connection; it's supposed to be there so that a device driver will load up when you plug that in. If you tape the 5V line then in some cases that won't be recognized as an active serial connection or in some cases, the printer won't keep the connection going since it thinks the Raspi has been powered off (or the cable disconnected). It's how the printer board should know that the other board is working. I say "should" since for some people it still works in this case (their firmware on the printer board does whatever it wants to do).