No SD -Card on website

Hmm
I made the modification in the firmware, and the file size removes.

nonow I get this display

Send: M20Recv: Begin file listRecv: /ENDER-3/TEST-D~1.GCO /ENDER-3/47ACB~1.MOD/TEST/TEST-D~1.GCO /TRASHE~1/501/CCR10_~1.GCO /TRASHE~1/501/CCR10_~2.GCO /TRASHE~1/501/CCR10_~3.GCO HOUSIN~1.GCO /DRUCKA~1/ENDER_~1.GCO /DRUCKA~1/ENDER-~1.GCO DIAL_I~1.GCO VENTRI~1.GCO TOOL_H~1.GCO ZERO_D~1.GCO LI~1.GCO EINLAG~1.GCO 608ZZP~1.GCO CABLEC~1.GCO E3-COV~1.GCO FILAME~1.GCO ENDER_~1.GCO PIZERO~1.GCO TRAMMI~1.GCO DECKEL~1.GCO CR-10_~1.GCO VRAIL2~1.GCO End file listRecv: ok[...]Send: M21Recv: echo:SD card okRecv: ok

But no SD card files and Error in WEBgui sdcard not initialisiert.

The old Code:

        case LS_SerialPrint:
    /*      createFilename(filename, p);  
          SERIAL_PROTOCOL(prepend);
          SERIAL_PROTOCOL(filename);
          SERIAL_PROTOCOLCHAR(' ');  
          SERIAL_PROTOCOLLN(p.fileSize);    
          break;
    */      

Is swapped to

createFilename(filename, p);
        SERIAL_PROTOCOL(prepend);
        SERIAL_PROTOCOL(filename);
        MYSERIAL.write(' ');
        //SERIAL_PROTOCOLLN(p.fileSize);  // raus für octoprint
        break;

I'm not seeing any hard returns there. I expect each Recv: to be on its own line.

You might try a version in which instead of:

MYSERIAL.write(' ');

...it's instead:

MYSERIAL.write('\n');

I can't say that I really know Marlin but I'm looking at this code and searching throughout for LS_SerialPrint. I wish I knew what prepend is expected to be. Ah, it's the path on the card.

I'm noting that there's a preprocessor macro SERIAL_ECHOLN() which probably includes a hard return at the end of what's sent (assuming that this indicates the end of a command).

Take note of line 131: #if ENABLED(LONG_FILENAME_HOST_SUPPORT). If it were me, I'd make sure that this is enabled wherever you send in compiler flags. (Long filenames are not supported.)

Ah, wait... here's a SERIAL_EOL; macro which is likely end-of-line.

I Try this Tomorrow
Now the Printer is printing. :slight_smile:

So getting rid of the filesize worked?

OK
Today i test new Firmware settings in Marlin/ Cardreader cpp
now i get this listing.

Send: M21
Recv: echo:SD card ok
Recv: ok
[...]
Send: M20
Recv: Begin file list
Recv: /ENDER-3/TEST-D~1.GCO
Recv: /ENDER-3/47ACB~1.MOD/TEST/TEST-D~1.GCO
Recv: /TRASHE~1/501/CCR10_~1.GCO
Recv: /TRASHE~1/501/CCR10_~2.GCO
Recv: /TRASHE~1/501/CCR10_~3.GCO
Recv: HOUSIN~1.GCO
Recv: /DRUCKA~1/ENDER_~1.GCO
Recv: /DRUCKA~1/ENDER-~1.GCO
Recv: DIAL_I~1.GCO
Recv: VENTRI~1.GCO
Recv: TOOL_H~1.GCO
Recv: ZERO_D~1.GCO
Recv: LI~1.GCO
Recv: EINLAG~1.GCO
Recv: 608ZZP~1.GCO
Recv: CABLEC~1.GCO
Recv: E3-COV~1.GCO
Recv: FILAME~1.GCO
Recv: ENDER_~1.GCO
Recv: PIZERO~1.GCO
Recv: TRAMMI~1.GCO
Recv: DECKEL~1.GCO
Recv: CR-10_~1.GCO
Recv: VRAIL2~1.GCO
Recv: End file list
Recv: ok
[...]

But only in in Terminal.
Webgui do's show the Files on sd card.
and the upload Button is still inactive.

can someone say to me, which format of the files expects octoprint from the SD card?

That would be @foosel who'd know what works here.

So... the Files side panel now DOES show the files on your SD, yes? Can they be selected? So modifying your Marlin as suggested worked?


So separate issue, when you've selected the SD card icon then the Upload button is grayed out, if I'm understanding you correctly.

It seems that the MK3 firmware works quite different/faulty than that one for MK2S concerning the SD card.

@Ewald_Ikemann He was printing yesterday. It sounds like by recompiling/uploading an edited Marlin we got something going.

1 Like

You don't simply happen to have the "Local files only" filter active?

image

The list format on first glance looks fine (both with and without file size should work).

Completely simply, the printer printing even, there has the software to wait with upload and test.:slight_smile:
I take now the Marlin as project. Insert a I2C support for filament sensor and the like.
Still much must read around the code to understand. Are new on Marlln .

Nein. der Filter ist auf alles und mehrfach überprüft.
im sideboerd erfasst octoprint die Daten der SD Karte nicht. über das Therminal kann ich die Daten lesen. Über M20 und 21.

[no filter set, files still not showing up in the list]

Then I don't have an idea right now and a full serial.log of the whole communication is needed I fear.

unfortunately not today .der printer prints a long job of SD card. without Octoprint. there I would not like to connect

But you can say which exact data format your Web property to me expected? I am to be adapted besides thereby the Marlin for my needs.

@foosel can you take a look at what's returned by the M20 above? Werner would like to know if that's okay.

@wernerH When your print job is finished, please turn on the serial log, again try to select your SD card and then give us the created serial log. (Thanks.)

^- :wink:

To elaborate on this a bit more, OctoPrint expects file lists from the printer like this:

Begin file list
file1[ size1]
file2[ size2]
...
End file list

So, file size is supported, but optional. File name is supposed to be the file name in 8.3 DOS format, so no whitespaces and ASCII characters only (like all of the communication). If a size is included, it's separated by whitespace and an integer value signifying the size in bytes.

The file listing in the excerpt

Send: M20
Recv: Begin file list
Recv: /ENDER-3/TEST-D~1.GCO 16902701
Recv: /ENDER-3/47ACB~1.MOD/TEST/TEST-D~1.GCO 16902701
Recv: /TRASHE~1/501/CCR10_~1.GCO 2814031
Recv: /TRASHE~1/501/CCR10_~2.GCO 2542570
Recv: /TRASHE~1/501/CCR10_~3.GCO 1773076
Recv: HOUSIN~1.GCO 3676934
Recv: /DRUCKA~1/ENDER_~1.GCO 2583557
Recv: /DRUCKA~1/ENDER-~1.GCO 1421749
Recv: DIAL_I~1.GCO 4701906
Recv: VENTRI~1.GCO 2482277
Recv: TOOL_H~1.GCO 5539180
Recv: ZERO_D~1.GCO 6062417
Recv: LI~1.GCO 930320
Recv: EINLAG~1.GCO 898596
Recv: 608ZZP~1.GCO 2066765
Recv: CABLEC~1.GCO 433879
Recv: E3-COV~1.GCO 4409977
Recv: FILAME~1.GCO 684949
Recv: ENDER_~1.GCO 945825
Recv: PIZERO~1.GCO 1921842
Recv: TRAMMI~1.GCO 17631135
Recv: DECKEL~1.GCO 1440948
Recv: End file list
Recv: ok

looks valid, which is why I asked for serial.log (and ideally also octoprint.log) since that might give more clues as to why it's not being used to populate the file list.

I just saw the serial.log a couple posts up there, and what I noticed in there is that OctoPrint sent an M21 but then when it got the message that the SD card was initialized properly it didn't automatically send an M20. And that makes it feel like for some reason it didn't parse the SD card ok message properly and hence didn't even detect that the printer has a card.

Easy way to check: when you click the SD card menu on the file list, does it offer to initialize the card, or does it offer to refresh the files or eject it?

image

If the former, it doesn't properly parse the SD card ok message. It should actually not be prefixed by an echo: but just be on its own line (example from the virtual printer):

Changing monitoring state from "Opening serial port" to "Connecting"
Recv: start
Send: N0 M110 N0*125
Recv: Marlin: Virtual Marlin!
Recv: �
Send: N0 M110 N0*125
Recv: SD card ok
Recv: ok N0
Changing monitoring state from "Connecting" to "Operational"
Send: N0 M110 N0*125
Recv: ok N0
Send: N1 M115*39
Recv: ok N0
Send: N2 M20*19
Recv: FIRMWARE_NAME:Virtual Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3 EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000
Recv: ok N1
Recv: Begin file list
Recv: 20MM-B~1.GCO
Recv: 20MM-B~2.GCO
Recv: 20MM_C~1.GCO
Recv: CONFIG.TXT
Recv: HEATUP~1.GCO
Recv: ONLY_HOME_TXT.TXT
Recv: ONLY_H~1.GCO
Recv: PRUSAT~1.GCO
Recv: TEST20~1.GCO
Recv: TESTON~1.GCO
Recv: TRISPI~1.GCO
Recv: End file list
Recv: ok N2

The way the parser here works though should still see it regardless, and a quick test (changing the virtual printer to report it with the echo: prefix) also shows everything works as expected.

In general, things work like this:

  • OctoPrint connects to printer
  • OctoPrint issues an M21 (unless the printer has already reported SD card ok on its own)
  • Once SD card ok is received OctoPrint issues an M20
  • OctoPrint sees Begin file list and switches to file list parsing mode
  • Unless received line is End file list, OctoPrint splits it on whitespace. First (only?) entry is file name. If there's a second it tries to parse that as file size
  • OctoPrint sees End file list, switches out of file list parsing mode and signals that a new list was received to the system
  • The UI refreshes the file list in the frontend

Thanks for Answer
i set up my Marlin SD Card Fileformat to DOS 8.3. I removed the file size.

To Serial print.

I can cancel that again

here the octoprint log.

@wernerH, looks like you forgot to include the file