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

ZeroDivisionError: float division by zero #155

Open
BlackStump opened this issue Sep 12, 2024 · 0 comments
Open

ZeroDivisionError: float division by zero #155

BlackStump opened this issue Sep 12, 2024 · 0 comments

Comments

@BlackStump
Copy link

Been struggling to get this to work after klipper update everything was working great prior to the update.
I am not a programmer or developer just a 65 year old user and this is way beyond my skill set.

Internal error on command:"CALIBRATE_Z"
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 229, in run_script
    self._process_commands(script.split('\n'), need_ack=False)
  File "/home/pi/klipper/klippy/gcode.py", line 211, in _process_commands
    handler(gcmd)
  File "/home/pi/klipper/klippy/gcode.py", line 137, in <lambda>
    func = lambda params: origfunc(self._get_extended_params(params))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/z_calibration.py", line 152, in cmd_CALIBRATE_Z
    state.calibrate_z(switch_offset, nozzle_site, switch_site, bed_site)
  File "/home/pi/klipper/klippy/extras/z_calibration.py", line 474, in calibrate_z
    nozzle_zero = self._probe_on_site(self.z_endstop,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/z_calibration.py", line 450, in _probe_on_site
    return self.helper._calc_mean(positions)[2]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/z_calibration.py", line 357, in _calc_mean
    return [sum([pos[i] for pos in positions]) / count
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/klipper/klippy/extras/z_calibration.py", line 357, in <listcomp>
    return [sum([pos[i] for pos in positions]) / count
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
ZeroDivisionError: float division by zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant