julianschill / klipper-led_effect

LED effects plugin for klipper
GNU General Public License v3.0
645 stars 117 forks source link

RuntimeError: maximum recursion depth exceeded #181

Closed testack18 closed 4 months ago

testack18 commented 4 months ago

Hi,

Not sure if this is caused by this plugin. Could you please take a look on the below exception which refers led_effect.py?


Stats 1345.9: gcodein=0  mcu: mcu_awake=0.088 mcu_task_avg=0.000006 mcu_task_stddev=0.000006 bytes_write=3868685 bytes_read=1153837 bytes_retransmit=905 bytes_invalid=0 send_seq=99580 receive_seq=99577 retransmit_seq=99580 srtt=0.001 rttvar=0.000 rto=0.800 ready_bytes=6 upcoming_bytes=6619 freq=179998536 EBBCan: mcu_awake=0.060 mcu_task_avg=0.000024 mcu_task_stddev=0.000041 bytes_write=1489479 bytes_read=979654 bytes_retransmit=360 bytes_invalid=0 send_seq=71634 receive_seq=71629 retransmit_seq=71634 srtt=0.001 rttvar=0.000 rto=0.800 ready_bytes=813 upcoming_bytes=325 freq=63998550 adj=63999132 EBB_NTC: temp=50.0 EBB_mcu_temp: temp=40.4 sd_pos=1073113 heater_bed: target=70 temp=70.0 pwm=0.109 z_thermal_adjust: temp=28.5 gantry_temp: temp=30.7 pi_temp: temp=42.8 mcu_temp: temp=35.4 sysload=0.82 cputime=214.336 memavail=3489888 print_time=1313.904 buffer_time=2.139 print_stall=0 extruder: target=245 temp=245.0 pwm=0.289
Stats 1346.9: gcodein=0  mcu: mcu_awake=0.088 mcu_task_avg=0.000006 mcu_task_stddev=0.000006 bytes_write=3868685 bytes_read=1153837 bytes_retransmit=1086 bytes_invalid=0 send_seq=99580 receive_seq=99577 retransmit_seq=99580 srtt=0.001 rttvar=0.000 rto=1.600 ready_bytes=6 upcoming_bytes=13063 freq=179998536 EBBCan: mcu_awake=0.060 mcu_task_avg=0.000024 mcu_task_stddev=0.000041 bytes_write=1489479 bytes_read=979654 bytes_retransmit=510 bytes_invalid=0 send_seq=71634 receive_seq=71629 retransmit_seq=71634 srtt=0.001 rttvar=0.000 rto=1.600 ready_bytes=813 upcoming_bytes=2359 freq=63998550 adj=63999132 EBB_NTC: temp=50.0 EBB_mcu_temp: temp=40.4 sd_pos=1074894 heater_bed: target=70 temp=70.0 pwm=0.109 z_thermal_adjust: temp=28.5 gantry_temp: temp=30.7 pi_temp: temp=42.8 mcu_temp: temp=35.4 sysload=0.75 cputime=214.447 memavail=3489900 print_time=1315.332 buffer_time=2.567 print_stall=0 extruder: target=245 temp=245.0 pwm=0.289
Stats 1347.9: gcodein=0  mcu: mcu_awake=0.088 mcu_task_avg=0.000006 mcu_task_stddev=0.000006 bytes_write=3868685 bytes_read=1153837 bytes_retransmit=1086 bytes_invalid=0 send_seq=99580 receive_seq=99577 retransmit_seq=99580 srtt=0.001 rttvar=0.000 rto=1.600 ready_bytes=6 upcoming_bytes=15280 freq=179998536 EBBCan: mcu_awake=0.060 mcu_task_avg=0.000024 mcu_task_stddev=0.000041 bytes_write=1489479 bytes_read=979654 bytes_retransmit=510 bytes_invalid=0 send_seq=71634 receive_seq=71629 retransmit_seq=71634 srtt=0.001 rttvar=0.000 rto=1.600 ready_bytes=813 upcoming_bytes=2981 freq=63998550 adj=63999113 EBB_NTC: temp=50.0 EBB_mcu_temp: temp=40.4 sd_pos=1076165 heater_bed: target=70 temp=70.0 pwm=0.109 z_thermal_adjust: temp=28.5 gantry_temp: temp=30.7 pi_temp: temp=43.3 mcu_temp: temp=35.4 sysload=0.75 cputime=214.514 memavail=3489900 print_time=1315.838 buffer_time=2.072 print_stall=0 extruder: target=245 temp=245.0 pwm=0.289
Stats 1348.9: gcodein=0  mcu: mcu_awake=0.088 mcu_task_avg=0.000006 mcu_task_stddev=0.000006 bytes_write=3868685 bytes_read=1153837 bytes_retransmit=1267 bytes_invalid=0 send_seq=99580 receive_seq=99577 retransmit_seq=99580 srtt=0.001 rttvar=0.000 rto=3.200 ready_bytes=6 upcoming_bytes=19787 freq=179998536 EBBCan: mcu_awake=0.060 mcu_task_avg=0.000024 mcu_task_stddev=0.000041 bytes_write=1489479 bytes_read=979654 bytes_retransmit=660 bytes_invalid=0 send_seq=71634 receive_seq=71629 retransmit_seq=71634 srtt=0.001 rttvar=0.000 rto=3.200 ready_bytes=813 upcoming_bytes=4163 freq=63998550 adj=63999113 EBB_NTC: temp=50.0 EBB_mcu_temp: temp=40.4 sd_pos=1079337 heater_bed: target=70 temp=70.0 pwm=0.109 z_thermal_adjust: temp=28.5 gantry_temp: temp=30.7 pi_temp: temp=42.8 mcu_temp: temp=35.4 sysload=0.75 cputime=214.637 memavail=3488920 print_time=1316.828 buffer_time=2.061 print_stall=0 extruder: target=245 temp=245.0 pwm=0.289
Unhandled exception during run
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/klippy.py", line 217, in run
    self.reactor.run()
  File "/home/pi/klipper/klippy/reactor.py", line 292, in run
    g_next.switch()
  File "/home/pi/klipper/klippy/reactor.py", line 340, in _dispatch_loop
    timeout = self._check_timers(eventtime, busy)
  File "/home/pi/klipper/klippy/reactor.py", line 158, in _check_timers
    t.waketime = waketime = t.callback(eventtime)
  File "/home/pi/klipper/klippy/extras/led_effect.py", line 207, in _getFrames
    frames = [(effect, effect.getFrame(eventtime)) for effect in self.effects]
  File "/home/pi/klipper/klippy/extras/led_effect.py", line 471, in getFrame
    if layerFrame:
RuntimeError: maximum recursion depth exceeded
Transition to shutdown state: Unhandled exception during run
Dumping gcode input 0 blocks
Dumping 20 requests for client 4104697496
Received 40.371543: {"id": 3887723400, "method": "objects/list", "params": {}}
Received 40.513943: {"id": 3907570416, "method": "objects/subscribe", "params": {"objects": {"gcode": null, "webhooks": null, "configfile": null, "mcu": null, "mcu EBBCan": null, "heaters": null, "temperature_sensor EBB_NTC": null, "temperature_sensor EBB_mcu_temp": null, "stepper_enable": null, "tmc2209 extruder": null, "fan": null, "heater_fan hotend_fan": null, "gcode_move": null, "print_stats": null, "virtual_sdcard": null, "pause_resume": null, "display_status": null, "gcode_macro PAUSE": null, "gcode_macro RESUME": null, "gcode_macro CANCEL_PRINT": null, "gcode_macro _sb_vars": null, "gcode_macro _set_sb_leds": null, "gcode_macro _set_sb_leds_by_name": null, "gcode_macro _set_logo_leds": null, "gcode_macro _set_nozzle_leds": null, "gcode_macro set_logo_leds_off": null, "gcode_macro set_nozzle_leds_on": null, "gcode_macro set_nozzle_leds_off": null, "gcode_macro status_off": null, "gcode_macro status_ready": null, "gcode_macro status_busy": null, "gcode_macro status_heating": null, "gcode_macro status_leveling": null, "gcode_macro status_homing": null, "gcode_macro status_cleaning": null, "gcode_macro status_meshing": null, "gcode_macro status_calibrating_z": null, "gcode_macro status_printing": null, "gcode_macro clean_nozzle": null, "gcode_macro START_PRINT": null, "gcode_macro START_PRINT_MEASURE_FIRST": null, "gcode_macro START_PRINT_PREHEAT_FIRST": null, "gcode_macro START_PRINT_INIT": null, "gcode_macro START_PRINT_PREHEAT_EXTRUDER": null, "gcode_macro START_PRINT_HEAT_BED": null, "gcode_macro START_PRINT_HEATSOAK": null, "gcode_macro START_PRINT_QGL": null, "gcode_macro START_PRINT_AUTOZ": null, "gcode_macro START_PRINT_MESH": null, "gcode_macro START_PRINT_HEAT_EXTRUDER": null, "gcode_macro START_PRINT_START": null, "gcode_macro HEAT_SOAK": null, "gcode_macro CANCEL_HEAT_SOAK": null, "gcode_macro END_PRINT": null, "gcode_macro BED_MESH_CALIBRATE": null, "gcode_macro ADAPTIVE_PURGE": null, "gcode_macro HOTEND_FAN_CHECK": null, "gcode_macro FAN_STOPPAGE_ROUTINE": null, "gcode_macro G29": null, "gcode_macro G32": null, "gcode_macro M300": null, "gcode_macro M600": null, "gcode_macro QUERY_BME280": null, "gcode_macro QUERY_HTU21D": null, "gcode_macro M117": null, "gcode_macro M808": null, "exclude_object": null, "gcode_macro M486": null, "gcode_macro G130": null, "gcode_macro PURGE_LINE": null, "gcode_macro TEST_PROBE_ACCURACY": null, "gcode_macro TEST_PROBE_ACCURACY_2": null, "neopixel sb_leds": null, "neopixel chamber": null, "gcode_macro set_logo_leds_on": null, "gcode_macro status_part_ready": null, "gcode_macro status_cooling": null, "gcode_macro NEOPIXEL_DISPLAY": null, "gcode_macro show_led_preheat_progress": null, "gcode_macro clear_led_preheat_progress": null, "gcode_macro NEOPIXEL_DISPLAY_STATUS": null, "gcode_macro STOP_ALL_LED_EFFECTS": null, "tmc5160 stepper_x": null, "tmc5160 stepper_y": null, "tmc5160 stepper_z": null, "tmc5160 stepper_z1": null, "tmc5160 stepper_z2": null, "tmc5160 stepper_z3": null, "heater_bed": null, "settling_probe": null, "bed_mesh": null, "controller_fan controller_fan": null, "fan_generic Nevermore": null, "fan_generic BedFans": null, "z_thermal_adjust": null, "temperature_sensor gantry_temp": null, "temperature_host pi_temp": null, "temperature_sensor pi_temp": null, "temperature_sensor mcu_temp": null, "idle_timeout": null, "quad_gantry_level": null, "motion_report": null, "query_endstops": null, "system_stats": null, "manual_probe": null, "toolhead": null, "extruder": null, "probe": null}, "response_template": {"method": "process_status_update"}}}
Received 40.981325: {"id": 3907569480, "method": "gcode/help", "params": {}}
Received 44.154462: {"id": 3906620384, "method": "gcode/script", "params": {"script": "SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=70"}}
Received 48.089560: {"id": 3887724696, "method": "gcode/script", "params": {"script": "SET_HEATER_TEMPERATURE HEATER=extruder TARGET=150"}}
Received 49.742912: {"id": 3887722608, "method": "gcode/script", "params": {"script": "G28"}}
Received 57.446912: {"id": 3906981552, "method": "gcode/script", "params": {"script": "STOP_ALL_LED_EFFECTS"}}
Received 77.021568: {"id": 3887711280, "method": "gcode/script", "params": {"script": "SET_LED LED=chamber GREEN=0.925 RED=0.925 BLUE=1"}}
Received 81.208479: {"id": 3887711472, "method": "gcode/script", "params": {"script": "SET_LED LED=sb_leds GREEN=0.216 RED=0.204 BLUE=0.196 WHITE=0"}}
Received 82.503534: {"id": 3887711280, "method": "gcode/script", "params": {"script": "SET_LED LED=sb_leds GREEN=0.216 RED=0.204 BLUE=0.196 WHITE=0"}}
Received 83.768195: {"id": 3906980760, "method": "gcode/script", "params": {"script": "SET_LED LED=sb_leds GREEN=1 RED=0.937 BLUE=0.91 WHITE=0"}}
Received 85.030750: {"id": 3887713920, "method": "gcode/script", "params": {"script": "SET_LED LED=sb_leds GREEN=1 RED=0.937 BLUE=0.91 WHITE=1"}}
Received 91.381717: {"id": 3887713392, "method": "gcode/script", "params": {"script": "G90\n        G1 Y0 F7800"}}
Received 96.094036: {"id": 3887712960, "method": "gcode/script", "params": {"script": "G28 Y"}}
Received 153.097006: {"id": 3887722800, "method": "gcode/script", "params": {"script": "G90\n        G1 Y0 F7800"}}
Received 164.210837: {"id": 3887726448, "method": "gcode/script", "params": {"script": "G90\n        G1 Z25 F600"}}
Received 219.748813: {"id": 3887710344, "method": "gcode/script", "params": {"script": "G90\n        G1 Z25.00 F600"}}
Received 219.887277: {"id": 3887711088, "method": "gcode/script", "params": {"script": "CLEAN_NOZZLE"}}
Received 246.949096: {"id": 3887713152, "method": "gcode/script", "params": {"script": "QUAD_GANTRY_LEVEL"}}
Received 437.390805: {"id": 3907265776, "method": "gcode/script", "params": {"script": "SDCARD_PRINT_FILE FILENAME=\"Vonat/Wooden_Train_Connector4_x10-PETG.gcode\""}}
gcode state: absolute_coord=True absolute_extrude=False base_position=[0.0, 0.0, 0.1, 1247.2780199999524] last_position=[181.237, 199.199, 1.35, 1360.4281099998927] homing_position=[0.0, 0.0, 0.1, 0.0] speed_factor=0.0166666666667 extrude_factor=1.0 speed=80.0
Virtual sdcard (1083194): u'02.813 E0.02001\nG1 X158.274 Y202.271 E0.01974\nG1 X158.274 Y201.727 E0.01974\nG1 X158.328 Y201.185 E0.01974\nG1 X158.437 Y200.651 E0.01974\nG1 X158.599 Y200.131 E0.01974\nG1 X158.813 Y199.63 E0.01974\nG1 X159.076 Y199.153 E0.01974\nG1 X159.385 Y198.704 E0.01974\nG1 X159.738 Y198.289 E0.01974\nG1 X160.131 Y197.912 E0.01974\nG1 X160.56 Y197.576 E0.01974\nG1 X161.026 Y197.281 E0.02001\nG1 X161.254 Y197.16 E0.00934\nG1 X161.76 Y196.939 E0.02001\nG1 X162.278 Y196.771 E0.01974\nG1 X162.818 Y196.655 E0.02001\nG1 X163.073 Y196.621 E0.00934\nG1 X163.632 Y196.587 E0.02028\nG1 X163.889 Y196.591 E0.00934\nG1 X164.447 Y196.641 E0.02028\nG1 X164.701 Y196.684 E0.00934\nG1 X165.237 Y196.816 E0.02001\nG1 X165.75 Y196.999 E0.01974\nG1 X166.249 Y197.236 E0.02001\nG1 X166.473 Y197.363 E0.00934\nG1 X166.93 Y197.672 E0.02001\nG1 X167.349 Y198.021 E0.01974\nG1 X167.735 Y198.415 E0.02001\nG1 X167.901 Y198.613 E0.00934\nG1 X168.228 Y199.067 E0.02028\nG1 X168.546 Y199.586 E0.02207\nM204 S1000\nG1 X168.763 Y199.199 F18000\n;TYPE:External perimeter\n;WIDTH:0.4\nG1 F4800\n'
Upcoming (1084218): u'G1 X181.237 Y199.199 E0.38704\nG1 X181.449 Y198.852 E0.01262\nG1 X181.792 Y198.376 E0.01819\nG1 X182.181 Y197.938 E0.01819\nG1 X182.'
Reactor garbage collection: (1349.683349065, 1317.934115084, 1346.278700549)
Timeout with MCU 'mcu' (eventtime=1349.889854)
Timeout with MCU 'EBBCan' (eventtime=1349.889854)
Stats 1349.9: gcodein=0  mcu: mcu_awake=0.088 mcu_task_avg=0.000006 mcu_task_stddev=0.000006 bytes_write=3868685 bytes_read=1153837 bytes_retransmit=1267 bytes_invalid=0 send_seq=99580 receive_seq=99577 retransmit_seq=99580 srtt=0.001 rttvar=0.000 rto=3.200 ready_bytes=6 upcoming_bytes=25540 freq=179998536 EBBCan: mcu_awake=0.060 mcu_task_avg=0.000024 mcu_task_stddev=0.000041 bytes_write=1489479 bytes_read=979654 bytes_retransmit=660 bytes_invalid=0 send_seq=71634 receive_seq=71629 retransmit_seq=71634 srtt=0.001 rttvar=0.000 rto=3.200 ready_bytes=813 upcoming_bytes=5505 freq=63998550 adj=63999111 EBB_NTC: temp=50.0 EBB_mcu_temp: temp=40.4 sd_pos=1084218 heater_bed: target=70 temp=70.0 pwm=0.109 z_thermal_adjust: temp=28.5 gantry_temp: temp=30.7 pi_temp: temp=42.4 mcu_temp: temp=35.4 sysload=0.75 cputime=214.812 memavail=3488736 print_time=1318.121 buffer_time=2.354 print_stall=0 extruder: target=245 temp=245.0 pwm=0.289
Exiting SD card print (position 1084248)
Unhandled exception during run
Once the underlying issue is corrected, use the
"FIRMWARE_RESTART" command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

Script running error
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/extras/delayed_gcode.py", line 34, in _gcode_timer_event
    self.gcode.run_script(self.timer_gcode.render())
  File "/home/pi/klipper/klippy/gcode.py", line 229, in run_script
    self._process_commands(script.split('\n'), need_ack=False)
  File "/home/pi/klipper/klippy/gcode.py", line 211, in _process_commands
    handler(gcmd)
  File "/home/pi/klipper/klippy/gcode.py", line 285, in cmd_default
    raise gcmd.error(self.printer.get_state_message()[0])
CommandError: Unhandled exception during run
Once the underlying issue is corrected, use the
"FIRMWARE_RESTART" command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

The issue occures seemingly randomly but there must be something out there... I just do not know if it is related to the plugin or klipper, or something in the slicer generated gcode...

Thank you in advance! Kind regard