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

Long names issue (limit with Marlin FW) #9

Open
Jordan87 opened this issue Dec 20, 2021 · 17 comments
Open

Long names issue (limit with Marlin FW) #9

Jordan87 opened this issue Dec 20, 2021 · 17 comments
Labels
enhancement New feature or request

Comments

@Jordan87
Copy link

Hi

From one of Marlin firmware modders i received information that Marlin FW is limited to 96 characters. Are we able to limit names or show some notification that we exceeded 96 characters?

In my case :
PrinterMount PLA 0.2mm 20% 190.0C 50C Liczba obiektow 2 Czas 014011 Podpory 1234.gcode was not able to start printing,
after removing one digit on the end there was no problem with printing
PrinterMount PLA 0.2mm 20% 190.0C 50C Liczba obiektow 2 Czas 014011 Podpory 123.gcode

Discussion where i was asking about this issue :)
mriscoc/Ender3V2S1#163

Thank You!

@rgomezjnr
Copy link
Owner

Hi Jordan,

I'm realizing this is becoming a more common issue since people are creating more detailed and lengthy filenames and hitting their printer's gcode filename length limitations. I will work on restricting the generated filename length by limiting unnecessary characters like trailing zeros .0, and possibly implementing a max character length restriction which simply cuts off extra chars.

@Jordan87
Copy link
Author

Maybe limitation is only needed for printing via octoprint, same name from SD was working. ;)

@rgomezjnr
Copy link
Owner

Maybe limitation is only needed for printing via octoprint, same name from SD was working. ;)

That is strange and counter to what @mriscoc described in mriscoc/Ender3V2S1#163

@mriscoc does the gcode filename actually need to be a few characters less than 96 considering additional gcode commands that are sent to the printer?

@Jordan87 Can you try reprinting the initial long filename using Octoprint and setting the Ignore warning option as described in https://github.com/mriscoc/Marlin_Ender3v2/wiki/Octoprint#error-handling

Maybe what you are seeing is a Marlin firmware bug, that's reported by Octoprint as a checksum mismatch.
This is described in https://community.octoprint.org/docs?search=filename&topic=240#headline--cannot-select-sd-file and MarlinFirmware/Marlin@2d22902
@foosel is this relevant here or not?

All in all it's probably still a good idea to restrict the filename length generated by GFF+ to a reasonable maximum.

@mriscoc
Copy link

mriscoc commented Dec 24, 2021

Hi, the limit is in the buffer that receive the command trough the serial interface:
image

@Jordan87
Copy link
Author

Jordan87 commented Dec 25, 2021

@Jordan87 Can you try reprinting the initial long filename using Octoprint and setting the Ignore warning option as described in https://github.com/mriscoc/Marlin_Ender3v2/wiki/Octoprint#error-handling

As I understand this will only prevent from M112 error (Emergency stop) but error on serial port will be still present.
But if you really want me to do this I will check it :)

@rgomezjnr
Copy link
Owner

Ok so the 96 char buffer limit only applies to the serial interface, which is why @Jordan87 is able to print the same original long filename via SD card but not using Octoprint?

@mriscoc what would be a reasonable max filename length, considering a portion of the serial command buffer needs to be preserved for Gcode commands when using Octoprint? I'll do some research. Would it be around 80-86 chars considering "N1 M75 PrinterMount PLA 0.2mm 20% 190.0C 50C Liczba obiektow 2 Czas 014011 Podpory 1234.gcode*100"?

@mriscoc
Copy link

mriscoc commented Dec 26, 2021

Ok so the 96 char buffer limit only applies to the serial interface, which is why @Jordan87 is able to print the same original long filename via SD card but not using Octoprint?

@mriscoc what would be a reasonable max filename length, considering a portion of the serial command buffer needs to be preserved for Gcode commands when using Octoprint? I'll do some research. Would it be around 80-86 chars considering "N1 M75 PrinterMount PLA 0.2mm 20% 190.0C 50C Liczba obiektow 2 Czas 014011 Podpory 1234.gcode*100"?

To be safe consider 80 chars as maximum size.

@rgomezjnr
Copy link
Owner

@mriscoc Ok thank you for the input I will implement a way to allow users of GFF+ to limit the generated gcode filename to 80 chars.

@rgomezjnr
Copy link
Owner

@Jordan87 Here's what I have working now, showing the spinbox with tooltip on mouse hover. I set the maximum value of the spinbox to 255 based on discussion in https://stackoverflow.com/questions/265769/maximum-filename-length-in-ntfs-windows-xp-and-windows-vista. Let me know if you have any feedback before I release this.

image

@Jordan87
Copy link
Author

Hi

Sorry for late response.
This should be enough :)

The best would be to have some notification during sending file to octopi with button "Print with OctoPrint" but im sure its more complicated to do this.

Thank You

@rgomezjnr
Copy link
Owner

Thanks for the feedback.

The best would be to have some notification during sending file to octopi with button "Print with OctoPrint" but im sure its more complicated to do this.

Do you mean in lieu of or in addition to the Filename length limit? I don't think it would be that much more work to show a notification but I'm trying to understand why you would want a notification (which might just be nice to know) if the filename needs to be truncated anyways, otherwise the print won't work. Would you want to modify the filename format if the limit is exceeded?

You might be interested in the Octoprint plugin OctoPrint-IFTTT which I think can also create notifications.

https://github.com/tjjfvi/OctoPrint-IFTTT/wiki

To customize things like the notification text, you can use values.

https://docs.octoprint.org/en/master/events/index.html#file-handling

File handling
Upload
A file has been uploaded through the REST API.

Payload:
name: the file’s name

@Jordan87
Copy link
Author

Notification about exceeded name limit in your plugin will make us aware that we will lost some info from file name. Notification and possibility to modify [base_name] would be ideal solution I think :)

@rgomezjnr
Copy link
Owner

I'll look into adding a notification, shouldn't be too difficult. Changing the filename format or job name after the slicing has been performed is more difficult since this involves updating the format or job name using a signal which I haven't added yet. This is an issue in the current version of GFF+. The only way around it currently is to change the format or job name, then manually re-slice the object.

@rgomezjnr
Copy link
Owner

Jordan what do you think of this notification? The message shows once the Slice button is clicked. Currently debugging an issue that's causing too many messages to spawn.

image

image

@Jordan87
Copy link
Author

Jordan87 commented Jan 29, 2022

Hi

I dont know why i didnt recieve notification about new response...
It looks good.

Today i found one useful feature build in in Cura for Octoprint which could help with your plugin.
If i select "Confirm print job options before sending":
image
image
it will show this useful window where we can manual adjust file name :)
image

@rgomezjnr
Copy link
Owner

Thanks for the feedback. Good to know about Octoprint's filename confirmation, it should also work with GFF+ I believe.

@Jordan87
Copy link
Author

Yes, as you can see we have file name input where we can change it, so from your side notification about truncated characters should be all what we need :)

Thanks

@rgomezjnr rgomezjnr added the enhancement New feature or request label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants