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

'ResonanceTester' object has no attribute 'test' (latest Klipper break Shake&Tune) #172

Closed
1 task done
TheMeanCanEHdian opened this issue Dec 7, 2024 · 36 comments · Fixed by #181
Closed
1 task done
Labels
bug Something isn't working done Issue is done but not merged on main

Comments

@TheMeanCanEHdian
Copy link

TheMeanCanEHdian commented Dec 7, 2024

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v4.1.0-1-g66f5e32e

Describe the bug and expected behavior

When attempting to run Shake & Tune on the latest Klipper version I get the error 'ResonanceTester' object has no attribute 'test'.

CleanShot 2024-12-07 at 12 05 22@2x

Could this be related to the recent Klipper behavior change for test_resonances?
Klipper3d/klipper@16b4b6b

Additional information and klippy.log

Klipper Version: v0.12.0-396-gb7233d11
klippy.log

@TheMeanCanEHdian TheMeanCanEHdian added the bug Something isn't working label Dec 7, 2024
@mustang5269
Copy link

klippy-2.log

Same issue as well.

@dclift97
Copy link

dclift97 commented Dec 8, 2024

Also having the same issue


`Internal Error on WebRequest: gcode/script
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/webhooks.py", line 256, in _process_request
    func(web_request)
  File "/home/pi/klipper/klippy/webhooks.py", line 436, in _handle_script
    self.gcode.run_script(web_request.get_str('script'))
  File "/home/pi/klipper/klippy/gcode.py", line 230, in run_script
    self._process_commands(script.split('\n'), need_ack=False)
  File "/home/pi/klipper/klippy/gcode.py", line 212, in _process_commands
    handler(gcmd)
  File "/home/pi/klipper/klippy/gcode.py", line 140, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 189, in cmd
    self.template.run_gcode_from_command(kwparams)
  File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 68, in run_gcode_from_command
    self.gcode.run_script_from_command(self.render(context))
  File "/home/pi/klipper/klippy/gcode.py", line 227, in run_script_from_command
    self._process_commands(script.split('\n'), need_ack=False)
  File "/home/pi/klipper/klippy/gcode.py", line 212, in _process_commands
    handler(gcmd)
  File "/home/pi/klipper/klippy/gcode.py", line 140, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/shaketune/shaketune.py", line 162, in cmd_COMPARE_BELTS_RESPONSES
    compare_belts_responses(gcmd, self._pconfig, st_process)
  File "/home/pi/klipper/klippy/extras/shaketune/commands/compare_belts_responses.py", line 26, in compare_belts_responses
    min_freq = gcmd.get_float('FREQ_START', default=res_tester.test.min_freq, minval=1)
                                                    ^^^^^^^^^^^^^^^
AttributeError: 'ResonanceTester' object has no attribute 'test'`

@Masterpc96
Copy link

Also have the same issue :/

@BOAndy1985
Copy link

This has to do with the new Klipper update, something was changed in the shaper calibration. I have the same problem.

@Frix-x
Copy link
Owner

Frix-x commented Dec 8, 2024

Yes this indeed a known problem. Klipper has merged a change in the resonance testing code (with a new kind of test) and Shake&Tune is impacted. So until I fix the compatibility, please either:

  • Remove the [shaketune] section from your config and use the standard Klipper scripts
  • Or keep Shake&Tune but don't update Klipper for now

I'm at SMRRF so I'm not really able to fix it until I get back home at the end of the week unfortunately... But don't panic, I've identified the problem and will fix it as soon as possible 🙂

@Venomx99
Copy link

From the Klipper Configuration Changes page.

20241203: The resonance test has been changed to include slow sweeping moves. This change requires that testing point(s) have some clearance in X/Y plane (+/- 30 mm from the test point should suffice when using the default settings). The new test should generally produce more accurate and reliable test results. However, if required, the previous test behavior can be restored by adding options sweeping_period: 0 and accel_per_hz: 75 to the [resonance_tester] config section.

@Bomberski
Copy link

From the Klipper Configuration Changes page.

20241203: The resonance test has been changed to include slow sweeping moves. This change requires that testing point(s) have some clearance in X/Y plane (+/- 30 mm from the test point should suffice when using the default settings). The new test should generally produce more accurate and reliable test results. However, if required, the previous test behavior can be restored by adding options sweeping_period: 0 and accel_per_hz: 75 to the [resonance_tester] config section.

Did not work for me. Just wait for the fix

@Tester196
Copy link

i have the same issue.

klipper
v0.12.0-401-g383b83d7

Klippain-ShakeTune
v4.1.0-1-g66f5e32e

[resonance_tester]
probe_points: 175, 175, 20
accel_chip: adxl345
sweeping_period: 0
accel_per_hz: 75

Screenshot 2024-12-15 213017

Internal error on command:"AXES_SHAPER_CALIBRATION"
Internal Error on WebRequest: gcode/script
Traceback (most recent call last):
File "/home/pi/klipper/klippy/webhooks.py", line 256, in _process_request
func(web_request)
File "/home/pi/klipper/klippy/webhooks.py", line 436, in _handle_script
self.gcode.run_script(web_request.get_str('script'))
File "/home/pi/klipper/klippy/gcode.py", line 230, in run_script
self._process_commands(script.split('\n'), need_ack=False)
File "/home/pi/klipper/klippy/gcode.py", line 212, in _process_commands
handler(gcmd)
File "/home/pi/klipper/klippy/gcode.py", line 140, in
func = lambda params: origfunc(self._get_extended_params(params))
File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 189, in cmd
self.template.run_gcode_from_command(kwparams)
File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 68, in run_gcode_from_command
self.gcode.run_script_from_command(self.render(context))
File "/home/pi/klipper/klippy/gcode.py", line 227, in run_script_from_command
self._process_commands(script.split('\n'), need_ack=False)
File "/home/pi/klipper/klippy/gcode.py", line 212, in _process_commands
handler(gcmd)
File "/home/pi/klipper/klippy/gcode.py", line 140, in
func = lambda params: origfunc(self._get_extended_params(params))
File "/home/pi/klipper/klippy/extras/shaketune/shaketune.py", line 173, in cmd_AXES_SHAPER_CALIBRATION
axes_shaper_calibration(gcmd, self._pconfig, st_process)
File "/home/pi/klipper/klippy/extras/shaketune/commands/axes_shaper_calibration.py", line 26, in axes_shaper_calibration
min_freq = gcmd.get_float('FREQ_START', default=res_tester.test.min_freq, minval=1)
AttributeError: 'ResonanceTester' object has no attribute 'test'

@Frix-x
Copy link
Owner

Frix-x commented Dec 16, 2024

I've started working on a fix. A first step is already available on https://github.com/Frix-x/klippain-shaketune/tree/fix-sweeping-compat

This first step is only to fix the error and allow the test to run correctly on new Klipper versions. However, it currently doesn't support the new sweeping test for now (I'm working on adding compatibility at the moment).

@Frix-x Frix-x pinned this issue Dec 19, 2024
@Frix-x Frix-x changed the title 'ResonanceTester' object has no attribute 'test' 'ResonanceTester' object has no attribute 'test' (latest Klipper break Shake&Tune) Dec 20, 2024
@miklas206
Copy link

How do i install this fixed version?

@eprouty
Copy link

eprouty commented Dec 20, 2024

cd ~/klippain_shaketune 
git fetch origin fix-sweeping-compat
git checkout fix-sweeping-compat
./install.sh

You may need to fix some config, looks like keep_raw_csv is now keep_raw_data in the [shaketune] section... but I think this will get you running on the fixed version @miklas206

@miklas206
Copy link

cd ~/klippain_shaketune 
git fetch origin fix-sweeping-compat
git checkout fix-sweeping-compat
./install.sh

You may need to fix some config, looks like keep_raw_csv is now keep_raw_data in the [shaketune] section... but I think this will get you running on the fixed version @miklas206

i did what you said but i still get the error tho. I have checked the cfg seems like it should be right so how do i know if it did update / replace the old one with the fixed version?

@jimmycr
Copy link

jimmycr commented Dec 21, 2024

I've started working on a fix. A first step is already available on https://github.com/Frix-x/klippain-shaketune/tree/fix-sweeping-compat

This first step is only to fix the error and allow the test to run correctly on new Klipper versions. However, it currently doesn't support the new sweeping test for now (I'm working on adding compatibility at the moment).

confirm, that OpenNept4une (Elegoo N4+) with this quick fix works ;) Thanks!

@dmit2k
Copy link

dmit2k commented Dec 21, 2024

This first step is only to fix the error and allow the test to run correctly on new Klipper versions. However, it currently doesn't support the new sweeping test for now (I'm working on adding compatibility at the moment).

fix works for my customised TwoTrees SK1 just fine, thank you!

@Alia5
Copy link

Alia5 commented Dec 21, 2024

cd ~/klippain_shaketune 
git fetch origin fix-sweeping-compat
git checkout fix-sweeping-compat
./install.sh

You may need to fix some config, looks like keep_raw_csv is now keep_raw_data in the [shaketune] section... but I think this will get you running on the fixed version @miklas206

i did what you said but i still get the error tho. I have checked the cfg seems like it should be right so how do i know if it did update / replace the old one with the fixed version?

Maybe you have cloned shaketune to "~/klippain-shaketune" (dash) instead of "klippain_shakletune" (underscore)

The Install-script doesn't exactly use the repo name and this might lead to issues........................................................

@miklas206
Copy link

cd ~/klippain_shaketune 
git fetch origin fix-sweeping-compat
git checkout fix-sweeping-compat
./install.sh

You may need to fix some config, looks like keep_raw_csv is now keep_raw_data in the [shaketune] section... but I think this will get you running on the fixed version @miklas206

i did what you said but i still get the error tho. I have checked the cfg seems like it should be right so how do i know if it did update / replace the old one with the fixed version?

Maybe you have cloned shaketune to "~/klippain-shaketune" (dash) instead of "klippain_shakletune" (underscore)

The Install-script doesn't exactly use the repo name and this might lead to issues........................................................

Im very sure about that it did it correctly i have tried to crosscheck the files and everything should be the fixed version but im still getting erros

@Frix-x Frix-x added the done Issue is done but not merged on main label Dec 22, 2024
@Frix-x
Copy link
Owner

Frix-x commented Dec 22, 2024

I'm adding the "done" label since everything is now functional with my latest commits on this branch. With the new code:

  • Older Klipper version works as usual and only the "pulse" test is available
  • Newer Klipper version allow the user to choose between sweeping or pulse-only test by changing the parameters in the [resonance_tester] config section (basically setting sweeping_period: 0 to do the pulse-only test)
  • The corresponding documentation was added to help you decide which test to use

This will be merged now into the develop branch to be released tonight :)

@Frix-x Frix-x mentioned this issue Dec 22, 2024
@roykrikke
Copy link

roykrikke commented Dec 23, 2024

Thank @Frix-x great work to get this fixed.

How do I get the develop branch on my system?
I running v4.1.0-1-g66f5e32e now with Klipper v0.12.0-404-g80d185c94-dirty.

PS I normally use inside moonraker:

[update_manager Klippain]
type: git_repo
path: ~/klippain_config
origin: https://github.com/Frix-x/klippain.git
primary_branch: main
managed_services: moonraker klipper
install_script: install.sh

@Printfail
Copy link

How do you get the new 5.0 version ?

@drumstick77
Copy link

drumstick77 commented Dec 24, 2024

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

@roykrikke
Copy link

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

That's why @Frix-x wrote it's still in develop branch.

@drumstick77
Copy link

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

That's why @Frix-x wrote it's still in develop branch.

yeah, I thought so too, but the label done confuses me slightly.
Have you found the way to change moonraker to develop branch? thanks

@roykrikke
Copy link

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

That's why @Frix-x wrote it's still in develop branch.

yeah, I thought so too, but the label done confuses me slightly. Have you found the way to change moonraker to develop branch? thanks

I think you can just change the branch to develop and no change in moonraker.

https://www.freecodecamp.org/news/git-switch-branch/

PS I have not tried it yet :-)

@miklas206
Copy link

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

That's why @Frix-x wrote it's still in develop branch.

yeah, I thought so too, but the label done confuses me slightly. Have you found the way to change moonraker to develop branch? thanks

i made it work asking chatgpt about how i could change it to another branch and changed the moonraker config to the develop branch

@roykrikke
Copy link

Hi, has the latest v5.0 on develop branch been merged with main yet? Ii doesn't look like it has, but I thought I checked. thanks

That's why @Frix-x wrote it's still in develop branch.

yeah, I thought so too, but the label done confuses me slightly. Have you found the way to change moonraker to develop branch? thanks

i made it work asking chatgpt about how i could change it to another branch and changed the moonraker config to the develop branch

Please share the details. So all can learn :-)

@HeavilyModdedEnder3
Copy link

HeavilyModdedEnder3 commented Dec 24, 2024

How do you get the new 5.0 version?

This worked for me to go onto the pull request for v5.0.0
cd ~/klippain_shaketune
git fetch origin pull/181/head:pr-181
git checkout pr-181
./install.sh

@lucidhack
Copy link

lucidhack commented Dec 25, 2024

How do you get the new 5.0 version?

This worked for me to go onto the pull request for v5.0.0 cd ~/klippain_shaketune git fetch origin pull/181/head:pr-181 git checkout pr-181 ./install.sh

Thanks! This also worked for me, but I also needed to change:

This:

[shaketune]
keep_raw_csv = False

To This:

[shaketune]
keep_raw_data = False 

@drumstick77
Copy link

Cheers all. I did run the install.sh previously, what I was missing was what @lucidhack mentioned about the change on [shaketune] under printer.cfg. it's now working.

one last question however, once it's been merged to main, I presume it will just appear in moonraker as per normal and running update from it should update the current state of shaketune?

@clstr
Copy link

clstr commented Dec 26, 2024

Cheers all. I did run the install.sh previously, what I was missing was what @lucidhack mentioned about the change on [shaketune] under printer.cfg. it's now working.

one last question however, once it's been merged to main, I presume it will just appear in moonraker as per normal and running update from it should update the current state of shaketune?

You would do the same steps but the branch would be main.

@DVSVIDEO
Copy link

Can someone explain to me why there are branches and if there is a working V5 why the old version is the last one up?
Why does it not update when I press search for updates? Shaketune is in the list.

@drumstick77
Copy link

Cheers all. I did run the install.sh previously, what I was missing was what @lucidhack mentioned about the change on [shaketune] under printer.cfg. it's now working.

one last question however, once it's been merged to main, I presume it will just appear in moonraker as per normal and running update from it should update the current state of shaketune?

You would do the same steps but the branch would be main.

Yeah, I get that. But we ran install.sh which I believe installed dev version without changing Moonraker cfg file.

@patofoto
Copy link

Don't know what I am doing. Tried

cd ~/klippain_shaketune
git fetch origin pull/181/head:pr-181
git checkout pr-181
./install.sh

and failed.

Will wait until the develop branch gets pulled into main. Any idea when this might happen?.

@Raouad
Copy link

Raouad commented Dec 27, 2024

Don't know what I am doing. Tried

cd ~/klippain_shaketune
git fetch origin pull/181/head:pr-181
git checkout pr-181
./install.sh

and failed.

Will wait until the develop branch gets pulled into main. Any idea when this might happen?.

git clone https://github.com/Frix-x/klippain-shaketune.git
cd klippain-shaketune
git checkout develop
bash install.sh

Try this

@patofoto
Copy link

@Raouad Thank you. I think I will wait. I don't want to be using patched solutions just to try now. I am in no real need to use this now. I was just curious. Can wait.

@Frix-x Frix-x linked a pull request Dec 29, 2024 that will close this issue
@Frix-x Frix-x unpinned this issue Dec 30, 2024
@kot0005
Copy link

kot0005 commented Jan 17, 2025

why is this closed ? I just had this issue occur. What is the solution ? Thank you

@roykrikke
Copy link

why is this closed ? I just had this issue occur. What is the solution ? Thank you

Update to last version 5.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done Issue is done but not merged on main
Projects
None yet
Development

Successfully merging a pull request may close this issue.