# Duet Web Control and Repetier Server Macros

## Baby Stepping - clear (set zero)

```bash
M290 R0 S0 ;clear babystepping
```

## Baby Stepping - Down 0.1 mm

```bash
M290 S-0.1
```

## Show network config

```bash
M552
M540
```

## Change to static IP address (switch mode)

<p class="callout info">This macro makes only sense in Repetier Server!</p>

For Duet of Trikarus we use **169.254.XXX.XXX**. This also could be integrated/replaced in config.g file.

```bash
M552 S0 ;disable network
;M553 P255.255.0.0
M553 P255.255.255.0 ;set netmask
M552 S1 P169.254.XXX.XXX ;set static IP
```

## Change to static IP address (mesh mode)

In mesh mode Duet receives a changing IP by DHCP all the time. But you can also set a static IP address if that IP is free and not conflicting with other devices. It can be a good idea to use IP addresses in **range 10.149.0.2 - 10.149.0.254**. For Duet of Trikarus we use **10.149.YYY.YYY**. This also could be integrated/replaced in config.g file. Please note that hangdevice needs to be in the **same network (e.g. 10.149.YYY.YYY),** otherwise it is not reachable!

<p class="callout info">**At the moment this mode is not used**</p>

```ini
;M552 S0 ;disable network
;M553 P255.255.0.0
;M553 P255.255.255.0 ;set netmask
;M552 S1 P10.149.YYY.YYY ;set static IP
M117 "Not used at the moment. Please use dynamic IP address"
```

## Change to dynamic IP address (mesh mode)

```ini
M552 S0 ;disable network
M552 S1 P0.0.0.0
```

## Allow outbound movements

```ini
M564 S0 H0
```

## Disallow outbound movements

```ini
M564 S1 H0
```

## Enable Smart Steppers

```ini
G0 H2 A0.01
G0 H2 B0.01
G0 H2 C0.01
G0 H2 D0.01
```

## Diagnostics (M122)

```ini
M122
```

## rotaryEncoderTest

```ini
;heat up the nozzle to 205 °C and wait for it
G10 P0 R140 S205
T0
M116

;50 times extrude and retract 5 mm with 60 mm/s
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600

G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600

G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600

G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600

G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
G1 E-5 F3600
G1 E+5 F3600
```

## Turn off Laser Pointers

<p class="callout info">In Repetier Server this works not fine out of the box using the "fan control", so we use a special macro (not required for Duet Web Control).</p>