3D print freezes when printing - syntax error in luban generated gcode?

Hello everyone,

I got my snapmaker 2.0 and I tried the 3d print module (before I tried the laser module - just awesome). So I looked up a 3d model I want to print and came over Baby Groot by Byambaa - Thingiverse

I downloaded the stl file and loaded it into Luban (version 3.13.1). I resized the model a little bit (20cm height) and generated the g-code (size 207MB). I loaded the g-code on a USB3.0 stick (FAT 32 formatted) and letz go printing. Estimated print time 36 hours - quite long but OK letz do it. The printer starts printing and before I went to bed he was still printing - looked good.

When I came in the morning the printer stopped printing. He didn’t do anything. I tried to pause and restart - nothing happened. I shut it down and tried recovery - nothing happened. Ok so print destroyed - no problem. But I want to know what the problem was so I exported the logs and in the SC_0.log I found this:
1612684297649,2021.02.07 07:51:37.649,INFO,SC,line 3029000: G1 X135.9 Y196.561 E1275.66346
1612684306737,2021.02.07 07:51:46.737,ERROR,SC,java.lang.ArrayIndexOutOfBoundsException: length=20; index=20
1612684327625,2021.02.07 07:52:07.625,WARN,SC,No reply for 20887 ms since last response (#3029619: F �".�5n�Y�02!(5��25�03ZC0 @�22d30�8 6&a7u`G32��&z140�e�G5X23F’7�I2 �.%-0 G�g9.24h-)

I checked the FW log files for the same timestamp and in the FW log files it seems that the command just doesn’t work - he just logs the following line for hours:
1612684323937,2021.02.07 07:52:03.937,INFO,SC-FW,waiting HMI command, current line: 3029618

Next step was checking the gcode - the haning line. With line 3029614 the code looks kinda weird:


This went on until line 3030034 then everything looks fine again.

I uploaded the logs (the SC0_log is packed - google drive upload failed always on this file - idk why) and the gcode file and the used stl file to google drive if you want to have a look. Groot - Google Drive

My Question:
Am I right that the gcode file is corrupted? If yes: why did luban generate a corrupted gcode file from the stl file?
Is there any possibility to check the gcode file before printing if everything is correct?

BTW until the printing crashed - the result looks awesome - perfectly printed :slight_smile: (used default settings with normal quality)

Thank you in advance!

Oh, yeah, that is corrupt in a big way. The very top line in your screen capture is normal-ish. The next one starts falling apart midway through.

g-code is plain text that pretty much only contains capital letters and digits, so you can open a g-code file in a text editor (if notepad won’t take it, grab notepad++ or similar), then do a quick-and-dirty search for things like ` or ~ that aren’t legal in g-code and aren’t likely to show up in a comment. If you find them, the file is probably bad.

You may be able to slice this STL successfully in Cura/Simplify 3D/Slic3r/some other program, but before you do, I would check your hard drive (if you didn’t write the file directly to USB) and/or the USB key for corruption or bad sectors, just in case. If the model is the one I’m thinking of, it’s very popular and should have blown up on someone before now if there were a problem with it.

As ElloryJaye mentioned, I’d suspect your storage before Luban. I’d try re-slicing in Luban, saving to the local disk, and opening the file. If it looks good, copy to the USB drive, and repeat.

The fact that it messed up and then becomes readable later sounds like a bad sector. For a harddrive or SSD, they’re supposed to notice that and remap when it fails. It’s not fool proof, but it’s likely that the failed sector is no longer in service anymore. There are tools that can tell the drive to do a self test, but that is OS dependent. Look for a tool that supports SMART.

It’s harder to find problems with USB drives. The easiest test I have is to re-format that USB drive, and disable the “Quick Format”. The OS clear out the whole drive. If it has any errors during the process, replace the drive. There isn’t anything you can do to repair one once it’s started to fail.