Simultaneous startup causing serial connection to fail

What is the problem?
If I power up the printer and the Raspberry Pi the same time (or the printer first, the RPi next) then I have serial connection issues in Octorprint. I press the connect button, and check the terminal tab, then I see strange broken messages from the printer, like:

Send: N0 M110 N0*125
Recv: cho:Unknown command: "� "

Sometimes it tries to send more messages, but the response arrives still wrong and delayed for tens of seconds. Sooner or later the RPi gives up:

Unexpected error while reading serial port, please consult octoprint.log for details: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793
Please see https://faq.octoprint.org/serialerror for possible reasons of this.

Until this time, it was discussed several times here, but my problem is different:
If I unplug then replug the USB cable between the the printer and the RPi, and then try to connect again, then everything works flawlessly! If I power on the Raspberry first, wait for Octoprint to start, then turn on the printer, then also everyting works perfectly. No issue at all.

But I want to power everyting up at the same time with a smart wall plug, so I DO need everyting to work this way also.

What did you already try to solve it?

  • Changed to factory 5.1V PSU for RPi
  • Disconnected everyting else from the RPi
  • Changed the baud rate in Marlin from 250000 to 115000
  • Insulated the 5V pin of the USB plug
  • Tried other USB cables: shieleded, and one with a ferrite ring
  • Disconnected TFT35 smart display from the printer
  • Disabled Bluetooth in config.txt: dtoverlay=pi3-disable-bt

Additional information about your setup
OctoPrint version: 1.3.12
OctoPi version: 0.17.0
Raspberry Pi 3 B+
Ender3 with SKR Mini E3 V1.2 board
Marlin version 2.0.3

Logs
dmesg via putty. Simultaneous startup:
(When fails)

[    3.152120] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SEL                                                                                                                                                             INUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +                                                                                                                                                             XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybr                                                                                                                                                             id)
[    3.182843] systemd[1]: Detected architecture arm.
[    3.212358] systemd[1]: Set hostname to <octopi>.
[    3.229654] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argumen                                                                                                                                                             t
[    3.351900] usb 1-1.1.3: new full-speed USB device number 4 using dwc_otg
[    3.422030] uart-pl011 3f201000.serial: no DMA platform data
[    3.515086] usb 1-1.1.3: New USB device found, idVendor=1eaf, idProduct=0004,                                                                                                                                                              bcdDevice= 2.00
[    3.529217] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                                                                             er=0
[    3.542280] usb 1-1.1.3: Product: Maple
[    3.548812] usb 1-1.1.3: Manufacturer: LeafLabs
[    3.657481] systemd[1]: File /lib/systemd/system/systemd-journald.service:12                                                                                                                                                              configures an IP firewall (IPAddressDeny=any), but the local system does not sup                                                                                                                                                             port BPF/cgroup based firewalling.
[    3.683286] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warni                                                                                                                                                             ng is only shown for the first loaded unit using IP firewalling.)
[    3.851812] usb 1-1.1.1: new high-speed USB device number 5 using dwc_otg
[    3.992264] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800,                                                                                                                                                              bcdDevice= 3.00
[    4.006689] usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumb                                                                                                                                                             er=0
[    4.161573] random: systemd: uninitialized urandom read (16 bytes read)
[    4.183515] random: systemd: uninitialized urandom read (16 bytes read)
[    4.201441] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    4.214905] random: systemd: uninitialized urandom read (16 bytes read)
[    4.225434] systemd[1]: Listening on Journal Socket (/dev/log).
[    4.238609] systemd[1]: Listening on udev Kernel Socket.
[    4.250869] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    4.285484] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): No Exte                                                                                                                                                             rnal EEPROM. Setting MAC Speed
[    4.286612] libphy: lan78xx-mdiobus: probed
[    4.352170] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): int urb                                                                                                                                                              period 64
[    5.041965] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    5.158619] systemd-journald[108]: Received request to flush runtime journal                                                                                                                                                              from PID 1
[    5.982010] vc_sm_cma: module is from the staging directory, the quality is u                                                                                                                                                             nknown, you have been warned.
[    5.984501] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    5.984516] [vc_sm_connected_init]: start
[    5.986950] [vc_sm_connected_init]: installed successfully
[    6.003406] media: Linux media interface: v0.10
[    6.050031] videodev: Linux video capture interface: v2.00
[    6.084466] bcm2835_mmal_vchiq: module is from the staging directory, the qua                                                                                                                                                             lity is unknown, you have been warned.
[    6.084470] bcm2835_mmal_vchiq: module is from the staging directory, the qua                                                                                                                                                             lity is unknown, you have been warned.
[    6.111932] bcm2835_v4l2: module is from the staging directory, the quality i                                                                                                                                                             s unknown, you have been warned.
[    6.127167] bcm2835_codec: module is from the staging directory, the quality                                                                                                                                                              is unknown, you have been warned.
[    6.154913] snd_bcm2835: module is from the staging directory, the quality is                                                                                                                                                              unknown, you have been warned.
[    6.163701] bcm2835_audio soc:audio: card created with 8 channels
[    6.336726] cfg80211: Loading compiled-in X.509 certificates for regulatory d                                                                                                                                                             atabase
[    6.339050] cdc_acm 1-1.1.3:1.0: ttyACM0: USB ACM device
[    6.340056] usbcore: registered new interface driver cdc_acm
[    6.340067] cdc_acm: USB Abstract Control Model driver for USB modems and ISD                                                                                                                                                             N adapters
[    6.436409] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.492045] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.504062] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio f                                                                                                                                                             or chip BCM4345/6
[    6.504978] usbcore: registered new interface driver brcmfmac
[    6.743401] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    6.743475] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    6.746833] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    6.746903] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    6.750641] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    6.750707] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    6.766756] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio f                                                                                                                                                             or chip BCM4345/6
[    6.822766] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27                                                                                                                                                              2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[    6.877611] random: crng init done
[    6.877628] random: 7 urandom warning(s) missed due to ratelimiting
[    8.517446] 8021q: 802.1Q VLAN Support v1.8
[    8.673364] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:1                                                                                                                                                             02396k SSFS
[    8.898282] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    8.898303] brcmfmac: power management disabled
[    9.158674] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.158693] 8021q: adding VLAN 0 to HW filter on device eth0
[   20.920468] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Here I unplugged and plugged back the USB cable...

[  297.534306] usb 1-1.1.3: USB disconnect, device number 4
[  297.534463] cdc_acm 1-1.1.3:1.0: failed to set dtr/rts
[  302.434768] usb 1-1.1.3: new full-speed USB device number 6 using dwc_otg
[  302.567925] usb 1-1.1.3: New USB device found, idVendor=1eaf, idProduct=0004,                                                                                                                                                              bcdDevice= 2.00
[  302.567934] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumb                                                                                                                                                             er=0
[  302.567938] usb 1-1.1.3: Product: Maple
[  302.567942] usb 1-1.1.3: Manufacturer: LeafLabs
[  302.568573] cdc_acm 1-1.1.3:1.0: ttyACM1: USB ACM device

dmesg via putty. Startup the Pi, wait Octoprint to run, then turn on the printer:
(When there is no problem)

[    3.152493] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    3.183267] systemd[1]: Detected architecture arm.
[    3.212935] systemd[1]: Set hostname to <octopi>.
[    3.230256] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
[    3.383365] dwc_otg_handle_wakeup_detected_intr lxstate = 2
[    3.405846] uart-pl011 3f201000.serial: no DMA platform data
[    3.598812] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    3.624482] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    3.821801] usb 1-1.1.1: new high-speed USB device number 4 using dwc_otg
[    3.952251] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800, bcdDevice= 3.00
[    3.966719] usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    4.110759] random: systemd: uninitialized urandom read (16 bytes read)
[    4.135576] random: systemd: uninitialized urandom read (16 bytes read)
[    4.145760] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    4.160105] random: systemd: uninitialized urandom read (16 bytes read)
[    4.170421] systemd[1]: Listening on udev Kernel Socket.
[    4.184069] systemd[1]: Listening on Journal Socket.
[    4.213830] systemd[1]: Starting Load Kernel Modules...
[    4.254694] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): No External EEPROM. Setting MAC Speed
[    4.271931] libphy: lan78xx-mdiobus: probed
[    4.301721] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): int urb period 64
[    5.073042] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    5.191286] systemd-journald[114]: Received request to flush runtime journal from PID 1
[    5.999732] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    6.002470] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    6.002485] [vc_sm_connected_init]: start
[    6.008530] [vc_sm_connected_init]: installed successfully
[    6.034651] media: Linux media interface: v0.10
[    6.089803] videodev: Linux video capture interface: v2.00
[    6.164476] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.169459] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.192133] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    6.277335] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    6.281664] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    6.297757] bcm2835_audio soc:audio: card created with 8 channels
[    6.311328] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    6.444572] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.527755] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.537581] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.538436] usbcore: registered new interface driver brcmfmac
[    6.763491] random: crng init done
[    6.763503] random: 7 urandom warning(s) missed due to ratelimiting
[    6.765558] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.797811] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[    6.823226] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    6.823275] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    6.826860] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    6.826898] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    6.830824] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    6.830860] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    8.540562] 8021q: 802.1Q VLAN Support v1.8
[    8.747980] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[    8.935519] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    8.935836] brcmfmac: power management disabled
[    9.230236] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.230246] 8021q: adding VLAN 0 to HW filter on device eth0
[   14.938759] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   71.341797] usb 1-1.1.3: new full-speed USB device number 5 using dwc_otg
[   71.474934] usb 1-1.1.3: New USB device found, idVendor=1eaf, idProduct=0004, bcdDevice= 2.00
[   71.474947] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   71.474956] usb 1-1.1.3: Product: Maple
[   71.474966] usb 1-1.1.3: Manufacturer: LeafLabs
[   71.529652] cdc_acm 1-1.1.3:1.0: ttyACM0: USB ACM device
[   71.530560] usbcore: registered new interface driver cdc_acm
[   71.530569] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

Serial.log Simultaneous startup:
(When fails):

2020-02-15 14:03:53,390 - Changing monitoring state from "Offline" to "Detecting serial port"
2020-02-15 14:03:53,412 - Serial port list: ['/dev/ttyACM0']
2020-02-15 14:03:53,413 - Connecting to: /dev/ttyACM0
2020-02-15 14:03:53,416 - Changing monitoring state from "Detecting serial port" to "Opening serial port"
2020-02-15 14:03:53,420 - Connected to: Serial<id=0x6987b890, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2020-02-15 14:03:53,420 - Starting baud rate detection...
2020-02-15 14:03:53,421 - Changing monitoring state from "Opening serial port" to "Detecting baudrate"
2020-02-15 14:03:54,429 - Trying baudrate: 115200
2020-02-15 14:03:54,445 - Send: N0 M110 N0*125
2020-02-15 14:03:54,448 - Recv: cho:Unknown command: "� "
2020-02-15 14:03:54,451 - Recv: ok
2020-02-15 14:03:54,456 - Changing monitoring state from "Detecting baudrate" to "Operational"
2020-02-15 14:03:54,469 - Send: N0 M110 N0*125
2020-02-15 14:03:54,532 - Unexpected error while reading serial port, please consult octoprint.log for details: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793
2020-02-15 14:03:54,536 - Please see https://faq.octoprint.org/serialerror for possible reasons of this.
2020-02-15 14:03:54,541 - Changing monitoring state from "Operational" to "Offline (Error: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793)"
2020-02-15 14:03:54,699 - Connection closed, closing down monitor

Now I unplugged then replugged USB cable

2020-02-15 14:08:32,283 - Changing monitoring state from "Offline" to "Detecting serial port"
2020-02-15 14:08:32,353 - Serial port list: ['/dev/ttyACM1']
2020-02-15 14:08:32,353 - Connecting to: /dev/ttyACM1
2020-02-15 14:08:32,359 - Changing monitoring state from "Detecting serial port" to "Opening serial port"
2020-02-15 14:08:32,364 - Connected to: Serial<id=0x6987b070, open=True>(port='/dev/ttyACM1', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2020-02-15 14:08:32,365 - Starting baud rate detection...
2020-02-15 14:08:32,367 - Changing monitoring state from "Opening serial port" to "Detecting baudrate"
2020-02-15 14:08:33,374 - Trying baudrate: 115200
2020-02-15 14:08:33,382 - Send: N0 M110 N0*125
2020-02-15 14:08:33,385 - Recv: ok
2020-02-15 14:08:33,389 - Changing monitoring state from "Detecting baudrate" to "Operational"
2020-02-15 14:08:33,397 - Send: N0 M110 N0*125
2020-02-15 14:08:33,403 - Recv: ok
2020-02-15 14:08:33,406 - Send: N1 M115*39
2020-02-15 14:08:33,409 - Recv: FIRMWARE_NAME:Marlin 2.0.3 (GitHub) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Ender-3 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
2020-02-15 14:08:33,423 - Recv: Cap:SERIAL_XON_XOFF:0
2020-02-15 14:08:33,436 - Recv: Cap:BINARY_FILE_TRANSFER:0
2020-02-15 14:08:33,438 - Recv: Cap:EEPROM:
2020-02-15 14:08:33,440 - Recv: Cap:SOFTWARE_POWER:0
2020-02-15 14:08:33,442 - Recv: Cap:TOGGLE_LIGHTS:0
2020-02-15 14:08:33,443 - Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
2020-02-15 14:08:33,445 - Recv: Cap:EMERGENCY_PARSER:0
2020-02-15 14:08:33,447 - Recv: Cap:PROMPT_SUPPORT:0
2020-02-15 14:08:33,448 - Recv: Cap:AUTOREPORT_SD_STATUS:0
2020-02-15 14:08:33,451 - Recv: Cap:THERMAL_PROTECTION:1
2020-02-15 14:08:33,453 - Recv: Cap:MOTION_MODES:0
2020-02-15 14:08:33,454 - Recv: Cap:CHAMBER_TEMPERATURE:0
2020-02-15 14:08:33,455 - Recv: ok
2020-02-15 14:08:33,458 - Send: M21
2020-02-15 14:08:33,473 - Recv: echo:SD card ok
2020-02-15 14:08:33,476 - Recv: ok
2020-02-15 14:08:33,478 - Send: M20
2020-02-15 14:08:33,480 - Recv: Begin file list
2020-02-15 14:08:33,503 - Recv: XYZCAL~1.GCO 1349468
2020-02-15 14:08:33,505 - Recv: SHIFTE~1.GCO 1728888
2020-02-15 14:08:33,506 - Recv: MOVETE~1.GCO 121806
2020-02-15 14:08:33,508 - Recv: SINGLE~1.GCO 71416
2020-02-15 14:08:33,510 - Recv: SHIFTE~3.GCO 5165272
2020-02-15 14:08:33,513 - Recv: End file list
2020-02-15 14:08:33,518 - Recv: ok
2020-02-15 14:08:38,390 - Send: M105
2020-02-15 14:08:38,397 - Recv: ok T:20.32 /0.00 B:20.31 /0.00 @:0 B@:0
2020-02-15 14:08:43,395 - Send: M105
2020-02-15 14:08:43,402 - Recv: ok T:20.22 /0.00 B:19.69 /0.00 @:0 B@:0
2020-02-15 14:08:48,396 - Send: M105
2020-02-15 14:08:48,405 - Recv: ok T:20.00 /0.00 B:19.22 /0.00 @:0 B@:0

Serial.log: Startup the Pi, wait Octoprint to run, then turn on the printer:
(When there is no problem)

2020-02-15 14:34:43,058 - Changing monitoring state from "Offline" to "Detecting serial port"
2020-02-15 14:34:43,082 - Serial port list: ['/dev/ttyACM0']
2020-02-15 14:34:43,082 - Connecting to: /dev/ttyACM0
2020-02-15 14:34:43,087 - Changing monitoring state from "Detecting serial port" to "Opening serial port"
2020-02-15 14:34:43,089 - Connected to: Serial<id=0x70db41b0, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2020-02-15 14:34:43,091 - Starting baud rate detection...
2020-02-15 14:34:43,092 - Changing monitoring state from "Opening serial port" to "Detecting baudrate"
2020-02-15 14:34:44,098 - Trying baudrate: 115200
2020-02-15 14:34:44,113 - Send: N0 M110 N0*125
2020-02-15 14:34:44,115 - Recv: ok
2020-02-15 14:34:44,121 - Changing monitoring state from "Detecting baudrate" to "Operational"
2020-02-15 14:34:44,140 - Send: N0 M110 N0*125
2020-02-15 14:34:44,146 - Recv: ok
2020-02-15 14:34:44,151 - Send: N1 M115*39
2020-02-15 14:34:44,155 - Recv: FIRMWARE_NAME:Marlin 2.0.3 (GitHub) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Ender-3 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
2020-02-15 14:34:44,172 - Recv: Cap:SERIAL_XON_XOFF:0
2020-02-15 14:34:44,186 - Recv: Cap:BINARY_FILE_TRANSFER:0
2020-02-15 14:34:44,204 - Recv: Cap:EEPROM:Cap:Z_PROBE:0
2020-02-15 14:34:44,215 - Recv: Cap:LEVELING_DATA:1
2020-02-15 14:34:44,218 - Recv: Cap:BUILD_PERCENT:1
2020-02-15 14:34:44,221 - Recv: Cap:SOFTWARE_POWER:0
2020-02-15 14:34:44,223 - Recv: Cap:TOGGLE_LIGHTS:0
2020-02-15 14:34:44,225 - Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
2020-02-15 14:34:44,228 - Recv: Cap:EMERGENCY_PARSER:0
2020-02-15 14:34:44,231 - Recv: Cap:PROMPT_SUPPORT:0
2020-02-15 14:34:44,233 - Recv: Cap:AUTOREPORT_SD_STATUS:0
2020-02-15 14:34:44,237 - Recv: Cap:THERMAL_PROTECTION:1
2020-02-15 14:34:44,239 - Recv: Cap:MOTION_MODES:0
2020-02-15 14:34:44,243 - Recv: Cap:CHAMBER_TEMPERATURE:0
2020-02-15 14:34:44,245 - Recv: ok
2020-02-15 14:34:44,252 - Send: M21
2020-02-15 14:34:44,269 - Recv: echo:SD card ok
2020-02-15 14:34:44,336 - Recv: ok
2020-02-15 14:34:44,339 - Send: M20
2020-02-15 14:34:44,353 - Recv: Begin file list
2020-02-15 14:34:44,397 - Recv: XYZCAL~1.GCO 1349468
2020-02-15 14:34:44,403 - Recv: SHIFTE~1.GCO 1728888
2020-02-15 14:34:44,405 - Recv: MOVETE~1.GCO 121806
2020-02-15 14:34:44,406 - Recv: SINGLE~1.GCO 71416
2020-02-15 14:34:44,408 - Recv: SHIFTE~3.GCO 5165272
2020-02-15 14:34:44,410 - Recv: End file list
2020-02-15 14:34:44,413 - Recv: ok
2020-02-15 14:34:49,122 - Send: M105
2020-02-15 14:34:49,130 - Recv: ok T:19.34 /0.00 B:19.53 /0.00 @:0 B@:0
2020-02-15 14:34:54,123 - Send: M105
2020-02-15 14:34:54,131 - Recv: ok T:19.56 /0.00 B:19.37 /0.00 @:0 B@:0
2020-02-15 14:34:59,124 - Send: M105
2020-02-15 14:34:59,134 - Recv: ok T:19.34 /0.00 B:19.69 /0.00 @:0 B@:0

Thank you for your kind help in advance!

If the Pi's power adapter wins the race (with the printer controller's brick) then the Pi starts up first and starts sinking 5V over to the printer controller, dragging down the Pi's power. In this condition (at least initially) it may operate in an undervoltage condition.

And yet, this is how I power up all my printers, specifically with an...

  • APC brand UPS
  • TP-Link SmartPlug
  • IKEA KOPPLA
    • 5V @ 2.5A Raspberry power adapter
    • 24V power brick for the printer

I really don't see why powering up the printer first and the Pi, second, should give you any troubles. If it were me, I would focus on making sure that the Pi isn't in an undervoltage condition and in making sure that your serial cable has internal metallic shielding or a ferrite core.

Others have suggested that you may want to put tape on the USB 5V pin on your serial cable to prevent your Pi from sinking power over to your printer board.

@OutsourcedGuru In the "already tried" section I've mentioned I insulated the 5V pin of the USB plug. So I put a thin stripe of electrical tape on the 5V connector of the USB plug between the printer and the RPi.
Powering up the printer first was only an example how I can also reproduce the problem. Of course I plan to power up everything at the same time.
I have a quite short USB cable with internal metallic shielding. I also have a bit longer one with a ferrite ring on it. Both acting exactly the same.
I am sure the Pi is not in an udervoltage connection. I plugged a stripped USB cable into the Pi and measured the voltage with a multimeter. As soon as the USB connector powers up (few seconds after startup) I measured between 5.15V and 5.18V on it.

In the Files side panel widget manually select the port and the baudrate of 115200, click both checkboxes and press the Connect button. In theory, it won't try other ports and speeds and minimize any other things which could be going on which might contribute to a race condition.

At this point if it were me, I would double-check all connections on the printer board, the power connections for that and all connectors to the hotend/bed. All connections need to be tightly seated. Look for any corroded connections, especially with the input power itself. It's possible that something was arcing and is contributing to the slow startup of the printer board.

You might also try some odd things like removing the SD card from the printer board and re-routing the serial cable so that it's not parallel to any other cables.

Finally, you might consider the idea that this isn't your printer at all, that it's the power in the wall outlet that's dropping from time to time. Plug it into a UPS.

Hi there! I am coming from the Hell, and then from Heaven. :slight_smile:

I spent the whole yesterday trying to solve the issue, and at the end, I gave up. I decided to go with a relay (I have some laying around from my arduino past), so I installed the PSU control plugin. I followed Teaching Tech's video, I did almost everything the same he did (the UI changed a bit since then). When I pressed save settings (or similar), it took extraordinary long time to do it. I restarted Octoprint and the web UI never came back. My browser was waiting for the response forever. It took hours to find where is the config.yaml (SSH still worked) to force octoprint to start in safe mode. :frowning: The web UI came alive, I uninstalled the plugin, but did not solve it. I lost the web UI forever in normal mode.

So I took the good old balenaEtcher, and reinstalled Octoprint from scratch. Again. And guess what! Everyting works! I power up the printer and RPi at the same time, and it connects without any issue! Anytime!

Message into the future with similar problem: Sorry guys, I don't know what caused the issue. For the second time I did not install some plugins like Emergency Stop Button, WebcamTab, Bed leveling wizard, PSU Control...

And for this time, I did not tick the Save connection settings and Auto-connect on server startup checkboxes. Maybe this last one caused all my issues?... :thinking:
I know for the first install checked it, but then when I found out my issues, I unchecked it. Maybe Octoprint handles badly unchecking that checkbox... Don't check it anyway.

1 Like