meshtastic/docs/settings/input-broker-module.md

470 lines
11 KiB
Markdown
Raw Normal View History

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-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-01-28 14:53:32 -08:00
:::note
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
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
| 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-01-18 14:27:59 -08:00
Enable the rotary encoder #1
#### Enable/Disable rotary1
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Enable rotary1"
meshtastic --set rotary1_enabled true
```
```bash title="Disable rotary1"
meshtastic --set rotary1_enabled true
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-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
For using with CannedMessageModule you must choose value `KEY_UP` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event cw
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Set rotary1 event cw to 'KEY_UP'"
meshtastic --set rotary1_event_press KEY_UP
```
```bash title="Unset rotary1 event cw"
meshtastic --set rotary1_event_press ""
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-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
For using with CannedMessageModule you must choose value `KEY_DOWN` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event ccw
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Set rotary1 event ccw to 'KEY_DOWN'"
meshtastic --set rotary1_event_ccw KEY_DOWN
```
```bash title="Unset rotary1 event ccw"
meshtastic --set rotary1_event_ccw ""
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-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
For using with CannedMessageModule you must choose value `KEY_SELECT` here.
2022-02-02 11:46:12 -08:00
:::
#### Specify rotary1 event press
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Set rotary1 event press to 'KEY_SELECT'"
meshtastic --set rotary1_event_press KEY_SELECT
```
```bash title="Unset rotary1 event press"
meshtastic --set rotary1_event_press ""
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-02-02 11:46:12 -08:00
GPIO pin for rotary encoder A port.
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
<Tabs
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-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
```bash title="Specify rotary1 pin a"
meshtastic --set rotary1_pin_a GPIO
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-02-02 11:46:12 -08:00
GPIO pin for rotary encoder B port.
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
<Tabs
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-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
```bash title="Specify rotary1 pin b"
meshtastic --set rotary1_pin_b GPIO
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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-02-02 11:46:12 -08:00
GPIO pin for rotary encoder Press port.
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
<Tabs
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-02 11:46:12 -08:00
:::note
Replace `GPIO` below with the GPIO number from hardware setup.
:::
```bash title="Specify rotary1 pin press"
meshtastic --set rotary1_pin_press GPIO
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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
<!--- TODO add link to hardware page --->
Configuring the rotary encoder module require attaching the compatible hardware.
2022-01-18 14:27:59 -08:00
## Examples
### Configure rotary encoder for Canned Message Module
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
:::note
Replace each `GPIO` (x3) below with the GPIO numbers from hardware setup.
:::
```bash title="Canned Message Module - Required Rotary Encoder Module Settings"
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
```
</TabItem>
<TabItem value="android">
2022-03-31 18:31:13 -07: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
:::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
:::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>