# Klipper Setup

<mark style="color:purple;">Last Updated: December 7th 2024</mark>

## Installation of the Cartographer Klipper Module

Clone the Klipper module from GitHub using the following commands, you then need to run our installation script.

```bash
cd ~
git clone https://github.com/Cartographer3D/cartographer-klipper.git
./cartographer-klipper/install.sh
```

This step will automatically create a link to the script and place it in the klipper/klippy/extra directory.

{% hint style="info" %}
If you are in Mainland China, use the following commands instead:

```bash
cd ~
git clone https://gitee.com/NBTP/cartographer-klipper.git
./cartographer-klipper/install.sh
```

{% endhint %}

### Remember to update cartographer via the mainsail/fluidd UI

{% hint style="warning" %}
Legacy Klipper environements running on Python2 will need updating to Python 3.9 or later. The easiest way to do that is a complete fresh install, though we do have a guide that can help that is linked [here  ](https://docs.cartographer3d.com/cartographer-probe/troubleshooting#klipper-environement-running-on-python-2)
{% endhint %}

## Managing Updates via Moonraker

In order to keep up to date with our latest Klipper software, please add the following config to the bottom of your `moonraker.conf` file.

```yaml
[update_manager cartographer]
type: git_repo
path: ~/cartographer-klipper
channel: stable
origin: https://github.com/Cartographer3D/cartographer-klipper.git
is_system_service: False
managed_services: klipper
info_tags:
  desc=Cartographer Probe
```

{% hint style="info" %}
**Are you from Mainland China?**\
\
Use this alternate moonraker.conf instead.

```yaml
[update_manager cartographer]
type: git_repo
path: ~/cartographer-klipper
channel: stable
origin: https://gitee.com/NBTP/cartographer-klipper.git
is_system_service: False
managed_services: klipper
info_tags:
  desc=Cartographer Probe (Gitee)
```

{% endhint %}

upon completion, press SAVE & RESTART and it should now display in the update section of either Mainsail or Fluidd.&#x20;

<figure><img src="/files/tvd5qinaHHUMxDXGLqGe" alt=""><figcaption><p>Cartographer Software updates managed via Moonraker.</p></figcaption></figure>

If you get "Repo is dirty. Detected the following modified files: \['install.sh']", a soft Recovery should fix it.&#x20;

<figure><img src="/files/bzdQ8NAWbZk0Oknct5sJ" alt=""><figcaption></figcaption></figure>

## Finding the Serial or UUID

Note, you need to replace the serial path  or UUID with your probes serial path or UUID, this can be found by running the following commands&#x20;

For USB based probes&#x20;

```bash
ls /dev/serial/by-id/
```

For CAN based probes

{% hint style="info" %}
If you order a CAN Probe it will have it's baud rate set at 1,000,000. Make sure your system matches that.&#x20;
{% endhint %}

```bash
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
```

Take note of either the Serial ID or the UUID.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cartographer3d.com/original-plugin/installation/klipper-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
