#abs(): 'Undefined' Error

23 messages ยท Page 1 of 1 (latest)

tight lily
#

Hello! New to RatOS, somewhat familiar with Klipper. Just set up the printer (INDEX) and am getting this message when I try to print:

Error evaluating 'gcode_macro START_PRINT:gcode': TypeError: bad operand type for abs(): 'Undefined'

As far as I can tell is comes to this line here under the RatOS/macros.cfg - [gcode_macro START_PRINT]
{% if svv.idex_xoffset|abs >= (x_parking_space - 0.5) or svv.idex_xoffset|abs >= (dc_parking_space - 0.5) %}

Unfortunately, everything in the RatOS folder appears to be read-only, so I have no idea how to resolve this issue. Any help would be appreciated. I thought about defining an ABS function in printer.cfg, but wasn't sure I could quite pull that off. Besides, it seems no-one else has this problem, so there is probably another solution.

steel belfryBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> โœ… Mark Solution

haughty python
#

Haven't seen that one before. Is ratos updated?

tight lily
#

yes

#

Its as if I am just missing part of the config file Does everyone else have the same line under their START_PRINT macro?

haughty python
#

yep, that file comes from ratos and is not intended to be edited.

#

What slicer are you using, and what does your Start Print gcode look like in it?

tight lily
#

Using PrusaSlicer 2.9.2

Start CodeL

#

START_PRINT EXTRUDER_TEMP={first_layer_temperature[0]},{first_layer_temperature[1]} EXTRUDER_OTHER_LAYER_TEMP={temperature[0]},{temperature[1]} BED_TEMP=[first_layer_bed_temperature] START_CHAMBER_TEMP=[chamber_temperature] CHAMBER_TEMP=[chamber_temperature] INITIAL_TOOL={initial_tool} TOTAL_LAYER_COUNT={total_layer_count} X0={first_layer_print_min[0]} Y0={first_layer_print_min[1]} X1={first_layer_print_max[0]} Y1={first_layer_print_max[1]}

#

It is just the base code from the ratOS website

haughty python
#

yep, just double checking ๐Ÿ™‚

#

the way that abs is used, it reads like python is trying to interpret it, and not the django. @frank umbra you seen this before?

tight lily
#

Log files are also referancing Python:
Starting SD card print (position 0)
Error evaluating 'gcode_macro START_PRINT:gcode': TypeError: bad operand type for abs(): 'Undefined'
Traceback (most recent call last):
File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 61, in render
return str(self.template.render(context))
File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 140, in top-level template code
TypeError: bad operand type for abs(): 'Undefined'
Error evaluating 'gcode_macro START_PRINT:gcode': TypeError: bad operand type for abs(): 'Undefined'

haughty python
#

You can see why I wanted to verify your ratos was up to date and macro set up correctly ๐Ÿ™‚

tight lily
#

Yeah of course. And plainly something is not set up correctly.

haughty python
#

Searching this discord for bad operand type for abs() and your messages are the only ones with it

tight lily
#

Yeah I could find anything either

haughty python
#

even just searching for bad operand type yields nothing else

tight lily
#

Fixed it? I re-entered the configurator wizard and skipped all the board flashing stages.

#

Then had it recompile the config files and now it works.

haughty python
#

weird, but happy for the success!

steel belfryBOT