Problem creating resonance chart

I’ve done everything according to instructions, and frustratingly, I think I have run into this before, but I can’t remember how I fixed it! Frustrating.

Everything is going fine, even through the resonance testing using the adxl345. However, when I get to these commands -
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_
.csv -o /tmp/shaper_calibrate_y.png

I get ;
Traceback (most recent call last):
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 11, in
import numpy as np, matplotlib

Now, I found a way on reddit that got me FURTHER… by direcly running the python in klippers directory…
./klippy-env/bin/python ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png

Now, it got stumped on;
Traceback (most recent call last):
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 11, in
import numpy as np, matplotlib
ImportError: No module named matplotlib

So, every other time I have had trouble, I have found a spot in the directions where I went wrong. This time, I just can’t find it! I am running this version;

Git version: ‘v0.10.0-112-g9ecddd1b’
CPU: 4 core ARMv7 Processor rev 4 (v7l)
Python: ‘2.7.16 (default, Oct 10 2019, 22:02:15) \n[GCC 8.3.0]’
Start printer at Wed Jun 15 18:12:45 2022 (1655313165.0 14.6)

Here is the weird thing… some time ago, I remember an urgent call to get into Python 3, and the best way was to get a new fresh installation of the new Octoprint. So I redid the entire installation. Why do I see Python 2.7 in here still? Did I miss something? There are no alerts coming up for Python anymore…

Thanks in advance, and sorry if I missed a detail.

sudo apt update
sudo apt install python3-numpy python3-matplotlib
python3 ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png*

Alternatively you can upgrade to the latest klipper then you likely do not need python3 at the beginning

I REALLY appreciate your help!!
I was using klipper from 6/21.
I tried your command, here’s what I got…

Traceback (most recent call last):
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 174, in
main()
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 153, in main
datas = [parse_log(fn) for fn in args]
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 153, in
datas = [parse_log(fn) for fn in args]
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 19, in parse_log
with open(logname) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/resonances_x_*.csv’

Now was I supposed to edit something in the command specific to my system? I could have easily missed something like that. Major brain fog right now. (On tranquilizers.)
Even still… I took on upgrading klipper. And HEY! I got it all done!
Tried your command again, same result. Tried taking the 3 off python3, got ‘no module named numpy’.
realizing I hadn’t rebooted since update to klipper, trying command in directions again…

~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_.csv -o /tmp/shaper_calibrate_y.png
Traceback (most recent call last):
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 174, in
main()
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 153, in main
datas = [parse_log(fn) for fn in args]
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 153, in
datas = [parse_log(fn) for fn in args]
File “/home/pi/klipper/scripts/calibrate_shaper.py”, line 19, in parse_log
with open(logname) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/resonances_y_
.csv’

Interestingly, your command suggestion gave the exact same error! Must be a linux peculiarity. My newbieness is showing!

This is the same error I got when I first posted. I may still need a bit of help on this, but for now, I need to crash, I will look more in the AM. Thanks again!!!

The error message says No such file or directory

Post the output of ls -al /tmp
Also note that the tmp folder is typcially cleared on reboot, so your measurement files may be gone if you rebooted the RPi.

If you updated to most recent Klipper then the two commands should be:

~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png

Also see the official documentation here:
https://www.klipper3d.org/Measuring_Resonances.html

Hello,
i have the same problem

Perhaps it has to do thaht there is no folder tmp?
16

For the age of this thread:

grafik

I recommend to open a new one with all requested information.