Home / Forum / Software / ESTLCAM, Marlin, and file extensions / Reply To: ESTLCAM, Marlin, and file extensions

Profile photo of Leo69Leo69
Post count: 343
#5722 |

If you look at the Marlin source code you’ll find a file called cardreader.cpp. I’m pretty sure the filename filter is hardcoded there but I know NOTHING about the inner workings of Marlin. If what I’m seeing is right, then this code will allow any filename extension so long as the first character is a ‘G’. It would probably work if you renamed your file testfile.grandma .If it does, then you can be pretty sure this is the filter code. It would’ve been nice if they made this parameter configurable. You could try changing it and see what happens but there may be code elsewhere that verifies the filename again. If you feel brave, make a backup of your firmware first. Then…..

1) open cardreader.cpp file in notepad
2) search for the code snippet below

if (!filenameIsDir && (p.name[8] != ‘G’ || p.name[9] == ‘~’)) continue;

Replace with the code snippet below

if (!filenameIsDir && (p.name[8] != ‘G’ || p.name[8] != ‘N’ || p.name[9] == ‘~’)) continue;

3)Save the changes

4) Re-compile and flash in your Arduino IDE

If it doesn’t work then just re-flash your backup from earlier

This code change SHOULD allow any file with extension beginning with a ‘G’ or an ‘N’. I emphasize that I’m guessing and have tested nothing but you’ve proven yourself to be a willing guinea pig Karl so I’d like to hear how it works out:)