# G Code for Bed Level Visualizer

**URL:** <https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953>\
**Category:** Snapmaker 2.0 (3-in-1)\
**Created:** [November 28, 2020, 12:07pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953 "2020-11-28T12:07:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JerryVienna](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@JerryVienna](https://forum.snapmaker.com/u/JerryVienna)\
**Post date:** [November 28, 2020, 12:07pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/1 "2020-11-28T12:07:01Z")

</div>

Hi,  
Octoprint has this great plug-in to visualize the bed [Bed Level Visualizer](https://github.com/jneilliii/OctoPrint-BedLevelVisualizer) but it requires the printer to provide the information. What G Code can I use?

Marlin uses G29 T, Prusa G80, G81,…

---

<div class="post-metadata">

**Author:** ![brent113](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/brent113/32/11114_2.png) [@brent113](https://forum.snapmaker.com/u/brent113)\
**Post date:** [November 28, 2020, 8:16pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/2 "2020-11-28T20:16:10Z")

</div>

M420 V will output the mesh. [https://marlinfw.org/docs/gcode/M420.html](https://marlinfw.org/docs/gcode/M420.html)

---

<div class="post-metadata">

**Author:** ![JerryVienna](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@JerryVienna](https://forum.snapmaker.com/u/JerryVienna)\
**Post date:** [November 30, 2020, 12:42pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/3 "2020-11-30T12:42:38Z")

</div>

Thanks, will try after the current print is finished

---

<div class="post-metadata">

**Author:** ![Loki1969](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/loki1969/32/4863_2.png) [@Loki1969](https://forum.snapmaker.com/u/Loki1969)\
**Post date:** [February 10, 2021, 8:26pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/4 "2021-02-10T20:26:59Z")

</div>

Hi! Please, can you show me the GCode you use? I have no idea about GCode.

---

<div class="post-metadata">

**Author:** ![avacado](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@avacado](https://forum.snapmaker.com/u/avacado)\
**Post date:** [February 14, 2021, 3:02am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/5 "2021-02-14T03:02:51Z")

</div>

In the plugin config:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/f/f58c3118a0af2518c24a246548a10f61b8895f90.png)

---

<div class="post-metadata">

**Author:** ![stefix](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/stefix/32/8616_2.png) [@stefix](https://forum.snapmaker.com/u/stefix)\
**Post date:** [February 14, 2021, 7:02am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/6 "2021-02-14T07:02:40Z")

</div>

Or:  
G1029P7 ;Grid 3x3 5x5 11x11  
G1029A ;leveling;  
G1029S ;save data;  
G1029D0 ;end leveling  
M420V ;get data  
G28

---

<div class="post-metadata">

**Author:** ![Loki1969](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/loki1969/32/4863_2.png) [@Loki1969](https://forum.snapmaker.com/u/Loki1969)\
**Post date:** [February 15, 2021, 8:16am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/7 "2021-02-15T08:16:04Z")

</div>

Thank you for the parameters!

---

<div class="post-metadata">

**Author:** ![hlmilk](https://avatars.discourse-cdn.com/v4/letter/h/b9bd4f/32.png) [@hlmilk](https://forum.snapmaker.com/u/hlmilk)\
**Post date:** [February 16, 2021, 2:49pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/8 "2021-02-16T14:49:07Z")

</div>

These would only save the data calibrate from the sensor right? Distance between sensor and bed.  
What about the data offset of the distance between the nozzle and bed? Like the last part of auto-calibration

---

<div class="post-metadata">

**Author:** ![avacado](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@avacado](https://forum.snapmaker.com/u/avacado)\
**Post date:** [February 17, 2021, 6:58pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/9 "2021-02-17T18:58:09Z")

</div>

> [@stefix](#):
>
> Or:  
> G1029P7 ;Grid 3x3 5x5 11x11  
> G1029A ;leveling;  
> —\>\>\> This is where you would normally set the Z-Offset  
> G1029S ;save data;  
> G1029D0 ;end leveling  
> M420V ;get data  
> G28

The M420V command will read the mesh for the Octoprint bed level visualizer, the G1029 codes are to run the automatic bed level.

---

<div class="post-metadata">

**Author:** ![nivekmai](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/nivekmai/32/15480_2.png) [@nivekmai](https://forum.snapmaker.com/u/nivekmai)\
**Post date:** [February 21, 2021, 5:33am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/10 "2021-02-21T05:33:17Z")

</div>

Just to clarify for anyone coming here later:

All you actually need to put into GCODE section is the M command to get the data out:

```auto
M420 V

```

If you’re not seeing any output, it’s probably that the output is outside of the graph range (defaults to -2,2), switch over to the terminal command and check the output of the `M420 V` command and make sure that your graph bounds are set to include it.

Example, all my values are in the 7 range, so I didn’t see anything in the graph:

```auto
Recv: Bilinear Leveling Grid:
Recv: 0 1 2 3 4 5 6
Recv: 0 +7.191 +7.314 +7.470 +7.520 +7.534 +7.465 +7.476
Recv: 1 +7.451 +7.544 +7.670 +7.675 +7.734 +7.705 +7.589
Recv: 2 +7.330 +7.440 +7.525 +7.558 +7.629 +7.632 +7.567
Recv: 3 +7.277 +7.409 +7.474 +7.452 +7.531 +7.587 +7.520
Recv: 4 +7.228 +7.308 +7.349 +7.345 +7.412 +7.461 +7.454
Recv: 5 +7.218 +7.250 +7.332 +7.277 +7.347 +7.372 +7.349
Recv: 6 +7.150 +7.079 +7.142 +7.086 +7.126 +7.124 +7.169

```

I had to go and set Graph Z-Limits to be able to show my graph:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/b/b47bbd75ffd32f5c85f7afbb14cc5eb442bcf76d.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/d/d542787a0b6585f668fd59e7ecb829556d9c4add.jpeg)

---

<div class="post-metadata">

**Author:** ![brvdboss](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@brvdboss](https://forum.snapmaker.com/u/brvdboss)\
**Post date:** [February 21, 2021, 6:43am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/11 "2021-02-21T06:43:38Z")

</div>

Or you can check the box “use relative z-offsets”

---

<div class="post-metadata">

**Author:** ![irawans](https://avatars.discourse-cdn.com/v4/letter/i/ad7895/32.png) [@irawans](https://forum.snapmaker.com/u/irawans)\
**Post date:** [February 22, 2021, 12:55pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/12 "2021-02-22T12:55:53Z")

</div>

Does anyone know why after running the Bed Visualizer I’ve got only message “Please wait, retrieving current mesh.”

---

<div class="post-metadata">

**Author:** ![brvdboss](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@brvdboss](https://forum.snapmaker.com/u/brvdboss)\
**Post date:** [February 22, 2021, 1:31pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/13 "2021-02-22T13:31:14Z")

</div>

What do your settings look like?  
Do you have a thicker than normal bed? (for example, do you have a glass bed on top, printbed on top of cnc bed etc)

(Nobody here has a crystal ball, you should always try and provide as much background info as possible)

---

<div class="post-metadata">

**Author:** ![stefix](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/stefix/32/8616_2.png) [@stefix](https://forum.snapmaker.com/u/stefix)\
**Post date:** [February 22, 2021, 2:34pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/14 "2021-02-22T14:34:46Z")

</div>

Looks like your bed is out of range od BV. Test -5.0,5 or somthing like that.  
Are you using the latest Version ov BV? What says the octoprint forum?

---

<div class="post-metadata">

**Author:** ![irawans](https://avatars.discourse-cdn.com/v4/letter/i/ad7895/32.png) [@irawans](https://forum.snapmaker.com/u/irawans)\
**Post date:** [February 22, 2021, 10:22pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/15 "2021-02-22T22:22:08Z")

</div>

I am using the “Nylon locknut” method so the bed is thicker (about 5-6mm) and the bed is on top the platform (I got not flat platform). Looking at M420V, I set the Graph Z-limits to 15.2, and Use Relative Z Offsets (ticked) I waited the graph until it is time out.

 ![Screen Shot 2021-02-23 at 09.18.44](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/3/36f266705468f6ac8762365525fc353c58ce2283.png)  
 ![Screen Shot 2021-02-23 at 09.13.15](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/5/53a2de2a97a0e3afa168ad801cf874235a2e6529.png)  
 ![Screen Shot 2021-02-23 at 09.18.57](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/f/ff297922f8bce112d66f6d5a098be9f5f3e97018.png)

---

<div class="post-metadata">

**Author:** ![irawans](https://avatars.discourse-cdn.com/v4/letter/i/ad7895/32.png) [@irawans](https://forum.snapmaker.com/u/irawans)\
**Post date:** [February 22, 2021, 10:46pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/16 "2021-02-22T22:46:51Z")

</div>

Then after about 30 minutes:

![Screen Shot 2021-02-23 at 09.44.44](https://us1.discourse-cdn.com/flex022/uploads/snapmaker/original/2X/d/da7ca738f7da51bb10937eca33280faeb90dc2ad.png)

---

<div class="post-metadata">

**Author:** ![brvdboss](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@brvdboss](https://forum.snapmaker.com/u/brvdboss)\
**Post date:** [February 23, 2021, 6:33am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/17 "2021-02-23T06:33:22Z")

</div>

> [@irawans](#):
>
> I am using the “Nylon locknut” method so the bed is thicker (about 5-6mm)

Then you need to install the last release candidate of the plugin. There previous version didn’t support double digit offsets. As you are at 14+mm the current version doesn’t work.

Go to the plugin manager and there is a drop down that allows you to select the release candidate in stead of the stable version.

---

<div class="post-metadata">

**Author:** ![brvdboss](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@brvdboss](https://forum.snapmaker.com/u/brvdboss)\
**Post date:** [February 23, 2021, 7:03am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/18 "2021-02-23T07:03:10Z")

</div>

> [@irawans](#):
>
> Graph Z-limits to 15.2

This doesn’t do what you think. If you use relative z-offsets you should enter something like “- 1,1”. That means the graph will show the 2mm around your height.  
So if your origin is at 15, the z-axis shows the range 14-16.

The default value is - 2,2.(if you leave it empty)

---

<div class="post-metadata">

**Author:** ![irawans](https://avatars.discourse-cdn.com/v4/letter/i/ad7895/32.png) [@irawans](https://forum.snapmaker.com/u/irawans)\
**Post date:** [February 23, 2021, 8:45pm UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/19 "2021-02-23T20:45:43Z")

</div>

Thank you so much for all the information. It Works now…  
Really appreciate it, thanks 🙏🏻

---

<div class="post-metadata">

**Author:** ![Edwin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/edwin/32/13481_2.png) [@Edwin](https://forum.snapmaker.com/u/Edwin)\
**Post date:** [February 24, 2021, 8:31am UTC](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953/20 "2021-02-24T08:31:09Z")

</div>

> [@nivekmai](#):
>
> `M420 V`

Some G-code commands for Snapmaker 2.0.

M502  
M500 //M502&M500 Restore Factory Defaults  
M2000 S0 //M200 S0 Controller Status  
M1999 //M1999 Reboot Log  
M1005 //M1005 Firmware Info  
M420 V //M420 V Bed Leveling Data  
M119 //M119 Limit&Proximity Switch Status  
M503 //M503 Controller Settings  
M1006 //M1006 Toolhead Status  
M1007 //M1007 Origin Info

[Next page](https://forum.snapmaker.com/t/g-code-for-bed-level-visualizer/11953.md?page=2)
