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

Octoprint not refreshing SD Card UI #381

Closed
academicdave opened this issue Feb 16, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@academicdave
Copy link

commented Feb 16, 2014

My version of Octoprint is: Branch: master, Commit: b282a18
Problem Occurs on Chrome, Safari, and across operating systems: tested on Mac, Ubuntu and iPad.
Printer: Mendel90 running nophead's fork of Marlin

Issue: The SD UI will not refresh. It shows nothing as being on the SD card. However if I hit refresh in the UI and look at the Terminal output I can see the files. The M20 and M22 commands work as well, but nothing actually refreshes the UI to enable me to print. I can still upload via Octoprint and print that way as it shows files Uploaded to Octoprint.

Terminal Log:
Send: N4598 M84*47
Changing monitoring state from 'Printing' to 'Operational'
Recv: ok
Send: M21
Recv: echo:SD card ok
Send: M20
Recv: ok
Recv: Begin file list
Recv: ARDBOX1.GCO
Recv: ARDBO
1.GCO
Recv: BREADB1.GCO
Recv: CLIP
1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�END1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�START_1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�START_2.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
1.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
2.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
3.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
4.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXDC421.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXDDB0
1.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXEFFD1.GCO
Recv: /TRASH-1/FILES/ANDROID_.G
Recv: /TRASH-1/FILES/ANDROI1.GCO
Recv: CLIP~~2.GCO
Recv: POTME
1.GCO
Recv: POTSM
1.GCO
Recv: End file list
Recv: ok
Send: M20
Recv: Begin file list
Recv: ARDBOX1.GCO
Recv: ARDBO
1.GCO
Recv: BREADB1.GCO
Recv: CLIP
1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�END1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�START_1.GCO
Recv: /TRASH-1/FILES/SETTINGS/S?�START_2.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
1.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
2.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
3.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXAMPL
4.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXDC421.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXDDB0
1.GCO
Recv: /TRASH-1/FILES/SKEINF1/S?�EXEFFD1.GCO
Recv: /TRASH-1/FILES/ANDROID_.G
Recv: /TRASH-1/FILES/ANDROI1.GCO
Recv: CLIP~~2.GCO
Recv: POTME
1.GCO
Recv: POTSM
1.GCO
Recv: End file list
Recv: ok

@academicdave

This comment has been minimized.

Copy link
Author

commented Feb 16, 2014

I managed to fix it although I am not entirely sure of the problem. Here is what I did and what I learned. I reinstalled Octoprint on the SD card and still had the problem. But reformating the SD card containing the print files actually fixed the problem. So apparently there was a file on the SD card (actually on both SD cards as I had tried two different ones) that caused the problem. Now everything is fine. Unfortunately I am not sure what the file was so that I can reproduce the problem and let you know. But if it happens again I'll figure it out and post.

@foosel

This comment has been minimized.

Copy link
Owner

commented Feb 16, 2014

I was just able to reproduce it, it's non-ascii characters in the filename. Looking into that.

@foosel foosel added the type:bug label Feb 16, 2014

foosel added a commit that referenced this issue Feb 17, 2014

Only list those SD files that have a ASCII filename
 According to the RepRap protocol we should actually not ever get anything other than those anyways, as the protocol is defined as ASCII-only. In the future there might be a way to somehow handle such files too, for the time being this fixes issues though where non-ascii files on the SD made the whole SD file handling not work.

 Closes #381
@foosel

This comment has been minimized.

Copy link
Owner

commented Feb 17, 2014

Ok, this is weird.

According to the RepRap wiki, all communication between host and printer should be ASCII (quote: "All communication is in printable ASCII characters."). However, I looked into the Marlin source code and it doesn't look like it's enforcing this for filenames stored on the SD card and returned in a reply to M20. Quick look into the (non-binary protocol part of the) Repetier source didn't turn any kind of validation there either. Then of course I might just have overlooked something here.

In any case, for the time being OctoPrint will now simply ignore any filenames that are not ASCII (see the commit above). Problem is that I currently see no clean way to work with these filenames (given that I'm not supposed to send any non-printable ASCII characters to the printer). Maybe I (or someone else) will have a epiphany here ;)

@foosel foosel closed this Feb 17, 2014

foosel added a commit that referenced this issue Mar 9, 2014

Only list those SD files that have a ASCII filename
 According to the RepRap protocol we should actually not ever get anything other than those anyways, as the protocol is defined as ASCII-only. In the future there might be a way to somehow handle such files too, for the time being this fixes issues though where non-ascii files on the SD made the whole SD file handling not work.

 Closes #381
(cherry picked from commit b115b6f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.