What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

Missing Macros

Pierre52

Member
Hi. New to this forum so apologies if I don't get this right.
I have just completed an LDO 2.4 build and I am in the process of initial configuration and tuning. I have been using Scott Corn's excellent youtube step by steps and for the most part everything has gone to plan. Should point out that I have previously built 2 other printers both using Duet and RepRap so not at all familiar with Klipper/Mainsail.

I reached the point where I had completed Homing, QGL, Pid Tunes and Extruder Tunes and was hoping to do a first print. However, the Z probe (Omron) appeared to be misbehaving so I chose to remove it and fit a Klicky probe instead.

That changeover has been completed, the hardware is all installed, the klicky files have all been uploaded, the dock position has been established and I am set to check the Attach Probe command. And that is where my problem is.......
Unlike Scott's video the new Klicky Macros aren't showing up in the dashboard and entering the command "Attach_Probe achieves nothing.

I had a similar issue with getting Mainsail to start working and if you have a look at these lines in my Printer.cfg you may see what I had to do as a work around:

[mcu]
## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
##--------------------------------------------------------------------
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_1B0017000650314D35323820-if00
restart_method: command
##--------------------------------------------------------------------
#[include mainsail.cfg}]
[include klicky-probe.cfg]

You may note that [Includemainsail.cfg] has been commented out. Instead I copied the contents of Mainsail.cfg to the bottom of the printer file. (Just realised I have an extra } in that line that shouldn't be there.

So for the moment I have come to a shuddering halt with no obvious way forward. This despite several hours on Google and You Tube. Any help would be appreciated
 
Do you get any errors? If you look at the klippy.log file, at the very top it will tell you the complete resulting configuration with all of the includes done. See if the klicky contents are shown.
 
I have not had coffee yet this morning but try and change the [include klicky-probe.cfg] to use an underscore in the name instead of a dash. That might make the differance.
Make sure and rename the actual file as well to reflect the change.

Like this [include klicky_probe.cfg]
 
Hi No Guru (Name?)
Tried those suggestions thanks.

Unfortunately no change. Still no Klicky macros showing up.

Peter
 
I have now re-run the entire Klicky install process but still no macros. So I have now manually loaded the Klicky - completed a QGL and run a "Probe Accuracy" with a reported standard deviation of
0.000673.
 
I didn't see anything in the log but maybe decibell will.

I would like to see the printer.cfg and klippy.cfg files.
 
@No Guru
I have attached the printer.cfg file. There is no klippy.cfg file! Is it the Klippy_probe.cfg file that you are after? If so I have attached that as well.

Kind regards
Peter
 

Attachments

  • klicky_probe 9Feb.txt
    707 bytes · Views: 13
  • printer-20230206_151054 9 Feb.txt
    16.1 KB · Views: 16
Partial Solution. I have discovered a noob error, in finally realising that Klipper creates date stamped backups of Printer.cfg. As only the backups were visible I was making changes to the back ups rather than printer.cfg itself.

Having fixed that I now get this error when in [include klicky_probe.cfg:

Klipper reports: ERROR

Include file '/home/pi/printer_data/config/klippy_probe.cfg' does not exist

I can find no reference to that anywhere in any of the Klippy files. However , the moment I edit to #[include klicky_probe.cfg] the machine starts normally albeit still with no Klicky Macros.

Also currently having issues with: 1 getting the 12864 display to work, and 2. Getting the Stealthburner Neopixels to work.

I have attached a copy of printer.cfg in its current state.
 

Attachments

  • Printer.txt
    16.2 KB · Views: 9
Well, you have to uncomment this by removing the Hash so Klipper see's the files.


1675944921011.png
 
Well, you have to uncomment this by removing the Hash so Klipper see's the files.


View attachment 1550
Absolutely agree, but when I do that I get this error message:
Klipper reports: ERROR
Include file '/home/pi/printer_data/config/klippy_probe.cfg' does not exist
I can find no reference to that anywhere in any of the Klippy files. However , the moment I edit to #[include klicky_probe.cfg] the machine starts normally albeit still with no Klicky Macros.
 
And you remove the Feb9 from the file name of the klippy_probe.cfg ?
 
After some extensive and careful re-tracing of the installation process, I have resolved the missing Macro problem but now have encountered some new ones. The missing macro was my own stupidity in typing klippy_probe.cfg rather than klicky_probe in the Include line in Printer.cfg.

Now at least all of the Klicky Macros show up in Mainsail. However a restart now brings up this error message:
Klipper reports: ERROR

Existing command 'BED_MESH_CALIBRATE' not found in gcode_macro rename

Once again, a less than helpful error message, and one that I am at a loss as to how to resolve.
 
The error tells you exactly what is missing. Did you include the klicky bed mesh macro and add it to be included in the config?
 
If I new how to tag a post as Solved I would do that as the Klicky probe issue is, for the most part, solved.

Yesterday a friend who is a professional programmer came over and together we worked through the various issues and eventually found a solution.

The main one was the error message " bed_mesh_calibrate not found in gcode_macro rename. Eventually,Google turned up this link:

https://gist.github.com/ChipCE/95fdbd3c2f3a064397f9610f915f7d02?permalink_comment_id=4043223

After posting the suggested code into the Klicky_Macros.cfg the error code went away, and we were almost good to go. Another error with "printer out of range" was sorted (mistake with relative vs absolute positioning in one of the klicky variables) the printer was up and running.

I may have missed it but the Chip CE post in Github (link above) was the only mention I found in all the various set up guides for the need to add this extra macro.

I will paste it below for reference.
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
; gcode parameters
variable_parameter_AREA_START : 0,0
variable_parameter_AREA_END : 0,0
; the clearance between print area and probe area
variable_mesh_area_offset : 5.0
; number of sample per probe point
variable_probe_samples : 2
; minimum probe count
variable_min_probe_count : 3
; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
variable_probe_count_scale_factor : 1.0
; enable preference index
variable_enable_reference_index : False
gcode:
{% if params.AREA_START and params.AREA_END %}
{% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
{% set safe_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %}
{% set safe_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %}
{% set safe_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %}
{% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}

{% set area_min_x = params.AREA_START.split(",")[0]|float %}
{% set area_min_y = params.AREA_START.split(",")[1]|float %}
{% set area_max_x = params.AREA_END.split(",")[0]|float %}
{% set area_max_y = params.AREA_END.split(",")[1]|float %}

{% if bedMeshConfig.probe_count.split(",")|length == 2 %}
{% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
{% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %}
{% else %}
{% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
{% set meshPointY = bedMeshConfig.probe_count.split(",")[0]|int %}
{% endif %}

{% set meshMaxPointX = meshPointX %}
{% set meshMaxPointY = meshPointY %}


{% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
{% if area_min_x - mesh_area_offset >= safe_min_x %}
{% set area_min_x = area_min_x - mesh_area_offset %}
{% else %}
{% set area_min_x = safe_min_x %}
{% endif %}

{% if area_min_y - mesh_area_offset >= safe_min_y %}
{% set area_min_y = area_min_y - mesh_area_offset %}
{% else %}
{% set area_min_y = safe_min_y %}
{% endif %}

{% if area_max_x + mesh_area_offset <= safe_max_x %}
{% set area_max_x = area_max_x + mesh_area_offset %}
{% else %}
{% set area_max_x = safe_max_x %}
{% endif %}

{% if area_max_y + mesh_area_offset <= safe_max_y %}
{% set area_max_y = area_max_y + mesh_area_offset %}
{% else %}
{% set area_max_y = safe_max_y %}
{% endif %}

{% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x) * probe_count_scale_factor)|round(0)|int %}
{% if meshPointX < min_probe_count %}
{% set meshPointX = min_probe_count %}
{% endif %}
{% if meshPointX > meshMaxPointX %}
{% set meshPointX = meshMaxPointX %}
{% endif %}

{% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y) * probe_count_scale_factor )|round(0)|int %}
{% if meshPointY < min_probe_count %}
{% set meshPointY = min_probe_count %}
{% endif %}
{% if meshPointY > meshMaxPointY %}
{% set meshPointY = meshMaxPointY %}
{% endif %}

{% set algorithm = "lagrange" %}
{% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %}
{% set algorithm = bedMeshConfig.algorithm %}
{% endif %}

{% if enable_reference_index %}
{% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={referenceIndex}
{% else %}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
{% endif %}
{% else %}
BED_MESH_CALIBRATE_BASE
{% endif %}
{% else %}
BED_MESH_CALIBRATE_BASE
{% endif %}
 
A bit late to the party …. but I suspect your original problem (after you fixed your [include filename] typo) with macros not being found is because you didn’t have a [bed_mesh] declaration in your printer.cig file. (Look up “BED_MESH” in the kipper docs for details.) Including [bed_mesh] makes a number of additional gcode commands available in klipper …. including those used in the klicky-probe macros that could not be found, resulting in the error. But I suspect you probably have realised that by now. Just adding this so others that hit this issue (like me 🤦‍♂️) have an answer.
 
Top