Back to the Gcode Dictionary
M39: Report SD card information
Supported in ReprapFirmware 1.21 and later.
- Pn SD slot number, default 0
- Sn Response format. S0 returns a plain text response, S2 returns a response in JSON format.
- M39 ; report information for SD card 0 in plain text format
- M39 P1 S2 ; report information for SD card 1 in JSON format
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:
- Whether or not a usable card is present in the slot
- The capacity of the card in bytes (if a card is present)
- The amount of free space on the card in bytes (if a card is present)
The JSON response has the following format (this is provisional):
The capacity and free space are in bytes and the interface speed is in bytes/second.