WirelessPrinting
WirelessPrinting copied to clipboard
Upload to printer SD card
We could try to upload to printer SD card, although it is reported to be very slow.
- http://marlinfw.org/docs/gcode/M020.html M20 - List SD Card
- http://marlinfw.org/docs/gcode/M021.html M21 - Init SD card
- http://marlinfw.org/docs/gcode/M022.html M22 - Release SD card
- http://marlinfw.org/docs/gcode/M023.html M23 - Select SD file
- http://marlinfw.org/docs/gcode/M028.html M28 - Start SD write
- http://marlinfw.org/docs/gcode/M029.html M29 - Stop SD write
- http://marlinfw.org/docs/gcode/M024.html M24 - Start or Resume SD print
Most interestingly, we could use
- http://marlinfw.org/docs/gcode/M928.html M928 - Start SD Logging
Use this command to start logging all console and host input to an SD file while still operating the machine.
The way I understand it, we could print at normal speed and after a complete print would find the printed GCODE on the printer's SD card, from where it could be re-printed at any time.
Might also come in handy for debugging purposes.
Try this by adding to a GCODE file as the first line:
M22 ; Release SD card
M21 ; Init SD card
M928 log.gcode ; Start logging to SD card
(replace log.txt
with the name of the GCODE file being uploaded),
and as the last line:
M29 ; Stop logging to SD card
We should probably save the file as ERROR-name-of-the.gcode
and rename it to name-of-the.gcode
only after the print has succeeded. This way we won't accidentally print half-complete GCODE.
It seems promising...
Trying it manually as we speak.
Perhaps I think printer still print sent code
I don't see the GCODE being saved, do you?
M22 ; Release SD card
M21 ; Init SD card
M23 log.gcode ; Select SD file
M928 log.gcode ; Start logging to SD card
; TEST
M29 ; Stop logging to SD card
telnet says:
>M21
<echo:SD card ok#wait more#
<ok#ok#
>M928 log.gcode
<echo:Now fresh file: log.gcode #wait more#
<open failed, File: log.gcode .#wait more#
<ok#ok#
>M29
<ok#ok#
>M117 Complete
Perhaps we need M23
.
I can't test...long print... but
<open failed, File: log.gcode .#wait more#
is not a good sign..
Loocking into marlin code M928 opens a file and set some flags, nothing more should be needed
With it, getting
>M21
<echo:SD card ok#wait more#
<ok#ok#
>M23 log.gcode
<echo:Now fresh file: log.gcode#wait more#
<open failed, File: log.gcode.#wait more#
<ok#ok#
>M928 log.gcode
<echo:Now fresh file: log.gcode #wait more#
<open failed, File: log.gcode .#wait more#
<ok#ok#
>M29
<ok#ok#
>M117 Complete
<ok#ok#
I am stuck here. Running stock Marlin bugfix-1.1.x firmware from https://github.com/probonopd/marlin-for-ender-2.
open in marlin calls:
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
and fail to this will send such error message. I'm looking at marlin 2.0 source.
I don't like both O_CREAT
and O_APPEND
but I need to wait 4h before checking something
Tried with 2 SD cards, and also with LOG.GCO
as the filename.
Prusa i3 MK2S says:
>M22
<ok#ok#
>M21
<echo:SD card ok#wait more#
<ok#ok#
>M23 LOG.GCO
<ok#ok#
>M928 LOG.GCO
<ok#ok#
>M29
<ok#ok#
>M117 Complete
<ok#ok#
>M105
but I don't see the file on the printer's SD card either.
1h left then I'll have printer to test it
Having a transparent serial bridge #132 would come in neat to test things like this.
Tested now.. use file format 8.3
but as I said before, it execute commands while it save them into file
Yes, it would be good if it would print as usual and save a copy of what is being printed to the printer's SD, so that it could be re-printed later from the printer's LCD. I could not make it work, though...
I just sent: M928 test.gco G28 G0 x0 y0 M29
That's may be a new approach, but only available on Marlin2 and must be enabled on firmware https://github.com/MarlinFirmware/Marlin/pull/14817