Closed solo2424 closed 1 year ago
Same error for me.
That sounds like it's triggering the BED_MESH_CALIBRATE_FAST
macro when you don't have a BED_MESH
section specified in your config. There should be guards that prevent that, but maybe I accidentally moved something outside the guards.
Do you have a BED_MESH
section in your printer.cfg
file?
Edit: Also, if you don't mind, could you paste the following parts of your config in your reply:
[gcode_macro _km_options]
sectionklipper-macros
[bed_mesh]
sectionI moved all my macros into a separate config to keep my printer.cfg cleaner. Could that be the reason why? I am not home right now but I will check once I get home.
On Mon, Nov 21, 2022 at 11:25 AM Justin Schuh @.***> wrote:
That sounds like it's triggering the BED_MESH_CALIBRATE_FAST macro when you don't have a BED_MESH section specified in your config. There should be guards that prevent that, but maybe I accidentally moved something outside the guards.
Do you have a BED_MESH section in your printer.cfg file?
— Reply to this email directly, view it on GitHub https://github.com/jschuh/klipper-macros/issues/19#issuecomment-1322327721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOQWWRWODXWQPHLQPOJXULWJOPA3ANCNFSM6AAAAAASGBQKHM . You are receiving this because you authored the thread.Message ID: @.***>
I don't think so. Peeking at the relevant Klipper code, it looks like it reads in and parses the main config and its recursive set of included configs before any modules get a chance to interpret any of the statements. Given that, I wouldn't expect order or location to matter (so long as the required files, paths, and sections are all correct).
It does look like include paths are resolved relative to the file containing the include
statement. So, moving things to different directories could result in unexpected behavior if you're not accounting for that.
Tahat did it. I uncomment this line([include klipper-macros/optional/bed_mesh.cfg]) in your config and it is now working. Not sure why I don't have a bed_mesh config by default. I have played around so much with my configs that I could have pretty much accidentally removed it. I am still new to this world so I just do a lot of trialing and error. Thanks for pushing me in the right direction!
On Mon, Nov 21, 2022 at 1:41 PM Justin Schuh @.***> wrote:
I don't think so. Peeking at the relevant Klipper code, it looks like it reads in and parses the main config and its recursive set of included configs before any modules get a chance to interpret any of the statements. Given that, I wouldn't expect order or location to matter (so long as the required files, paths, and sections are all correct).
It does look like include paths are resolved relative to the file containing the include statement https://github.com/Klipper3d/klipper/blob/c51f169c06921152a2e9c386016660d0bb09f767/klippy/configfile.py#L217. So, moving things to different directories could result in unexpected behavior if you're not accounting for that.
— Reply to this email directly, view it on GitHub https://github.com/jschuh/klipper-macros/issues/19#issuecomment-1322493934, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOQWWVCRIEYTGXIEWGZZCDWJO64NANCNFSM6AAAAAASGBQKHM . You are receiving this because you authored the thread.Message ID: @.***>
Yeah, that's an optional include that's commented out by default because it will throw a macro error if you don't have a bed_mesh
configured (and a corresponding probe
, bltouch
, or whatever to generate the mesh).
Glad it's working for you now.
I'm just trying these macros for the first time and I'm running into this. I can confirm my printer.cfg has a [bed_mesh]
section defined.
It looks like the optional bed_mesh config isn't really optional - the non-optional script somehow assumes it's been included.
@chrisleck The issue in this report was due to a specific end-user configuration error (i.e. including an optional macro file that requires a bed_mesh
section without declaring said section). I'm unclear on what problem you're encountering, but your comments certainly aren't describing the same issue. However, if you think you're hitting some sort of bug, please file a new issue describing the exact scenario (including the full error text) and attach your printer.cfg
.
One thing I should note is that there's nothing in these macros that alters Klipper's include behavior (it's simply not possible for Klipper macros to do that). It's most likely a configuration error in one of the the following sections: variable declarations in [gcode_macro _km_options]
, include
lines for klipper-macros, and the [bed_mesh] section.
When trying to print I get the following error. Any idea why?
gcode_macro bed_mesh_calibrate_fast:gcode': jinja2.exceptions.UndefinedError: 'extras.gcode_macro.GetStatusWrapper object' has no attribute 'gcode_macro bed_mesh_calibrate'