---
tag: m0113
title: Host Keepalive
brief: Get or set the host keepalive interval.
author: thinkyhead

group: hosts
requires: HOST_KEEPALIVE_FEATURE

codes: [ M113 ]

parameters:

- tag: S
  optional: true
  description: Keepalive interval (0-60).
  values:
  - tag: seconds
    type: int

example:
- pre: Set the keepalive interval to 5 seconds
  code: M113 S5

---

During some lengthy processes, such as [`G29`](/docs/gcode/G029.html), Marlin may appear to the host to have "gone away." The "host keepalive" feature will send messages to the host when Marlin is busy or waiting for user response so the host won't try to reconnect.

Send `M113` with no `S` parameter to get the current setting.
