<p>You can send the G Codes to select and print a file over the serial connection. </p>

<ul>
<li>List the files

<blockquote>
  <p>M20</p>
</blockquote></li>
<li>Select a file name

<blockquote>
  <p>M23 filename.gco</p>
</blockquote></li>
<li>Start/Resue the print

<blockquote>
  <p>M24</p>
</blockquote></li>
</ul>

<p>See <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">https://reprap.org/wiki/G-code</a> for more information M20 through M39 are the ones for interfacing with SD Card files.</p>

CC BY-SA 4.0
2018-10-08T22:25:39.203Z
2018-10-08T22:25:39.203Z
JasonT Tech
<p>I'm doing a project for college connecting an app made with app inventor to a Raspberry Pi and then using the RPi to make a printing queue for a Prusa P3 Steel. </p>

<p>The thing is that I already have the comm between the app and the RPi but I need to connect the RPi to the Arduino via USB and select the G-code files that are in the SD card of the Prusa to print. I don't know where should I put the function in the Marlin code or how to manage the serial port read function. </p>

<p>Any ideas?  </p>

CC BY-SA 4.0
2018-10-09T17:49:31.123Z
Just out of interest: Are you using [MIT App Inventor](http://appinventor.mit.edu/explore/) for iOS or [App Inventor](http://www.appinventor.org/) for Android?
Greenonline
CC BY-SA 3.0
2017-12-27T13:30:11.830Z
why don't you connect the prusa via USB to the Rpi? That way you can feed the G-code directly and keep the queue on the Pi.
Hacky
<marlin><g-code><prusa-i3-rework>
Selecting G-code files from SD with serial
Pablo Elías Viejo
# Selecting G-code files from SD with serial

(Asked by: username_0 on 2017-12-25)

I'm doing a project for college connecting an app made with app inventor to a Raspberry Pi and then using the RPi to make a printing queue for a Prusa P3 Steel.

The thing is that I already have the comm between the app and the RPi but I need to connect the RPi to the Arduino via USB and select the G-code files that are in the SD card of the Prusa to print. I don't know where should I put the function in the Marlin code or how to manage the serial port read function.

Any ideas?

**Tags:** marlin, g-code, prusa-i3-rework
> **Comments:**
> **username_2**: why don't you connect the prusa via USB to the Rpi? That way you can feed the G-code directly and keep the queue on the Pi.  
> **username_1**: Just out of interest: Are you using [MIT App Inventor](http://appinventor.mit.edu/explore/) for iOS or [App Inventor](http://www.appinventor.org/) for Android?  

---

## 1 answers

### Answer by username_3 on 2018-10-08. Score: 4

You can send the G Codes to select and print a file over the serial connection.

* List the files
  > M20
* Select a file name
  > M23 filename.gco
* Start/Resue the print
  > M24

See <https://reprap.org/wiki/G-code> for more information M20 through M39 are the ones for interfacing with SD Card files.


---

