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

Large filename (gcode) crashes the plugin #32

Closed
jpcurti opened this issue Jun 2, 2024 · 1 comment · Fixed by #36
Closed

Large filename (gcode) crashes the plugin #32

jpcurti opened this issue Jun 2, 2024 · 1 comment · Fixed by #36
Assignees
Labels
bug Something isn't working

Comments

@jpcurti
Copy link
Owner

jpcurti commented Jun 2, 2024

Wide names causes a crash on the file selection menu
image
WhatsApp Image 2024-06-02 at 12 23 16

only recoverable after a firmware restart:
image

@jpcurti jpcurti added the bug Something isn't working label Jun 2, 2024
@jpcurti jpcurti added this to the Bugfixes for a stable release milestone Jun 2, 2024
@jpcurti
Copy link
Owner Author

jpcurti commented Jun 2, 2024

The maximum data payload for a data frame is 248 bytes (according to the T5L_TA instruction set):
image. From the TJC module, the data sent to the display is :

        self.byte(self.cmd_draw_text) # 1 byte
        self.word(x) # 2 bytes
        self.word(y) # 2 bytes
        self.byte(0x00)  # font # 1 byte
        self.byte(0x02 | (show_background * 0x40))  # mode (bshow) # 1 byte
        self.byte(size)  # size # 1 byte
        self.word(font_color) # 2 bytes
        self.word(background_color) # 2 bytes
        self.string(string) # n bytes

This means that the string sent to the draw_string method should have a max length n of 248 - 12 = 238 bytes a.k.a a 238 char string would be the limit.

The crash, however, happens with the string "CE3V3SE_customizable-box-psu-power-adapter-holder_20240505-36-1c54hxf.gcode", which is 75 byte long. What can be wrong here?

  1. The T5L_TA Instruction set is not specifically for the TJC display on the E3V3SE. The payload can (and probably is) very smaller. If I truncate the string to the first 30 chars, it works normally. Where is the limit?

Solution: Check the maximum byte number that can be sent when writing text and truncate the string to it.

As anything bigger than 40 char cant be displayed in the screen size anyways, I will truncate the string to 40 bytes and call it a day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant