When clicking connect to the printer it shows as connected reads all the information and the files on the SD card then after 5 seconds I get "Unexpected error while reading serial port" and it disconnects. This happens every time I try to connect
The same thing happens if I try to connect while printing
What did you already try to solve it?
Changed power supply, changed baud rates
Have you tried running in safe mode?
Yes
Did running in safe mode solve the problem?
No exactly the same
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
OctoPrint Version 1.8.4
OctoPi Version 0.18.0, running on Raspberry Pi 3 Model B Plus Rev 1.3
Board BIGTREETECH-SKR-V1.3
Marlin Version 2.1.1
Windows 10
Firefox
Have you tried it with a different SD card in the printer (or formatting the existing one, or without an SD card in)? Perhaps there is something wrong with the current one that is causing the printer to crash when it tries to list the files.