<p>It seems that the commands are invalid due to improper syntax. The Klipper Documentation site does seem to be a bit confusing. The main list of G-codes can be found on the <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">RepRap wiki</a>.</p>
<p>The site provides the proper usage and examples:</p>
<blockquote>
<p><strong>Usage</strong></p>
<pre><code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn 
G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn
</code></pre>
<p>...</p>
<p><strong>Examples</strong></p>
<pre><code>G0 X12               ; move to 12mm on the X axis  
G0 F1500             ; Set the feedrate to 1500mm/min  
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material
</code></pre>
</blockquote>

CC BY-SA 4.0
2023-10-08T04:47:39.097Z
2023-10-08T04:47:39.097Z
agarza
<p>The provided link shows the correct syntax, the &quot;:&quot; character is not in the Klipper G-code specification and remember the &quot;[&quot; and &quot;]&quot; characters imply that the parameter is optional and &quot;&lt;&quot; and &quot;&gt;&quot; imply: &quot;insert a value here&quot;.</p>
<p>From the documentation:</p>
<blockquote>
<p>Move (<code>G0</code> or <code>G1</code>): <code>G1 [X&lt;pos&gt;] [Y&lt;pos&gt;] [Z&lt;pos&gt;] [E&lt;pos&gt;] [F&lt;speed&gt;]</code></p>
</blockquote>
<p>A valid command would be:</p>
<p><code>G0 X141.000 Y98.000 Z11.090 E0.000</code><sup>1)</sup></p>
<hr />
<p><sup>1)</sup> <em>Note that this is an example based on the provided G-code in the question, the use of the <code>E0.000</code> is not recommended, this can retract the filament all the way from the extruder based on the last position of <code>E</code>. If you want a move to a position, retract first (using a relative positioning of <code>E</code>), then move (using an absolute positioning of <code>X, Y, Z</code>), take a picture, move back and re-retract the same value (using a relative positioning of <code>E</code>).</em></p>

CC BY-SA 4.0
2023-10-10T08:58:46.927Z
2023-10-10T17:07:44.807Z
2023-10-10T17:07:44.807Z
0scar
<p>I have an Elegoo Neptune 4 Pro (love it), and I'm trying to set up a Raspberry Pi with a camera to take a photo every time a layer is complete (to build a time-lapse).</p>
<p>This means I'll have to edit the G-code to move the print head to the X-axis maximum to press a button (shutter release).</p>
<p>I'm using the web interface and would like to know how to get the X-axis position using G-code commands.</p>
<p>I've found <a href="https://www.klipper3d.org/G-Codes.html" rel="nofollow noreferrer">Klipper documentation: G-Codes</a> and have tried to run a few of the commands.</p>
<p><code>M114</code> gives the following line:</p>
<p><code>14:58:56 X:141.000 Y:98.000 Z:11.090 E:0.000</code></p>
<p>However, when I try to send the print head to that location from somewhere else, I get errors.</p>
<pre><code>$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000
!! Unable to parse move 'G0 X:141.000 Y:98.000 Z:11.090 E:0.000'
$ G0 [X:141.000] [Y:98.000] [Z:11.090] [E:0.000]
// Unknown command:&quot;G0 [&quot;
$ G0 [141.000] [98.000] [11.090] [0.000]
// Unknown command:&quot;G0 [141.000] [98.000] [11.090] [0.000]&quot;
$ G0 141.000 98.000 11.090 E:0.000
// Unknown command:&quot;G0 141.000 98.000 11.090&quot;
$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000
</code></pre>
<p>All of these tried with <code>G1</code> as well as <code>G0</code></p>
<p>Based on the error messages, it looks like the first line above is the way to go; But I'm not sure where to go from here.</p>

CC BY-SA 4.0
2023-10-08T03:04:35.737Z
Have you tried sending `G0 X141.000 Y98.000 Z11.090 E0.000`?
agarza
CC BY-SA 4.0
2023-10-10T11:04:50.727Z
`G1 X141 F5000` will send the head to X=141 without touching Y and Z, and do it *fast*. [also, while G0 and G1 can be used pretty much equally, it is "traditional" to use G0 for printing/cutting/work in general, G1 for free movement between work points.]
SF.
<g-code><klipper><elegoo-neptune-4-pro>
How do I move the head?
Jim
# How do I move the head?

(Asked by: username_0 on 2023-10-07)

I have an Elegoo Neptune 4 Pro (love it), and I'm trying to set up a Raspberry Pi with a camera to take a photo every time a layer is complete (to build a time-lapse).
This means I'll have to edit the G-code to move the print head to the X-axis maximum to press a button (shutter release).
I'm using the web interface and would like to know how to get the X-axis position using G-code commands.
I've found Klipper documentation: G-Codes and have tried to run a few of the commands.
M114 gives the following line:
14:58:56 X:141.000 Y:98.000 Z:11.090 E:0.000
However, when I try to send the print head to that location from somewhere else, I get errors.
$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000
!! Unable to parse move 'G0 X:141.000 Y:98.000 Z:11.090 E:0.000'
$ G0 [X:141.000] [Y:98.000] [Z:11.090] [E:0.000]
// Unknown command:"G0 ["
$ G0 [141.000] [98.000] [11.090] [0.000]
// Unknown command:"G0 [141.000] [98.000] [11.090] [0.000]"
$ G0 141.000 98.000 11.090 E:0.000
// Unknown command:"G0 141.000 98.000 11.090"
$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000

All of these tried with G1 as well as G0
Based on the error messages, it looks like the first line above is the way to go; But I'm not sure where to go from here.

**Tags:** g-code, klipper, elegoo-neptune-4-pro
> **Comments:**
> **username_1**: Have you tried sending `G0 X141.000 Y98.000 Z11.090 E0.000`?  
> **username_2**: `G1 X141 F5000` will send the head to X=141 without touching Y and Z, and do it *fast*. [also, while G0 and G1 can be used pretty much equally, it is "traditional" to use G0 for printing/cutting/work in general, G1 for free movement between work points.]  

---

## 2 answers

### Answer by username_1 on 2023-10-08. Score: 3

It seems that the commands are invalid due to improper syntax. The Klipper Documentation site does seem to be a bit confusing. The main list of G-codes can be found on the RepRap wiki.
The site provides the proper usage and examples:

Usage
G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn 
G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn

...
Examples
G0 X12               ; move to 12mm on the X axis  
G0 F1500             ; Set the feedrate to 1500mm/min  
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material


---

### Answer by username_3 on 2023-10-10. Score: 1

The provided link shows the correct syntax, the ":" character is not in the Klipper G-code specification and remember the "[" and "]" characters imply that the parameter is optional and "<" and ">" imply: "insert a value here".

From the documentation:

> Move (`G0` or `G1`): `G1 [X] [Y] [Z] [E] [F]`

A valid command would be:

`G0 X141.000 Y98.000 Z11.090 E0.000`1)

---

1) *Note that this is an example based on the provided G-code in the question, the use of the `E0.000` is not recommended, this can retract the filament all the way from the extruder based on the last position of `E`. If you want a move to a position, retract first (using a relative positioning of `E`), then move (using an absolute positioning of `X, Y, Z`), take a picture, move back and re-retract the same value (using a relative positioning of `E`).*


---

