Problem switching between printers

Basic Information:

Printer Model: Ender 3 s1: Ender 3 max neo
MCU / Printerboard: original : v4.2.7
Host / SBC sonic pad running jpe230 debian
klippy.log
printer 2 log.log (580.1 KB)
printer 1 log.log (465.3 KB)

Describe your issue:

i recently added a second printer and both printers run fine,
but when i switch between the printers the one that was connected loses connection as soon as i connect to the other.

Lost communication with MCU ‘rpi’
Once the underlying issue is corrected, use the
“FIRMWARE_RESTART” command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

This is the error it gives and i cant figure it out.

i managed to solve it by commenting these lines
#[mcu rpi]

#serial: /tmp/klipper_host_mcu

#[adxl345]

#cs_pin: rpi:None

#spi_speed: 2000000

#spi_bus: spidev2.0

#[resonance_tester]

#accel_chip: adxl345

#probe_points:

122, 115, 10

Will having Commented these have impact on my imput shaping or will it work?
printer (1).cfg (6.3 KB)

1 Like

Reason for your error:

  1. You are running TWO independent instances of Klipper on your SBC.
  2. By following RPi microcontroller - Klipper documentation, you have created ONE instance of the “virtual” MCU with its endpoint on /tmp/klipper_host_mcu.
  3. When using both Klipper instances, they will “battle” for exclusive access to /tmp/klipper_host_mcu, and the one that loses will react with the above error message.

Try the following approach (untested):

sudo cp /etc/systemd/system/klipper-mcu.service /etc/systemd/system/klipper-mcu2.service
sudo nano /etc/systemd/system/klipper-mcu2.service

Modify /etc/systemd/system/klipper-mcu2.service as follows:

# Systemd klipper linux mcu Service

[Unit]
Description=Starts the MCU Linux firmware for klipper on startup
Documentation=https://www.klipper3d.org/RPi_microcontroller.html
Before=klipper.service
ConditionFileIsExecutable=/usr/local/bin/klipper_mcu

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
# Create a new endpoint for the second Klipper instance
Environment=KLIPPER_HOST_MCU_SERIAL=/tmp/klipper_host_mcu2
RemainAfterExit=yes
ExecStart=/usr/local/bin/klipper_mcu -r -I ${KLIPPER_HOST_MCU_SERIAL}
ExecStop=sh -c 'echo "FORCE_SHUTDOWN" > ${KLIPPER_HOST_MCU_SERIAL}'
ExecStop=sleep 1
TimeoutStopSec=2
Restart=always
RestartSec=5

Enable and start the second instance of the SBC MCU:

sudo systemctl enable klipper-mcu2.service
sudo systemctl start klipper-mcu2.service

Modify the printer.cfg of your second printer to:

[mcu rpi]
serial = /tmp/klipper_host_mcu2
1 Like