Marlin: [Q] How to SD Print multiple files in a row?

Created on 23 Nov 2018  路  7Comments  路  Source: MarlinFirmware/Marlin

_Originally posted by @Yahyaoui94 in https://github.com/MarlinFirmware/Marlin/issue_comments#issuecomment-441138829_

How can I add a function (only for the printer I am working on for the moment) that allows me to print all the files on the sd card one after another? I am most interested in the automatic next file execution feature. I noticed the AUTOSTART but if I understood correctly, does it mean that if I rename my 3 files as AUTO0.g, AUTO1.g, AUTO2.g , they will be processed like a queue after the completion of the previous one?

SD Card Printing Question

Most helpful comment

does it mean that if I rename my 3 files as AUTO0.g, AUTO1.g, AUTO2.g , they will be processed like a queue after the completion of the previous one?

Yes.

You can also make a single file that contains lots of M32 commands.

All 7 comments

i haven't tried - try
禄 disable your Display and enable SDSUPPORT
or
禄 enable SDSUPPORTand declarat SD_DETECT_PIN

does it mean that if I rename my 3 files as AUTO0.g, AUTO1.g, AUTO2.g , they will be processed like a queue after the completion of the previous one?

Yes.

You can also make a single file that contains lots of M32 commands.

does it mean that if I rename my 3 files as AUTO0.g, AUTO1.g, AUTO2.g , they will be processed like a queue after the completion of the previous one?

Yes.

You can also make a single file that contains lots of M32 commands.

Thank you :) @thinkyhead renaming should do it for the moment but I am considering to modify the firmware by adding a file.openNextFile() function but am having trouble finding where to insert it or in which tab precisely. Am considering 4 possibilities: 1-Ultralcd.cpp ; 2-setup() ; 3-Uncomment #define MENU_ADDAUTOSTART ; 4-Marlin.cpp

You'll need to be very careful about what constitutes "next file," since SD cards don't organize files by name, but only roughly by creation date, and that order is lost when files are deleted and new files are added. So you would need to piggyback off the SDCARD_SORT_ALPHA feature. You must also consider how files are opened and started, as this determines what the current "working directory" will be. The CardReader class is not very well designed, so finding your way around can be a chore. But if you follow the breadcrumbs in the code you should be able to figure it out. Best of luck!

You'll need to be very careful about what constitutes "next file," since SD cards don't organize files by name, but only roughly by creation date, and that order is lost when files are deleted and new files are added. So you would need to piggyback off the SDCARD_SORT_ALPHA feature. You must also consider how files are opened and started, as this determines what the current "working directory" will be. The CardReader class is not very well designed, so finding your way around can be a chore. But if you follow the breadcrumbs in the code you should be able to figure it out. Best of luck!

As long as all the files in the SDcard are processed individually without repeat, it will work for me so the order doesn't really matter in my case. I will sink myself more in the code for more hints as you suggested. As for the function I mentioned earlier, in which tab or function do you think should I place it?

in which tab or function do you think should I place it?

I think you'll find that the implementation will require changing code in various places.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

otisczech picture otisczech  路  3Comments

modem7 picture modem7  路  3Comments

esenapaj picture esenapaj  路  3Comments

Ciev picture Ciev  路  3Comments

Bobsta6 picture Bobsta6  路  3Comments