Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to printer SD card #131

Open
probonopd opened this issue Jul 21, 2019 · 19 comments
Open

Upload to printer SD card #131

probonopd opened this issue Jul 21, 2019 · 19 comments

Comments

@probonopd
Copy link
Owner

We could try to upload to printer SD card, although it is reported to be very slow.

@probonopd
Copy link
Owner Author

@probonopd
Copy link
Owner Author

probonopd commented Jul 21, 2019

Most interestingly, we could use

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.

@GMagician
Copy link
Collaborator

It seems promising...

@probonopd
Copy link
Owner Author

Trying it manually as we speak.

@GMagician
Copy link
Collaborator

Perhaps I think printer still print sent code

@probonopd
Copy link
Owner Author

probonopd commented Jul 21, 2019

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.

@GMagician
Copy link
Collaborator

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

@probonopd
Copy link
Owner Author

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#

@probonopd
Copy link
Owner Author

I am stuck here. Running stock Marlin bugfix-1.1.x firmware from https://github.com/probonopd/marlin-for-ender-2.

@GMagician
Copy link
Collaborator

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

@probonopd
Copy link
Owner Author

Tried with 2 SD cards, and also with LOG.GCO as the filename.

@probonopd
Copy link
Owner Author

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.

@GMagician
Copy link
Collaborator

1h left then I'll have printer to test it

@probonopd
Copy link
Owner Author

Having a transparent serial bridge #132 would come in neat to test things like this.

@GMagician
Copy link
Collaborator

Tested now.. use file format 8.3

@GMagician
Copy link
Collaborator

but as I said before, it execute commands while it save them into file

@probonopd
Copy link
Owner Author

probonopd commented Jul 21, 2019

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...

@GMagician
Copy link
Collaborator

I just sent:
M928 test.gco
G28
G0 x0 y0
M29

@GMagician
Copy link
Collaborator

That's may be a new approach, but only available on Marlin2 and must be enabled on firmware
MarlinFirmware/Marlin#14817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants