2022-01-18 14:27:59 -08:00
---
2022-03-30 19:00:25 -07:00
id: input-broker-module
title: Input Broker
sidebar_label: Input Broker
2022-01-18 14:27:59 -08:00
---
2022-03-08 23:10:41 -08:00
2022-01-18 14:27:59 -08:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2022-03-30 19:13:30 -07:00
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
2022-01-18 14:27:59 -08:00
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-03-30 19:13:30 -07:00
<PluginModule name="inputbroker_" rename="rotary1_"/>
2022-01-28 14:53:32 -08:00
<!--- TODO add link to hardware setup to admonition--->
2022-03-08 23:10:41 -08:00
2022-01-28 14:53:32 -08:00
:::note
2022-03-08 23:10:41 -08:00
This module requires attaching a peripheral accessory to your device. It will not work without one.
2022-01-28 14:53:32 -08:00
:::
2022-01-18 14:27:59 -08:00
## Overview
Meshtastic supports hardwired rotary encoders as input devices.
Currently, one rotary encoder (`rotary1`) is defined, but later more rotary encoders
can be added (if needed) the same way.
2022-01-28 10:11:19 -08:00
:::tip
2022-03-08 23:10:41 -08:00
Once module settings are changed, a **reset** is required for them to take effect.
2022-01-28 10:11:19 -08:00
:::
2022-01-18 14:27:59 -08:00
## Settings
2022-03-08 23:10:41 -08:00
| Setting | Acceptable Values | Default |
| :-----------------: | :---------------: | :-----------: |
| rotary1_enabled | `true`, `false` | `false` |
| rotary1_event_cw | `InputEventChar` | (not defined) |
| rotary1_event_ccw | `InputEventChar` | (not defined) |
| rotary1_event_press | `InputEventChar` | (not defined) |
| rotary1_pin_a | `integer` | (not defined) |
| rotary1_pin_b | `integer` | (not defined) |
| rotary1_pin_press | `integer` | (not defined) |
2022-01-18 14:27:59 -08:00
### rotary1_enabled
2022-03-08 23:10:41 -08:00
2022-01-18 14:27:59 -08:00
Enable the rotary encoder #1
2022-02-01 17:58:26 -08:00
#### Enable/Disable rotary1
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-04-01 06:34:49 -07:00
```shell title="Enable rotary1"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_enabled true
```
2022-04-01 06:34:49 -07:00
```shell title="Disable rotary1"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_enabled true
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-02-02 11:46:12 -08:00
### rotary1_event_cw
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
Generate input event on CW of this kind.
2022-01-18 14:27:59 -08:00
2022-02-02 11:46:12 -08:00
:::tip
2022-03-08 23:10:41 -08:00
For using with CannedMessageModule you must choose value `KEY_UP` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event cw
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-04-01 06:34:49 -07:00
```shell title="Set rotary1 event cw to 'KEY_UP'"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_press KEY_UP
```
2022-04-01 06:34:49 -07:00
```shell title="Unset rotary1 event cw"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_press ""
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-02-02 11:46:12 -08:00
### rotary1_event_ccw
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
Generate input event on CCW of this kind.
2022-01-18 14:27:59 -08:00
2022-02-02 11:46:12 -08:00
:::tip
2022-03-08 23:10:41 -08:00
For using with CannedMessageModule you must choose value `KEY_DOWN` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event ccw
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-04-01 06:34:49 -07:00
```shell title="Set rotary1 event ccw to 'KEY_DOWN'"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_ccw KEY_DOWN
```
2022-04-01 06:34:49 -07:00
```shell title="Unset rotary1 event ccw"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_ccw ""
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-02-02 11:46:12 -08:00
### rotary1_event_press
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
Generate input event on Press of this kind.
2022-01-18 14:27:59 -08:00
2022-02-02 11:46:12 -08:00
:::tip
2022-03-08 23:10:41 -08:00
For using with CannedMessageModule you must choose value `KEY_SELECT` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event press
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-04-01 06:34:49 -07:00
```shell title="Set rotary1 event press to 'KEY_SELECT'"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_press KEY_SELECT
```
2022-04-01 06:34:49 -07:00
```shell title="Unset rotary1 event press"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_event_press ""
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-02-02 11:46:12 -08:00
### rotary1_pin_a
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
GPIO pin for rotary encoder A port.
2022-02-01 17:58:26 -08:00
2022-02-23 05:29:05 -08:00
:::caution
To prevent damaging your device, double check your device's schematics before attaching to the GPIO pins and setting this value.
:::
2022-02-02 11:46:12 -08:00
#### Specify rotary1 pin a
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-02-01 17:58:26 -08:00
2022-02-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
2022-04-01 06:34:49 -07:00
```shell title="Specify rotary1 pin a"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_pin_a GPIO
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-01-18 14:27:59 -08:00
2022-02-02 11:46:12 -08:00
### rotary1_pin_b
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
GPIO pin for rotary encoder B port.
2022-02-01 17:58:26 -08:00
2022-02-23 05:29:05 -08:00
:::caution
To prevent damaging your device, double check your device's schematics before attaching to the GPIO pins and setting this value.
:::
2022-02-02 11:46:12 -08:00
#### Specify rotary1 pin b
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-02-01 17:58:26 -08:00
2022-02-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
2022-04-01 06:34:49 -07:00
```shell title="Specify rotary1 pin b"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_pin_b GPIO
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-01-18 14:27:59 -08:00
2022-02-02 11:46:12 -08:00
### rotary1_pin_press
2022-03-08 23:10:41 -08:00
2022-02-02 11:46:12 -08:00
GPIO pin for rotary encoder Press port.
2022-02-01 17:58:26 -08:00
2022-02-23 05:29:05 -08:00
:::caution
To prevent damaging your device, double check your device's schematics before attaching to the GPIO pins and setting this value.
:::
2022-02-02 11:46:12 -08:00
#### Specify rotary1 pin press
2022-03-08 23:10:41 -08:00
2022-02-01 17:58:26 -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-02-01 17:58:26 -08:00
2022-02-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
2022-04-01 06:34:49 -07:00
```shell title="Specify rotary1 pin press"
2022-03-08 23:10:41 -08:00
meshtastic --set rotary1_pin_press GPIO
```
2022-02-01 17:58:26 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-02-01 17:58:26 -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.
:::
</TabItem>
</Tabs>
2022-01-18 14:27:59 -08:00
## Details
2022-02-01 17:58:26 -08:00
<!--- TODO add link to hardware page --->
2022-03-08 23:10:41 -08:00
Configuring the rotary encoder module require attaching the compatible hardware.
2022-01-18 14:27:59 -08:00
## Examples
2022-03-08 23:10:41 -08:00
### Configure rotary encoder for Canned Message Module
2022-01-30 18:29:49 -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-30 18:29:49 -08:00
:::note
Replace each `GPIO` (x3) below with the GPIO numbers from hardware setup.
:::
2022-04-01 06:34:49 -07:00
```shell title="Canned Message Module - Required Rotary Encoder Module 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-01-30 18:29:49 -08:00
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07:00
2022-01-30 18:29:49 -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.
:::
</TabItem>
<TabItem value="iOS">
2022-03-31 18:31:13 -07:00
2022-01-30 18:29:49 -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.
:::
</TabItem>
<TabItem value="web">
2022-03-31 18:31:13 -07:00
2022-01-30 18:29:49 -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.
:::
</TabItem>
</Tabs>