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

Problem using some letters in folder names when browsing sd card. #3593

Closed
lintz opened this issue Apr 22, 2016 · 11 comments
Closed

Problem using some letters in folder names when browsing sd card. #3593

lintz opened this issue Apr 22, 2016 · 11 comments

Comments

@lintz
Copy link

lintz commented Apr 22, 2016

Using Scandinavian letters such as Ä ä makes it impossible to enter a folder. Still showed correctly on display.

Tested on Marlin 1.1.0-RC5 - 01 April 2016

@lintz lintz closed this as completed Apr 22, 2016
@lintz lintz reopened this Apr 22, 2016
@thinkyhead
Copy link
Member

thinkyhead commented Apr 23, 2016

Thank you for reporting this issue. Before proceeding, please download the latest RCBugFix code and test it. We haven't heard about this before, so we might have already fixed this issue.

If you still find a problem with RCBugFix then can you issue an M20 command from Pronterface and post the output of the command here?

@lintz
Copy link
Author

lintz commented Apr 24, 2016

Tested problem still exist on RCBugFix.

Tried with following folder names

1_test_å
2_test_ä
3_test_ö
4_test_& (works)
5_test_ñ 

1,2,3 and 5 are impossible to enter.

m20 gives

>>> m20
SENDING:M20
Begin file list
/PRUSAU~1/LCD_BO~1.GCO
/PRUSAU~1/LCD_BO~2.GCO
/PRUSAU~1/LCD_BO~3.GCO
/ELEFANT/LFS_EL~1.GCO
echo:Cannot open subdir
Attempted to write invalid text to console, which could be due to an invalid baudrate
/BESTAL~1/PINE64~1.GCO
/BESTAL~1/PINE64~2.GCO
echo:Cannot open subdir
Attempted to write invalid text to console, which could be due to an invalid baudrate
echo:Cannot open subdir
Attempted to write invalid text to console, which could be due to an invalid baudrate
/MINION/0_2MIN~1.GCO
/MINION/0_06MI~1.GCO
/MINION/MINION~1.GCO
echo:Cannot open subdir
Attempted to write invalid text to console, which could be due to an invalid baudrate
/YI/YI_20_~1.GCO
/YI/MOUNTC~1.GCO
/HAPPYC~1/08MM_H~1.GCO
/RPI/SOAPIB~1.GCO
/RPI/SOAPIB~2.GCO
/FISH/FISH_F~1.GCO
/RC/HMINIH~1/WALLMO~1/BACKIN~1.GCO
/RC/HMINIH~1/WALLMO~1/2XQUAD~1.GCO
/RC/HMINIH~1/ARM31~1.GCO
/RC/HMINIH~1/ARM31X~1.GCO
/RC/HMINIH~1/MAINBO~1.GCO
/RC/HMINIH~1/MAINTO~1.GCO
/RC/HMINIH~1/U_TOP3~1.GCO
/RC/MICROQ~1/FIREFL~1.GCO
/RC/MICROQ~1/FIREFL~2.GCO
/RC/MICROQ~1/SL7_2~1.GCO
/RC/PEON23~1/PEON23~1.GCO
/RC/PEON23~1/PEON23~2.GCO
/RC/PEON23~1/PEON23~3.GCO
/RC/PEON23~1/PEON23~4.GCO
/RC/PEON23~1/PEON23~5.GCO
/RC/PEON23~1/PEON23~6.GCO
/RC/PEON23~1/1XPEON~1.GCO
/RC/TRICOP~1/AOMWAY~2.GCO
/RC/TRICOP~1/LANDIN~1.GCO
/RC/TRICOP~1/AOMWAY~3.GCO
/RC/XT_60_~1.GCO
/RC/305_SQ~1.GCO
/RC/F450/UPMODV~1.GCO
/RC/F450/DOWNMO~1.GCO
/RC/SPACER~1/SPACER~1.GCO
/RC/CHEERS~1.GCO
End file list

@thinkyhead
Copy link
Member

@lintz As far as I know, all DOS 8.3 filenames are supposed to be plain old ASCII. So there shouldn't be any "invalid characters" in any of the file or folder names.

Can you also try M111 S1 before you do M23 or "Print SD File" from the controller? That will show the command that is being sent to start the print. That might also provide a clue.

@thinkyhead
Copy link
Member

thinkyhead commented Apr 25, 2016

Hmmm… We should have working FAT-32 at this point. See #2080 for example…

@thinkyhead
Copy link
Member

thinkyhead commented Apr 25, 2016

@lintz Please try this branch which will generate a lot of logging of filename activity. It will be a huge log, but if you can find the interesting / important part and paste it here that will help a lot!

First, just try clearing the log right before "Start SD Print" and I think that will be enough to get some good output. Probably trying to enter a folder on the LCD controller will also give some useful output.

https://github.com/thinkyhead/Marlin/tree/rc_debug_lsdive_issue_3593

@Blue-Marlin
Copy link
Contributor

Today i tried how folder names with German umlauts behave. I made some folders with Win7 and a card-reader.
I see the same problems. The names show well on the display, but you can't enter the folders. Also M20 can't enter the folders to display their content.
Files with umlauts are well displayed on the lcd but they are not executed.

On the console window (RH) all the umlauts are displayed as '?'.

Error messages before the related folder-names

M20
...
22:56:41.445 : echo:Cannot open subdir
22:56:41.445 : ?TEST
22:56:41.457 : /U-TEST/OKTESTG2.G
22:56:41.457 : echo:Cannot open subdir
22:56:41.458 : M?TEST
22:56:41.462 : echo:Cannot open subdir
22:56:41.462 : M?TEST2
22:56:41.462 : ?123.G
22:56:41.462 : 123?.G
22:56:41.462 : ABC?123.G
22:56:41.467 : End file list

Klick on folder returns to top of folder.

23:02:36.284 : echo:Cannot enter subdir: M?TERST

Klick on file returns to status screen:

22:53:18.825 : echo:enqueueing "M23 abc?123.g"
22:53:18.825 : echo:enqueueing "M24"
22:53:18.882 : echo:Now fresh file: abc?123.g
22:53:18.882 : open failed, File: abc?123.g.

The file listing in Pronterface looks more like:

echo:Cannot open subdir
šTEST
/U-TEST/OKTESTG2.G
echo:Cannot open subdir
MšTEST
echo:Cannot open subdir
MšTERST
š123.G
123š.G
ABCš123.G
End file list

where all 'š' in reality are 'ü'.

In Octoprint the files in folders, and the files in the base directory, with umlauts do not appear in the sd-card filelist.
Even on the console they are filtered out - together with the error messages.

@lintz
I suggest to simply avoid the use of your Scandinavian characters for file or folder names.
For some lucky circumstances Marlin can display the chars correctly, but handling them, for now, is impossible.
Even the hosts all show different (but all wrong) behaviour.

@thinkyhead
The 8.3 filenames seem to be mangled somewhere when opening folders or files. Reading them seems to be ok.

@Blue-Marlin
Copy link
Contributor

SdBaseFile.cpp make83Name()

if (i > n || c < 0X21 || c > 0X7E)goto fail;

As far as i know chars above 0x7f are allowed again.
https://en.wikipedia.org/wiki/8.3_filename

Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

I'll experiment with this tomorrow.

@thinkyhead
Copy link
Member

I look forward to the results. Perhaps the logging branch I linked above can help, as it prints out all the individual bytes.

thinkyhead@f575b77

@Blue-Marlin
Copy link
Contributor

Blue-Marlin commented Apr 29, 2016

Sorry - will last a bit longer. Used all the time this morning for the German translation. Later i searched for proper long file name to 8.3 conversions. What's done in http://elm-chan.org/fsw/ff/00index_e.html looks very complete, but maybe a bit to heavy for us. For now i'm just looking for a 8.3 check, not mangling or refusing, Windows created 8.3-filenames.

- if (i > n || c < 0X21 || c > 0X7E)goto fail;
+ if (i > n || c < 0X21 || c == 0X7F)goto fail;

seems to be enough for now, but needs some more testing.

EDITED two times

Blue-Marlin added a commit to Blue-Marlin/Makaira that referenced this issue Apr 30, 2016
Don't mangel 8.3-filenames with chars > 0x7f

Windows produces 8.3filenames wit chars > 0x7f. Those have been rejected
by Marlin until now.

With these 'malformed' filenames can now be worked with:
In the LCD menue
With RepetierHost (V1.6.1 tested) - full support. Characters are
displayed as '?'
With Octoprint (1.2.10 tested) the files do not appear in the files
area. At the console, listed with M20 they appear with a '�'.
With Pronterface the files appear in the sd-window but you can't start
them. They are mangled by pronterface. The names are altered and than
recected by Marlin. In the console they apper with differen but not the
correct characters.

All in all a little step forward.

Fix for MarlinFirmware#3593
@thinkyhead
Copy link
Member

thinkyhead commented May 2, 2016

All characters (except DEL) are now okay with #3661. Thanks!

nomukaiki pushed a commit to nomukaiki/Marlin that referenced this issue May 4, 2016
Don't mangel 8.3-filenames with chars > 0x7f

Windows produces 8.3filenames wit chars > 0x7f. Those have been rejected
by Marlin until now.

With these 'malformed' filenames can now be worked with:
In the LCD menue
With RepetierHost (V1.6.1 tested) - full support. Characters are
displayed as '?'
With Octoprint (1.2.10 tested) the files do not appear in the files
area. At the console, listed with M20 they appear with a '�'.
With Pronterface the files appear in the sd-window but you can't start
them. They are mangled by pronterface. The names are altered and than
recected by Marlin. In the console they apper with differen but not the
correct characters.

All in all a little step forward.

Fix for MarlinFirmware#3593
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 16, 2016
CONSULitAS pushed a commit to CONSULitAS/Marlin-K8200 that referenced this issue Aug 18, 2016
Don't mangel 8.3-filenames with chars > 0x7f

Windows produces 8.3filenames wit chars > 0x7f. Those have been rejected
by Marlin until now.

With these 'malformed' filenames can now be worked with:
In the LCD menue
With RepetierHost (V1.6.1 tested) - full support. Characters are
displayed as '?'
With Octoprint (1.2.10 tested) the files do not appear in the files
area. At the console, listed with M20 they appear with a '�'.
With Pronterface the files appear in the sd-window but you can't start
them. They are mangled by pronterface. The names are altered and than
recected by Marlin. In the console they apper with differen but not the
correct characters.

All in all a little step forward.

Fix for MarlinFirmware#3593
@github-actions
Copy link

github-actions bot commented Apr 5, 2022

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 Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants