Ender 3 PRO/RPi4/BLTouch: Edit: Marlin successfully flashed, but now having issues with having the nozzle printing too high above the bed

What is the problem?

Octopi doesnt connect

What did you already try to solve it?

Downloaded new version, and flashed new version. Then formated SD card and flashed new version again. Also tried different cables. Searched every thread with this issue i could find.

Complete Logs

Connecting to: /dev/ttyUSB0
Changing monitoring state from "Offline" to "Opening serial port"
Connected to: Serial<id=0xabe853f0, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Changing monitoring state from "Opening serial port" to "Connecting"
Send: N0 M110 N0*125
Send: N0 M110 N0*125
No answer from the printer within the connection timeout, trying another hello
Send: N0 M110 N0*125
There was a timeout while trying to connect to the printer
Changing monitoring state from "Connecting" to "Offline"
Connection closed, closing down monitor

octoprint.log (26.3 KB)

Additional information about your setup

OctoPrint version: 1.3.12, OctoPi version: 0.17.0, printer: Ender 3 Pro, firmware: Marlin 1.19, browser: chrome, operating system: Win10, Octoprint is running off a RPi 4 that is connected via USB to my printer>

If I attempt to connect using AUTO Serial Port and Baudrate, this is the log I get:


Serial port list: ['/dev/ttyUSB0']
Connecting to: /dev/ttyUSB0
Changing monitoring state from "Detecting serial port" to "Opening serial port"
Connected to: Serial<id=0xabf7c730, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Starting baud rate detection...
Changing monitoring state from "Opening serial port" to "Detecting baudrate"
Trying baudrate: 115200
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 250000
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 230400
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 57600
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 38400
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 19200
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Trying baudrate: 9600
Send: N0 M110 N0*125
Baudrate test retry #1
Send: N0 M110 N0*125
Baudrate test retry #2
Send: N0 M110 N0*125
Baudrate test retry #3
Send: N0 M110 N0*125
Baudrate test retry #4
Send: N0 M110 N0*125
Changing monitoring state from "Detecting baudrate" to "Error: No more baudrates to test, and no suitable baudrate found."
Changing monitoring state from "Error: No more baudrates to test, and no suitable baudrate found." to "Offline (Error: No more baudrates to test, and no suitable baudrate found.)"
Connection closed, closing down monitor

I'm at the end of my tether with this. I had a perfectly working Octoprint running, then I attempted to edit my firmware to install my BLTouch and I've had problem after problem. This is one I simply cannot figure out. I feel like I've tried everything except reach out with my logs. Please end my suffering

Note that these are not complete logs. Help us help you, and read the article linked from the word logs.

Oh oops my bad, thanks for the heads up. I attached the full logs file now

From the log:
SerialException: [Errno 9] Could not exclusively lock port /dev/ttyUSB0: [Errno 9] Bad file descriptor
That would be a problem.

In the serial port dropdown, is there anything listed except "AUTO"?

Oh uhhh only /dev/ttyUSB0.
Pretty sure that was the option when I had it working before this mess started, but im not sure.

just to be sure - the printer is turned on, right?

Try to power down the pi and unplug it, turn on the printer and plug in the pi again.
If that works this could be a permanent solution for you:

The Pi 4 usb does weird things after it crashed because too much current was drawn.

Yeah the printer is on.
Thats a weird one, thanks for the tip. I just tried it though and it didnt fix it though.
However I did notice that the LCD screen on my Ender doesnt show the bootscreen and then normal menu, it is just on with nothing else. Could this mean something? I installed marlin and then wiped the SD card on my RPi to reinstall everything.

Yeah that's definitely not normal.
Does the display show anything when you turn on the printer without an usb cable connected?

No it doesn't. What the heck did I do to it

then I'm pretty sure something is wrong with the marlin you flashed.
did you configure it yourself or did you download it from somewhere?
how did you flash it?

Okay so what i did was:
SSH into my Pi to edit the Marlin config to enable the settings for BLTouch according to this blog post: https://blog.gruby.com/2020/01/05/installing-a-bltouch-on-an-ender-3-pro/
It didnt work so I downloaded a fresh Marlin and edited that on my PC and then sent it to the Pi.
It didnt work so I attempted to install Klipper and use that to edit the firmware. It didnt work.
So I decided to wipe everything and start from scratch. I downloaded the newest version of Octopi and formatted my SD card and flashed on the new Octopi.
Ever since I've done that I'm getting these connection errors on my printer. Did I screw something up in my troubleshooting..? Everything Ive tried to do since attempting to install my BLTouch has not worked.

First of all don't worry - I'm pretty sure we can fix your problem.
I guess something went wrong when you flashed Marlin.

I don't know whether your board got the bootloader for usb flashing installed or not. AFAIK they used it on newer Ender 3 models.
But even if you had the bootloader we don't know if it got damaged when you tried to flash the new firmware.
So I would say we try to flash the complete thing - bootloader and Marlin.
Give me a few minutes.. I'll search for some guides that should work for you.

btw do you have an arduino on hand?
If not I would suggest you buy a cheap Arduino Uno clone and some jumper cables first.
It's possible to flash the bootloader with a pi but it's pretty messy.
There are some ready to go images with everything in place but they are a few years old and don't support a pi 4.
Here's one guide on how to do it with a raspberry

Okay cool thanks for the help!
I dont have an Arduino no :frowning: I have installed Marlin before without it though, i do remember it being quite the task but I believe I can do it again. I will run through the guide you posted and see if I can get it running again.

Okay so I followed the guide and was successful with loading the bootloader to my printer.
I then started to work on loading the Marlin firmware again, but encountered many errors when compiling the code on Arduino IDE. I am using: Board: Sanguino. Processor: ATmega1284 (16MHz). Port COM3. Programmer Arduino as ISP.
These are the errors I am getting (it made me zip):
compiling errors arduino IDE.zip (17.2 KB)

Sorry for the huge paste dump. I had these compiling errors before when I was attempting to edit my firmware for BLTouch, so I decided to reinstall octoprint and everything in an attempt to fix it which eventually led me here in the first place... What the heck are these compiling errors all about? My efforts on googling them are not helping.

Edit: I notice that in the error logs it tells me to change the board to Arduino Mega or Mega 2560. I did this and then the code compiles successfully... But I cant use this compiled code right? I need it to be compiled for Sanguino board? Idk

It depends on the generation/version of board you have I believe.

Idk if Sanguino works for an Ender. I used it a few years ago for an Anet A8 but never since.
I would suggest you try to compile the firmware in Visual Studio Code with Platform IO installed.

If it doesn't work zip and upload the whole Marlin folder. I'll try to compile it for you.

Great suggestion. I actually have been working hard at this over the last day and found that I could use VSC and Platform IO as an alternative method to compile. So I did that, and everything fell into place from there. I successfully loaded the new bootloader and firmware. YAY!
Thanks a lot for all your help.

I do now have new issues to deal with but I'm glad the firmware is completely sorted now. The issue I have now though is that there appears to be something wrong with the Z value for Home as when enter G28 it rests at 161, 133, 15 (BLTouch Probe is in the centre of the bed, but 15mm above the bed). I have attempted to change this with the Z Offset functions and using M851 (from various solutions I found online) but it doesnt seem to be working. I will continue working at this tomorrow as I desperately need my printer back in action ASAP but if you know how I could fix this or where I should look/ask I would love to know.

Thanks again for responding to me and helping me troubleshoot this nightmare.

That sounds like a z safe homing offset. For example when I home, it always ends 10mm above the bed because that's what I set it to, but the Z value does report it as being at 10mm plus my M851 offset.

I would question what is returned by M114 right after you G28?

You could be right there but idk how to fix it. Here is the M114 result:
Send: M114
Recv: X:161.00 Y:133.00 Z:15.00 E:0.00 Count X:12880 Y:10640 Z:6000
Recv: ok

Here are the changes I made to Marlin to enable my BLTouch:
//#define SHOW_CUSTOM_BOOTSCREEN
#define CUSTOM_MACHINE_NAME "Ender 3 Pro"
#define BLTOUCH
#define NOZZLE_TO_PROBE_OFFSET { -44, -16, 0 }
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z / 5
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_MIN_PROBE_REPEATABILITY_TEST
#define PROBING_FANS_OFF // Turn fans off when probing
#define AUTO_BED_LEVELING_BILINEAR
#define RESTORE_LEVELING_AFTER_G28
#define LEVEL_BED_CORNERS
#define Z_SAFE_HOMING
//#define SDSUPPORT
#define SLIM_LCD_MENUS

When I manually send the Z axis down to Z0, i measured that the nozzle is still 2.7mm off the bed. The weird thing is, when I do a G29, it tells me that it is sending the nozzle to Z -17.7 which appears to be 15 +2.7 ? So it seems to know where the bed it and how far away Z home is from it, but it is deciding to print at Z2.7 anyway? I dont get it

edit: I should clarify that it is indeed printing at Z0, but Z0 is 2.7 above the bed