I do not know if it will work in the end but installing numpy could easily take 30 min to 1h on such a device.
Use the Linux screen command to create a virtual terminal and run your numpy installation there. This will allow the install to continue and you to reattach to the process even if your SSH connection closes.
Hi @Sineos thank you. I tried it with no luck. I did a split window having the script running in one a top running on the other. For some unknown reason while 4 minutes in the compile process, the pi just crashes or reboots. I tried several time with no-cache or similars.
I finally gave up and went on installing it on a pi4 8G I had which compiled with no probs at all at about 5 minutes
I was able to run my calibration with that pi, get my results, which I then passed on to my pi zero 2W.
Hi all, I’m sorry but I’d like to come back to this topic as I’m trying to give it another shot… Actually other people will face this issue as pi zero 2 w gets more popular.
I’m a total noob when comes to python
so there’s the issue again, ~/klippy-env/bin/pip install -v numpy will crash the pizero 2 w a couple of minutes after running. From SSH you find that you get disconnected after a while too. One easy way to tell that is crashing is to be watching the System Utilization/ System Information screen on Fluidd. You will see that you loose the GUI after a couple of minutes that you run the numpy install.
I run pip3 install numpy which successfully installed it. Looks like python3 is working nicely but is klipper using it ? I don’t know if I should change the environment somehow … I’m giving a couple of hints that may help
pi@prusai3:~/klippy-env/bin $ ./pip -V
pip 20.3.4 from /home/pi/klippy-env/local/lib/python2.7/site-packages/pip (python 2.7)
pi@prusai3:~/klippy-env/bin $ pip3 -V
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
pi@prusai3:~/klippy-env/bin $ ./pip show numpy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Package(s) not found: numpy
pi@prusai3:~/klippy-env/bin $ pip3 show numpy
Name: numpy
Version: 1.16.2
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:
So the real issue is actually when I try to run the calibration scripts from klipper
as you can see ADXL works and reads fine but can’t run the calibration scripts which are based in python I suppose
Exact same issue here, though it seems to crash in a slightly different place.
Tried running it directly from the Klipper environment, and having it run for more than 1 hour, to no avail - and with the exact same symptoms as you described.
On some occasions, if the board has too little RAM, the installation may fail and you will need to enable swap.
The Zero 2 W doesn’t have enough RAM, so you need to increase the swap size. I believe the default is 100MB. I would increase this to at least 250MB. I haven’t tested these instructions, but this link explains the process.
Also note it will take a long time to compile on Zero because it will be reading from and writing to the swap file quite a bit. A Pi 4 has enough RAM to avoid this, so it’s MUCH faster.
I fixed my issue another way so I’m writing an update should it helps anyone else.
I haven’t managed to build numpy on pi zero 2w and I tried everything as mentioned. The OS crashes and reboots, it isn’t a matter of waiting. I even changed swap to 4096 and watched build process from another terminal, 3 minutes in the OS crashes, the swap is only used up to a few megs, all I can see is that at some point 4 compile processes start and system crashes.
As I mentioned previously library builds just fine on other pi so all I did is copied the library from my pi4 working pi to my pi zero 2w and voila now pi zero 2w can run the resonance scripts.
Recap - if you have a pi zero 2w and follow the klipper ADXL installation you may get stuck at this point where the following command will reboot your pi ~/klippy-env/bin/pip install -v numpy
In this case, just carry on with the install instructions up until you start measuring Resonances.
If you have another pi3/4 with klipper run the above command and copy the home/pi/klippy-env/lib/python2.7/site-packages/numpy directory to your pi zero 2w
If you dont have another pi to build the library, give me a shout, I can provide a tar with the library files and instructions where to put them and should work.
If by the way anyone manages to build the numpy on a pi zero 2w I would like to know how you managed. If i’m not mistaken the pre-compiled ‘wheel’ libraries for pi s exist for Python 3.7+
I’ve been having exactly the problem described above. After 4 failed attempts to install/compile I finally got it to complete this morning. I don’t know for sure if this is what fixed it, but what I did was change the /usr/bin/python soft link to point to python3 instead of python2 and then rebooted the pi.
After it came up I started 2 ssh sessions; one to run the install and one to tail /var/log/messages. The compile completed in under 10 min (I didn’t time it so don’t know exactly).
I didn’t need to change swap or make any other system changes. I’m running the current fluidd rpi image.
I hope this helps some folks. Good luck!!
I cannot comment on building numpy on a RPi Zero 2W but there is a workaround, which does not need this:
In the printer’s console (e.g. Fluidd, Octoprint etc.) execute: TEST_RESONANCES AXIS=X OUTPUT=raw_data
Likewise for Y.
Log in via SSH to the RPi and execute: ~/klipper/scripts/calibrate_shaper.py /tmp/raw_data_x_ZZZ.csv -o /tmp/raw_data_x.png
where ZZZ is the current timestamp.
Likewise for Y.
Only drawback is you need to add the resonance values manually. Bonus is that you get a nice graph.