# Alert + Heartbeat Mode

Send prioritized messages on every click and check network availability at regular intervals.

The **Alert + Heartbeat** mode limits the supported click types in order to prioritize sending a message when the built-in button is clicked, disables the ability to accidentally cancel messages to ensure messages are delivered, and also sends an additional message at regular intervals indicating that the button is still able to connect. In addition, the button can be configured to remain connected for a brief period in order to send additional messages without reconnecting to the network.

## Configuration

> [!NOTE]
>
> The **Alert + Heartbeat** mode is available only for buttons with firmware version 3134 or later. Buttons with an earlier firmware version will ignore these settings and continue operating in their current operation mode.

To configure your button for **Alert + Heartbeat** mode:

1. Follow the [Configuration](https://docs.soracom.io/en/devices/soracom-lte-m-button/configuration#configuring-a-group) instructions for configuring **Soracom LTE-M Button settings**.

2. Select the **Alert + Heartbeat** mode option:

   ![Selecting the Alert mode](https://docs.soracom.io/_astro/01-group-button-settings-alert-heartbeat.DBt2exGY_Z1OSW9z.webp)

   You can configure the following options for **Alert** mode:

   - **Uplink frequency** - The frequency to send [Heartbeat messages](https://docs.soracom.io/en/devices/soracom-lte-m-button/message-examples#heartbeat-message).

   - **Auto sync** - For buttons with firmware version 3134 or later, automatically sync once a day.

   - **External I/O mode** - Configure the external I/O accessory port:

     - **Disabled**
     - [Edge Detection](https://docs.soracom.io/en/devices/soracom-lte-m-button/io-modes/edge-detection)
     - [Pulse Detection](https://docs.soracom.io/en/devices/soracom-lte-m-button/io-modes/pulse-detection)

   - **Enable debounce** - Enables debouncing for Edge Detection and Pulse Detection external I/O modes to reduce false triggers.

After configuring **Soracom LTE-M Button settings**, follow the [instructions to sync your button](https://docs.soracom.io/en/devices/soracom-lte-m-button/configuration#syncing-button-settings).

## Messages

When the Soracom LTE-M Button operation mode is configured as **Alert + Heartbeat**, the button will send the following types of messages:

- [Alert message](https://docs.soracom.io/en/devices/soracom-lte-m-button/message-examples#alert-message), indicating the type of event that triggered the message
- [Heartbeat message](https://docs.soracom.io/en/devices/soracom-lte-m-button/message-examples#heartbeat-message), reporting the current status of the button
- [Status message](https://docs.soracom.io/en/devices/soracom-lte-m-button/message-examples#status-message), reporting the current status and configuration of the button

## Behavior

**Firmware 3134**

| Input | Action | External I/O mode | External I/O mode | External I/O mode | External I/O mode |
| - | - | - | - | - | - |
| Input | Action | Disabled | [Edge Detection](https://docs.soracom.io/en/devices/soracom-lte-m-button/io-modes/edge-detection) | [Pulse Detection](https://docs.soracom.io/en/devices/soracom-lte-m-button/io-modes/pulse-detection) | [Temperature Sensor](https://docs.soracom.io/en/devices/soracom-lte-m-button/io-modes/temperature-sensor) |
| Built-in button | Single short click\*1 | - LED blinks one short orange blink: :blink\[orange:.] - Sends an **Alert message** with detect type `Single short click` | - LED blinks one short orange blink: :blink\[orange:.] - Sends an **Alert message** with detect type `Single short click` | - LED blinks one short orange blink: :blink\[orange:.] - Sends an **Alert message** with detect type `Single short click` | |
| Built-in button | Double short click | | | | |
| Built-in button | Single long click | | | | |
| Built-in button | Extra long click | - LED blinks three short green blinks: :blink\[. . .] - Sends a **Status message** to report the current status and configuration | - LED blinks three short green blinks: :blink\[. . .] - Sends a **Status message** to report the current status and configuration | - LED blinks three short green blinks: :blink\[. . .] - Sends a **Status message** to report the current status and configuration | |
| 2-wire accessory | Connected\*1 | | - LED blinks one short orange blink: :blink\[orange:.] - Sends an **Alert message** with detect type `Falling edge` | - Starts a timer and waits for the wire to disconnect | |
| 2-wire accessory | Disconnected\*1 | | - LED blinks one short orange blink: :blink\[orange:.] - Sends an **Alert message** with detect type `Rising edge` | - Calculates the timer and performs the same action as the built-in button | |
| Internal timer | Uplink frequency\*2 | - Sends a **Heartbeat message** to report the current status | - Sends a **Heartbeat message** to report the current status | - Sends a **Heartbeat message** to report the current status | |
| Internal timer | Every 24 hours | - If Auto sync is enabled, sends a **Status message** to report the current status and configuration | - If Auto sync is enabled, sends a **Status message** to report the current status and configuration | - If Auto sync is enabled, sends a **Status message** to report the current status and configuration | |

1. If the **Network standby** option is enabled, the button will stay connected to the network for the configured number of seconds in order to send additional Alert messages without reconnecting, and will automatically disconnect once all message have been sent.
2. The **Uplink frequency** is specified when configuring the operation mode as Alert + Heartbeat.

### LED Indicator

While the button is sending an **Alert message**, **Heartbeat message**, or **Status message**, the LED will blink to indicate the progress:

| LED blink pattern | Description | Progress |
| - | - | - |
| ☀──☀──☀── (repeating) | Slow green blinking | The button is connecting to a network |
| ☀☀☀☀ (repeating) | Fast green blinking | The button has connected and is sending the message |
| ☀──────── | Extra long green blink | The button successfully sent the message |
| ☀──────── | Extra long red blink | An error occurred |

If the button has trouble sending a message, it will try one more time before giving up. For more information, refer to the [Troubleshooting](https://docs.soracom.io/en/devices/soracom-lte-m-button/troubleshooting) section.

Refer to the [LED Reference](https://docs.soracom.io/en/devices/soracom-lte-m-button/led-reference) for descriptions of additional indicators.

### Additional Messages

If the built-in button is clicked or the external I/O is triggered while the button is sending an **Alert message**, the button will send another **Alert message** for each additional click or trigger it detects.
