2022-01-18 14:27:59 -08:00
---
2022-03-08 23:10:41 -08:00
id: canned-message-module
2022-06-25 00:39:41 -07:00
title: Canned Message Plugin Settings
sidebar_label: Canned Message Plugin
2022-01-18 14:27:59 -08:00
---
2022-04-01 14:07:46 -07:00
2022-01-18 14:27:59 -08:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2022-02-23 05:24:55 -08:00
:::warning
GPIO access is fundamentally dangerous because invalid options can physically damage or destroy your hardware. Ensure that you fully understand the schematic for your particular device before trying this as we do not offer a warranty. Use at your own risk.
:::
2022-01-28 10:05:21 -08:00
:::note
2022-06-25 07:23:48 -07:00
This plugin requires attaching a peripheral accessory to your device. It will not work without one. It also requires use of the [Rotary Encoder](input-broker-module) to configure the input source.
2022-01-28 10:05:21 -08:00
:::
2022-01-18 14:27:59 -08:00
## Overview
2022-06-25 00:39:41 -07:00
The CannedMessage Plugin will allow you to send messages to the mesh network from the device without using the phone app. You can predefine text messages to choose from.
2022-01-18 14:27:59 -08:00
2022-01-28 10:11:19 -08:00
:::tip
2022-06-25 00:39:41 -07:00
Once plugin settings are changed, a **reset** is required for them to take effect.
2022-01-27 20:32:18 -08:00
:::
2022-01-18 14:27:59 -08:00
## Settings
2022-03-08 23:10:41 -08:00
| Setting | Acceptable Values | Default |
| :--------------------------------------: | :---------------: | :-----: |
2022-06-25 00:39:41 -07:00
| canned_message_plugin_allow_input_source | `rotEnc1`, `_any` | `_any` |
| canned_message_plugin_enabled | `true`, `false` | `false` |
| canned_message_plugin_messages | `string` | `""` |
| canned_message_plugin_send_bell | `true`, `false` | `false` |
2022-04-01 14:07:46 -07:00
| (Messages)\* | `string` | `""` |
2022-02-22 01:42:32 -08:00
- Messages can be set with a dedicated option:
`--set-canned-message "<messages>"`
2022-01-18 14:27:59 -08:00
2022-06-25 00:39:41 -07:00
### canned_message_plugin_allow_input_source
2022-01-18 14:27:59 -08:00
2022-06-25 00:39:41 -07:00
Input event source accepted by the canned message plugin.
2022-01-18 14:27:59 -08:00
2022-03-08 23:10:41 -08:00
| Value | Description |
| :-------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `_any` | Default. Allows any peripheral input device connected to the device. |
2022-06-25 00:39:41 -07:00
| `rotEnc1` | Hardcoded value naming the input device that this plugin listens to. This could allow multiple input devices to be named with future software development. At present, this doesn't do anything differently than the default setting. |
2022-02-02 11:46:12 -08:00
#### Set input source
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-01-28 14:02:30 -08:00
2022-04-01 06:34:49 -07:00
```shell title="Set Allowed Input Source"
2022-06-25 00:39:41 -07:00
meshtastic --set canned_message_plugin_allow_input_source "_any"
2022-01-28 14:02:30 -08:00
```
2022-03-08 23:10:41 -08:00
2022-04-01 06:34:49 -07:00
```shell title="Specify Allowed Input Source"
2022-06-25 00:39:41 -07:00
meshtastic --set canned_message_plugin_allow_input_source "rotEnc1"
2022-01-28 14:02:30 -08:00
```
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="android">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="iOS">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="web">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
</Tabs>
2022-06-25 00:39:41 -07:00
### canned_message_plugin_enabled
2022-02-01 17:58:26 -08:00
2022-06-25 00:39:41 -07:00
Enables the plugin.
2022-02-01 17:58:26 -08:00
2022-02-02 11:46:12 -08:00
:::tip
2022-06-25 07:23:48 -07:00
Using the canned message plugin requires you set up the [Rotary Encoder](input-broker-module). See [prerequisites](#prerequisites) below.
2022-02-02 11:46:12 -08:00
:::
2022-03-08 23:10:41 -08:00
2022-06-25 00:39:41 -07:00
#### Enable/Disable the plugin
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-06-25 00:39:41 -07:00
```shell title="Enable Canned Message Plugin"
meshtastic --set canned_message_plugin_enabled true
2022-02-01 17:58:26 -08:00
```
2022-03-08 23:10:41 -08:00
2022-06-25 00:39:41 -07:00
```shell title="Disable Canned Message Plugin"
meshtastic --set canned_message_plugin_enabled false
2022-01-28 14:02:30 -08:00
```
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="android">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="iOS">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="web">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
</Tabs>
2022-06-25 00:39:41 -07:00
### canned_message_plugin_send_bell
2022-02-01 17:58:26 -08:00
2022-06-25 00:39:41 -07:00
CannedMessagePlugin also sends a "bell character" with the messages.
The [External Notification Plugin](external-notification-module) can benefit from this feature as it utilizes the bell character.
2022-02-01 17:58:26 -08:00
2022-06-25 00:39:41 -07:00
_We have an "External Notification Plugin", that can be set up to beep, when new message arrives.
This plugin can also be configured to beep only when message contains the "bell character".
See plugin documentation (link above) for details._
2022-02-01 17:58:26 -08:00
2022-02-22 01:42:32 -08:00
#### Enable/Disable bell character
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-01-28 14:02:30 -08:00
2022-04-01 06:34:49 -07:00
```shell title="Enable Bell Character"
2022-06-25 00:39:41 -07:00
meshtastic --set canned_message_plugin_send_bell true
2022-02-22 01:42:32 -08:00
```
2022-04-01 06:34:49 -07:00
```shell title="Disable Bell Character"
2022-06-25 00:39:41 -07:00
meshtastic --set canned_message_plugin_send_bell false
2022-01-28 14:02:30 -08:00
```
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="android">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="iOS">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="web">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
</Tabs>
2022-02-22 01:42:32 -08:00
### Messages
2022-02-01 17:58:26 -08:00
2022-06-25 00:39:41 -07:00
CLI has a dedicated option for canned message plugin to set predefines messages: `--set-canned-message <message>`
2022-02-22 01:42:32 -08:00
Predefined messages separated by `|` characters.
2022-02-01 17:58:26 -08:00
2022-02-22 01:42:32 -08:00
You can define up to 50 messages with a total length 800 bytes.
Existing configuration can be queried with CLI option: `--get-canned-message`
#### Set canned messages
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
<Tabs
2022-03-08 23:10:41 -08:00
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
2022-01-28 14:02:30 -08:00
2022-04-01 06:34:49 -07:00
```shell title="Set Canned Messages"
2022-06-25 00:39:41 -07:00
meshtastic --set canned_message_plugin_messages "I'm fine|I'm out|I'm back|Need helping hand|Help me with saw|I need an alpinist|I need ambulance|Keep Calm|On my way|I will be late|I'm already waiting|We have company|Beer is cold|Roger"
2022-01-28 14:02:30 -08:00
```
2022-03-08 23:10:41 -08:00
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="android">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="iOS">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
<TabItem value="web">
2022-01-28 14:15:11 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2022-01-28 14:02:30 -08:00
</TabItem>
</Tabs>
2022-02-01 17:58:26 -08:00
## Details
### Prerequisites
<!--- TODO add link to hardware pages to first bullet point --->
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -08:00
- Attach a compatible peripheral device. Take note of the GPIO numbers you use, as they will be used in the following step.
2022-06-25 07:23:48 -07:00
- Once attached, configure peripheral device with [Rotary Encoder](input-broker-module) Settings.
2022-02-01 17:58:26 -08:00
:::note
Replace each `GPIO` (x3) below with the GPIO numbers from hardware setup.
2022-06-25 00:39:41 -07:00
```shell title="Canned Message Plugin - Required Rotary Encoder Settings"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_pin_a GPIO
meshtastic --set rotary1_pin_b GPIO
meshtastic --set rotary1_pin_press GPIO
meshtastic --set rotary1_event_cw KEY_UP
meshtastic --set rotary1_event_ccw KEY_DOWN
meshtastic --set rotary1_event_press KEY_SELECT
meshtastic --set rotary1_enabled True
```
:::
2022-06-25 00:39:41 -07:00
That's it! With a functioning and enabled rotary encoder, you're ready to begin configuring the Canned Message Plugin.