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

[BUG] MKS UI does not show gcode preview image #19914

Closed
Malderin opened this issue Oct 26, 2020 · 12 comments · Fixed by #20564
Closed

[BUG] MKS UI does not show gcode preview image #19914

Malderin opened this issue Oct 26, 2020 · 12 comments · Fixed by #20564

Comments

@Malderin
Copy link
Contributor

Malderin commented Oct 26, 2020

Board MKS robin nano v2
Marlin 2.0.x - last bugfix

Bug Description

In the generated gcode through the plugin "mks wifi", the model preview on the memory card is not displayed (displayed "no data")
Software - Cura v. 4.7.1, mks wifi plugin v. 1.0.2 (from cura store).

My Configurations

Conf.zip

Steps to Reproduce

  1. Install Cura slicer, install mks wifi plugin from cura store;
  2. Slice any model and save on sd card with option "save as tft file";
    1
  3. Insert sd card into printer and click "printing"
  4. "No data"
    2

Additional Information

  1. My test gcode file with the preview of the model:
    simple cube.zip
  2. The preview is displayed normally during printing
    3
@github-actions
Copy link

This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days.

@rhapsodyv rhapsodyv added Bug: Confirmed ! no-locking Prevent Lock-bot from locking the issue. and removed stale-closing-soon labels Dec 18, 2020
@sjasonsmith sjasonsmith changed the title [BUG] (gcode preview, mksui) [BUG] MKS UI does not show gcode preview image Dec 24, 2020
@rhapsodyv
Copy link
Member

Fixed here: #20564, can you test it?

@rhapsodyv rhapsodyv linked a pull request Dec 25, 2020 that will close this issue
@Malderin
Copy link
Contributor Author

Fixed here: #20564, can you test it?
already better, but still there is a reception
IMG_20201225_142636268
IMG_20201225_142647675

@rhapsodyv
Copy link
Member

I was testing with just one file. Now it's ok, I guess. Can you try again? #20564

@Malderin
Copy link
Contributor Author

I was testing with just one file. Now it's ok, I guess. Can you try again? #20564

everything is fine
IMG_20201225_175323993

@X-Ryl669
Copy link
Contributor

X-Ryl669 commented Dec 28, 2020

Please reopen, the fix in #20564 does not work for me.
It still crash the printer when listing the files if one of them has a preview. I'm generating the preview like it's displayed above (via MKS Cura plugin)

This is the resulting file (unzip to a SD Card and try to list the files):
SP_MU~1.GCO.zip
I can provide other if you want.

I'm using a MKS Robin Nano 35 (so it's a 480x320 screen and the expected icons are 100x100 not 50x50 as show above).

I've already fixed this in the MKS's PR31.
The fix is more complex than the proposed solution since there is both a bug in the file parsing and in the expected icon size.

Currently, the status of the MKS's UI is not clear. I can't really report bug on the PR #20191 since it's not in master, and if I'm reporting bugs to MKS's branch, it's delaying inclusion in Marlin as it has not settled yet.

@Malderin Malderin reopened this Dec 28, 2020
@Malderin
Copy link
Contributor Author

@X-Ryl669 reopened

@X-Ryl669
Copy link
Contributor

With this fix, the printer crashes on the 3rd file (none displayed):
image

With my fix, the printer is happy:
image

(Sorry for the poor quality of the picture, I'm using the printer's webcam here)

@rhapsodyv
Copy link
Member

The file you attached is a invalid gcode. It have dirty on top, like part of a email. Just remove the dirty and it should work:
Dirty:

--boundary_.oOo._F2003otnPwbPRz13/F4h0s+GUovex2zD
Content-Disposition: form-data; name="file"; filename="SP_Mutter.gcode"

Screen Shot 2020-12-28 at 10 24 40

@X-Ryl669
Copy link
Contributor

X-Ryl669 commented Dec 28, 2020

Sorry to bother you, but I haven't done anything to the file (it's what's produced by MKS WIFI Cura plugin). I have tens of such files on the SD card and they are all like this. There are being written as-is from the MKS's WIFI module firmware. MKS wifi module is using genuine firmware.

AND It doesn't matter since the code is correctly finding the first position of the simage part and storing this position in variable sd_read_base_addr as expected. It works since the code is searching for ;simage in lv_open_gcode_file and there is one (so anything before this part is completely ignored).

Then, remove them, and you'll see the file are still crashing the printer (because of the wrong size).
Please notice that GCODE files are text file and the end of line characters should not have any influence. Yet, the current code expect that lines are separated by '\r' char and not \r\n or \n. This means that opening a GCode file and saving them in any text editor (or any GCode processor) will mangle the end of lines and break the code expecting a \r only, leading to a printer crash.

The bug is still present, removing the lines does not change anything. Please reopen.

@rhapsodyv
Copy link
Member

This should be enough: #20589

@thisiskeithb thisiskeithb removed the no-locking Prevent Lock-bot from locking the issue. label Mar 30, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants