Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Commit 9fa047e breaks Klipper serial interface on Buster #857

Closed
ReXT3D opened this issue Dec 21, 2022 · 2 comments
Closed

[BUG] Commit 9fa047e breaks Klipper serial interface on Buster #857

ReXT3D opened this issue Dec 21, 2022 · 2 comments

Comments

@ReXT3D
Copy link

ReXT3D commented Dec 21, 2022

Description

Commit 9fa047e triggers installation of 191 new packages on Pi OS Legacy (Buster). One or more of these packages permanently affect Klipper's ability to correctly communicate with the MCU via the serial (USB) interface. This is exhibited by Klipper "hanging" during FIRMWARE_RESTART or losing communication with the MCU shortly after a restart.

Klipper logs are filled with errors related to serial communication such as: Got error -1 in read: (11)Resource temporarily unavailable, Timeout on wait for 'tmcuart_response' response and similar.

For more information refer to my Recent KlipperScreen commits break Klipper on Buster thread on Klipper Discourse.

To Reproduce

  1. Install fresh image of 2022-09-22-raspios-buster-armhf-lite.img from raspberrypi.com
  2. Boot the Pi and install all Raspberry Pi OS updates
  3. Install Klipper, Moonraker and Fluidd (or Mainsail) from their repective repos, either manually or with KIAUH
  4. Verify that Klipper functions correctly and confirm that FIRMWARE_RESTART behaves normally
  5. Install KlipperScreen manually via git clone https://github.com/jordanruthe/KlipperScreen.git
  6. In ~/KlipperScreen/ switch to commit 82b8cbc via git checkout 82b8cbcca5864c4b42ddd05a4e18000cc015c716
  7. Verify that Klipper functions correctly and confirm that FIRMWARE_RESTART behaves normally
  8. In ~/KlipperScreen/ switch to commit 9fa047e via git checkout 9fa047eb8beb3f503821b560e3364e3935f52bd2
  9. Confirm that Klipper no longer functions correctly by issuing FIRMWARE_RESTART that will either "hang" Klipper or cause loss of MCU communications
  10. Unistall KlipperScreen
  11. Confirm that Klipper still does not function correctly by issuing FIRMWARE_RESTART that will either "hang" Klipper or cause loss of MCU communications

This behaviour is particularly troubling since it appears like hardware malfunction and uninstalling KlipperScreen does not fix it. A completely new SD card image is required with limited and controlled component reinstallation to avoid introducing the issue again.

Note that this bug does not appear when following the exact same steps on the more recent Bullseye release of Raspberry Pi OS.

@ReXT3D ReXT3D changed the title [BUG] Commit 9fa047e breaks Klipper serial interface on Bullseye [BUG] Commit 9fa047e breaks Klipper serial interface on Buster Dec 21, 2022
@ReXT3D
Copy link
Author

ReXT3D commented Dec 21, 2022

One of the 191 "pre requisite" packages that are being installed and automatically started as part of this commit is "ModemManager". It is also automatically started and it interferes with the serial interface function required by Klipper. A workaround is to disable ModemManager as follows:

sudo systemctl mask ModemManager.service

Interestingly, I do not see ModemManager being installed on Bullseye. The fundamental question remains why libmpv-dev pulls-in 191 pre-requisite packages on Buster?

Credits to Dragonkitty (replimat.eu) on Discord for describing the root cause of the issue.

EDIT: replaced disable in the command line with mask for more persistent solution.

@alfrix alfrix closed this as completed in eeffdd2 Jan 29, 2023
@thijstriemstra
Copy link
Contributor

thijstriemstra commented Aug 19, 2024

It looks like some KlipperScreen dependency installs ModemManager, I also found it on my Bookworm system.

Traceback from klippy.log:

Starting heater checks for extruder
Write g-code response
Traceback (most recent call last):
  File "/home/foo/klipper/klippy/gcode.py", line 459, in _respond_raw
    os.write(self.fd, (msg+"\n").encode())
BlockingIOError: [Errno 11] Resource temporarily unavailable

Removed the service and that error is gone (fingers crossed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants