MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
15.97k stars 19.09k forks source link

[FR] SD card logging #26364

Open j007jackson opened 7 months ago

j007jackson commented 7 months ago

Is your feature request related to a problem? Please describe.

Yes. I am currently having an intermittent problem with my Ender 3 Pro, running Marlin 2.1.2.1. On long prints (multiple hours) the printer stops and reboots. This is a difficult issue to diagnose, because of the long print time time and lack of any surviving error or warning messages. I would love to be able to see the the log message that was issued just before shutdown and restart. Thus, my request for a new feature that would me let me see the last log message. I know the issue of SD card logging has been discussed before, but this is a limited special case version, just for cases like mine.

Are you looking for hardware support?

No response

Describe the feature you want

When the firmware gets in a situation where it has determined that a shutdown is required. It would first close the gcode file and do whatever clean up actions are required. It would save the last log message and then write that message to a special file on the SD card (Marlin.log perhaps) and then proceed with the shutdown. You could overwrite any previous contents, just to prevent the file from expanding beyond control. This would help greatly in identifying the problem.

Additional context

No response

EvilGremlin commented 7 months ago

use serial logging in octoprint

ellensp commented 7 months ago

Please see https://marlinfw.org/docs/gcode/M928.html Pair that with POSTMORTEM_DEBUGGING and you'll have all kinds of debug info