The-EG / OctoPrint-UBLMeshEdit

An OctoPrint plugin that can be used to view, edit and manage Marlin Unified Bed Leveling (UBL) meshes.
GNU Affero General Public License v3.0
17 stars 5 forks source link

[FR] Try not to crash the printer by writing bad values #18

Open ali1234 opened 2 months ago

ali1234 commented 2 months ago

Describe the new feature or functionality, and how it should work When editing the mesh, if you put an invalid Z value (ie one which is not a multiple of 0.025) or simply leave the Z field blank, the printer returns a M421 incorrect parameter error, and then Octoprint shuts it down with M112, requiring a power cycle. This is annoying.

Instead, the plugin should refuse to send these incorrect values, especially if the Z value field is completely blank.

Firmware Marlin 2.1.2.3 - self-compiled.

ali1234 commented 2 months ago

Please don't do this:

image

image

ali1234 commented 2 months ago

It seems the only situation this happens is when I, J or Z are undefined, or in the case of Z an empty string (when the input contains something that can't be parsed as a float). The firmware seems okay with anything that looks like a decimal, regardless of length.

The-EG commented 2 months ago

Just tested myself and an arbitrary value, such as -0.173, works just fine with bufix-2.1.x. The web value will highlight it as invalid, but you can still submit it.

As for OctoPrint sending M112, this is configurable and an overly safe default. I would suggest turning it off if it is annoying as any error will trigger that behavior.

ali1234 commented 2 months ago

There are a couple ways to reproduce it with undefined values:

I'm working on a patch to fix this.