Background
A “Timer too close” error occurs when the MCU attempts to schedule a timer for a target time that is in the past. It almost always occurs as a result of a message from the host requesting an action at a time that is now in the past.
It is important to understand that Klipper essentially knows which command was scheduled in the past, but not why it happened. For example, a message is delayed because the webcam is blocking the USB port: The message contains a command whose target time is now in the past, but the reason is beyond Klipper’s control.
Reasons
- High system load of the host
- High disk activity of the host
- Swapping due to low free memory
- Disk errors / dying SD card
- Unstable voltage
- Other hardware hogging the USB bus or other system resources
- Running in a Virtual Machine
- USB, UART or CANBUS wiring faults leading to extremely delayed messages
- Electro-Magnetic Interference (EMI) affecting proper signal transmission or leading to high resend rates
- Wrong
Clock Reference
used during building the board’s firmware (make menuconfig
), confusing the timing between host and board - Bugs in slicers and/or macros can flood Klipper’s command queue with meaningless commands, e.g. dozens of fan speed changes per second.
- Using unofficial “extra” modules or Klipper modifications outside the main line.
Potential solutions
- Check for other resource-intensive processes running in parallel
- Remove additional hardware, especially webcams and displays
- Generally try to simplify your setup as much as possible
- Check SD card for errors / replace SD card
- Check for
Under-voltage detected!
errors / make sure to use a good and adequate power supply - Do not run data lines (USB, UART, CANBUS) close to or in parallel with high current lines such as heaters or steppers. Use high quality cables (shielded / ferrite core). Keep such cables as short as possible.
- Ensure sufficient cooling of the host’s SBC to avoid CPU throttling due to overheating
- Also see Advanced Trouble-Shooting / Graphing Klipper
- Verify that the correct
Clock Reference
during building the board’s firmware is used. Mind that certain boards have various revisions / flavors that might require different clock settings - Identify and disable macros that continuously generate commands or data during printing, especially in response to frequently used commands.
- Check the Gcode produced by the slicer for obvious, high frequency occurrences of certain commands, e.g.
M106
- Remove any Klipper modifications that are not part of the official Klipper repository