Octoprint suddenly will not connect to my Ender3!

ok I tried what you said but no difference, I ran it with two different cables and three of the fours ports on the pi. lsusb came up exactly the same each time.this is also on the new raspi.

Does "exactly the same" mean that you get the same lsusb output with the printer unplugged as you do with the printer plugged in? If so, then there has to be something wrong with the printer. I would re-flash the firmware (if you still can).

Yes I got the same result with or without the printer plugged in. Also what firmware are you referring to? My printer or raspberry pi firmware?

Also yesterday the printer decided to connect to octoprint. So I havenโ€™t turned off the printer since. The dam thing is going to stay on for as long as possible!

My two penneth as an owner of a similar hardware setup and avoiding command line commands:
At the top left of the Octoprint screen next to Connection there is a refresh icon - hover over it and it shows "Refresh connection options". If you switch off the printer and click on the refresh icon the Serial port dropdown should only show AUTO and VIRTUAL.
Now switch the printer on and again click on the refresh again. As well as the AUTO and VIRTUAL you should now see something like /dev/ttyUSB0. If you don't see that then I don't think the Raspi is detecting the USB connection. If you do see it then select it and try connecting. Mine connects at 115200 baud but your printer firmware may be set differently.
If you don't see the new /dev.... device I don't think it is a problem with Octoprint - more to do with the OS autodetecting a USB connection - or not.

From your description and different hardware you have tried the only common thing I can see is the printer firmware. Maybe a firmware bug or timing issue?

1 Like

...which could happen if one has placed tape over the 5V pin of the USB connection, for what it's worth.

Possibly. Although I ran mine for a while with a USB cable with the 5V wire cut and I never had a connection issue. Maybe if the tape was interfering with a data wire.

I suppose another thing it might be is a dodgy USB connector on the printer board. It might be worth flashing a vanilla Marlin if that's possible, and seeing if that makes any difference.

In theory, the 5V line is part of the device detection process of Raspbian. Granted, it is capable of powering downstream devices so people will tape their connectors.

I just mention it in case the original poster has done so and failed to mention it.