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

[QUESTION]How to use mcu_timing #14

Open
airbornetrooper82573 opened this issue Nov 2, 2023 · 3 comments
Open

[QUESTION]How to use mcu_timing #14

airbornetrooper82573 opened this issue Nov 2, 2023 · 3 comments
Labels
question Further information is requested

Comments

@airbornetrooper82573
Copy link

airbornetrooper82573 commented Nov 2, 2023

I need to adjust mcu_timing because I keep getting communication errors when running QGL on my voron 2.4 350mm. I have no other can bus issues I could find but this is becoming more of an issue. Google led me here. I just can't figure out how to install and make this script work.

@airbornetrooper82573 airbornetrooper82573 added the question Further information is requested label Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 2023

Welcome airbornetrooper82573!\nCongrats on creating your first issue.\nPlease follow the issue template to help us resolve your issue quickly.

@o1hitman1o
Copy link

@airbornetrooper82573 upload to pi via ssh, I used the directory /home/pi/printer_data/config/scripts once uploaded you will have to give it permission to execute.
chmod 755 mcu_timing.sh
Then you can run it with ./mcu_timing.sh install
The next time you need to update klipper when there is an update you would ssh to the pi and to go to the directory were you have it /home/pi/printer_data/config/scripts and run the script but with the update parameter
./mcu_timing.sh update.

I didn't want to do that each time to I just made a macro in mainsail so i just have a button to update.
I first created a file klipper_update_mcu_timing.sh and gave is 755 permissions and put only the update section of the script in the file.

echo "Updating klipper repo and restoring custom mcu.py file..."
# save the custom mcu.py file
cp ~/klipper/klippy/mcu.py /tmp/mcu.py
# remove the custom mcu.py file
rm ~/klipper/klippy/mcu.py
cd ~/klipper || exit
# update the klipper repo
git pull
# restore the custom mcu.py file
cp /tmp/mcu.py ~/klipper/klippy/mcu.py
# remove the backed up custom mcu.py file
rm /tmp/mcu.py
# Report success or failure
if grep -q "TRSYNC_TIMEOUT = 0.05" ~/klipper/klippy/mcu.py; then
echo -e "\e[32mUpdated successfully\e[0m"
else
echo -e "\e[31mUpdate failed\e[0m"
fi

I then have a seperate file called shell_commands.cfg with this info in it.

[gcode_shell_command mcu_timing_cfg]
command: sh /home/pi/printer_data/config/scripts/klipper_update_mcu_timing.sh
timeout: 30.
verbose: True

[gcode_macro MCU_FIX_CFG]
gcode:
RUN_SHELL_COMMAND CMD=mcu_timing_cfg

This allows me to have a button to update via the dashboard.

@rootiest
Copy link
Owner

rootiest commented Mar 3, 2024

@airbornetrooper82573,

@o1hitman1o has the right idea.

I have tried to covey as well that this mcu_timing script is a sort of band-aid for this issue.
No one should use it unless they have no other option to correct this problem.

Additionally, there have been some changes pushed to the Klipper mcu firmware recently that should help with this issue so for many this script should no longer be necessary.

The new update changes TR_SYNC to give it more buffer during homing, which is where most people encounter this issue.

You may remember needing to reflash your firmwares recently, that was the update that made this change.

So for anyone still using this script, I do recommend trying again without it to see if you no longer need it.

Feel free to add any additional suggestions/questions, and let me know if you still find you need this script after the new update!

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

No branches or pull requests

3 participants