Parse error on extruder temp

Basic Information:

Printer Model: Ender V3 SE
MCU / Printerboard: CR4NS200320C13_32_MS35774_GD303RET6
klippy.log

klippy (2).log (5.1 MB)

Describe your issue:

Hey all, running into this parse issue.

Error on 'M109 S[material_print_temperature_layer_0]': unable to parse [

I’ve searched high and low and tried a few different things and still running into problems. New to this!

Logs attached. At first I was getting an M420 command not found issue, but I nixed that from cura start script and set it to get a new mesh every time. Fixed.

Now Im a bit stumped here. I do think its something I need to mod in my cura start script, but unsure. Config files seem to be ok based on other related threads I have read through. I have reviewed the code also (I have been following this tutorial: ender3-v3-se-full-klipper/README.md at main · bootuz-dinamon/ender3-v3-se-full-klipper · GitHub)

Im sure the fix is glaringly obvious. Would appreciate any help. Please let me know if any other info is needed.

TIA!

This variable should not be in the final gcode but substituted with the corrected value by your slicer.
Depending on your slicer this might be named differently.
Normally you pass this variable to the START_PRINT macro in your slicer start code and this generates the correct gcode.
But it looks like you bypassed this and have the codes in your slicers start code?

Can you please post your slicers start and end code here using preformatted text tags?

Hey! Here you go! Im using Cura btw

M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate

G28 ;Home
BED_MESH_CALIBRATE

G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Z Axis up
G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
M109 S[material_print_temperature_layer_0]
G1 X10.1 Y145.0 Z0.28 F1500.0 E15 ;Draw the first line
G1 X10.4 Y145.0 Z0.28 F5000.0 ;Move to side a little
G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
G92 E0  ;Reset Extruder
G1 E-1.0000 F1800 ;Retract a bit
G1 Z2.0 F3000 ;Move Z Axis up
G1 E0.0000 F1800

All variables can be found here:
http://files.fieldofview.com/cura/Replacement_Patterns.html
You however have to use curly brackets instead of square ones.

1 Like

Oh I bet thats it! I read somewhere that ender firmware requires square brackets and klipper requires curly braces. Ill give that a whirl and report back, thanks!

It has nothing to do with the firmware. It’s the slicer that uses these variables when generating the gcode before the printer firmware even sees it. The slicer replaces the variable with the actual value, but only if you format it correctly. Cura expects curly braces. This gcode file wouldn’t work on any firmware.

1 Like

Yes, correct. What I’m saying is that when you add the Ender V3 SE in Cura, it defaults to square brackets (because I think thats what ender firmware requires) but after reflashing klipper, I used the same printer profile but needed to swap the brackets for braces.

In any case, this is now resolved (by swapping the square brackets w/ curly braces.) Thank you all!

As it turns out, you found a bug in Cura. You said that Cura defaults to square brackets when you add an Ender 3 V3 SE and I thought that couldn’t possibly be correct because Cura doesn’t use square brackets for variables. But lo and behold, the stock Cura definition for this printer does erroneously use square brackets instead of curly: Cura/resources/definitions/creality_ender3v3se.def.json at 0fe682470a53ea22c6f617d17f13e23fe49d8f57 · Ultimaker/Cura · GitHub

Fortunately someone has already submitted a pull request to fix it: Fix Ender 3 V3 SE start g-code by zhogov · Pull Request #17781 · Ultimaker/Cura · GitHub

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.