Merge branch 'master' into master

This commit is contained in:
Ben Meadors 2022-10-13 07:43:03 -05:00 committed by GitHub
commit 435ce296bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 211 additions and 18 deletions

View file

@ -6,22 +6,6 @@ sidebar_label: Channel
## Overview
### What is a Meshtastic Channel?
This is the LoRa channel you're broadcasting on, the modem configuration (spreading factor, bandwidth and error correction), along with a special identifier for your group, and optional encryption.
### What is a LoRa channel?
This is the LoRa frequency within the frequency band your device is configured to use.
### How do I share my Meshtastic Channel with other people?
Your Meshtastic client (Android, Web, or Python) will provide you a URL or QR code. You can email, text or print this URL or QR code and share it with people you want to join your Meshtastic Channel. Note: This feature is not yet available on the iOS app.
### What is a Primary Channel?
This is the first channel that's created for you when you initially setup your Meshtastic Channel.
### What is a Secondary Channel?
As this is a new feature, secondary channels work on the device and the Python Script. Support for secondary channels by other clients is pending.
Your Meshtastic client (Android, Web, or Python) will provide you a URL or QR code. You can email, text or print this URL or QR code and share it with people you want to join your Meshtastic Channel. Note: This feature is not yet available on the iOS app.

View file

@ -0,0 +1,208 @@
---
id: channels
title: Channel Configuration
sidebar_label: Channels
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
The Channels config options are: Index, Roles, and Settings. Channel config uses an admin message sending a `Channel` protobuf which also consists of a `ChannelSettings` protobuf.
:::info
**Channel Settings** (as described on this page) should not be confused with [Modem Preset Settings](/docs/settings/config/lora#modem-preset)
[Modem Preset Settings](/docs/settings/config/lora#modem-preset) contain the modem configuration (frequency settings, spreading factor, bandwidth, etc.) used for the LoRa radio. These settings are identical for all channels and can **not** be unique per channel.
**Channel Settings** contain information for segregating message groups, configuring optional encryption, and enabling or disabling messaging over internet gateways. These settings **are** unique and configurable per channel.
:::
## Channel Config Values
### Index
The channel index begins at 0 and ends at 7.
_Indexing_ can not be modified.
| Index | Channel | Default Role | Purpose |
| :--------------------: | :----------------: | :----------------: | :----------------: |
| 0 | 1 | `PRIMARY` | Used as `default` channel |
| 1 | 2 | `DISABLED` | User defined |
| 2 | 3 | `DISABLED` | User defined |
| 3 | 4 | `DISABLED` | User defined |
| 4 | 5 | `DISABLED` | User defined |
| 5 | 6 | `DISABLED` | User defined |
| 6 | 7 | `DISABLED` | User defined |
| 7 | 8 | `DISABLED` | User defined |
:::note
You can **not** have `DISABLED` channels inbetween active channels such as `PRIMARY` and `SECONDARY`. Active channels must be consecutive.
:::
### Role
Each channel is assigned one of 3 roles:
1. `PRIMARY` or `1`
- This is the first channel that is created for you on initial setup.
- Only one primary channel can exist and can not be disabled.
- Direct messages are only available on this channel.
2. `SECONDARY` or `2`
- Can modify the encryption key (psk).
3. `DISABLED` or `0`
- The channel is no longer available for use.
- The channel settings are set to default.
## Channel Settings Values
The Channel Settings options are: ID, Name, PSK, Downlink Enabled, and Uplink Enabled. Channel settings are embeded in the `Channel` protobuf as a `ChannelSettings` protobuf and sent as an admin message.
:::note
The full globally unique ID will be constructed from the Name and ID (`<name>.<id>`) where ID is base36 encoded. Assuming that the number of Meshtastic users is below 20K (true for a long time) the chance of this 64 bit random number colliding with anyone else is super low. The penalty for collision is low as well.
:::
### ID
Used to construct a globally unique channel ID.
Set to `0` by default.
### Name
A short identifier for the channel. _(< 12 bytes)_
| Reserved Name | Purpose |
| :--------------------: | :----------------: |
| `""` (default) | If left empty on the Primary channel, this designates the `default` channel. |
| `admin` | On Secondary channels, the name `admin` (case sensitive) designates the `admin` channel used to administer nodes over the mesh |
### PSK
The encryption key used for private channels.
Hex byte `0x01` for the Primary `default` channel.
Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
### Downlink Enabled
If enabled, messages captured from a **public** internet gateway will be forwarded to the local mesh.
Set to `false` by default for all channels.
### Uplink Enabled
If enabled, messages from the mesh will be sent to the **public** internet through any node's configured gateway.
Set to `false` by default for all channels.
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'Android', value: 'android'},
{label: 'Apple', value: 'apple'},
{label: 'CLI', value: 'cli'},
{label: 'Flasher', value: 'flasher'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="android">
:::info
All Channel config options are available on Android.
:::
</TabItem>
<TabItem value="apple">
:::info
All Channel config options are available on iOS, iPadOS and macOS.
:::
</TabItem>
<TabItem value="cli">
All Channel config options are available in the python CLI. Example commands are below:
**Id**
```shell title="Set the PRIMARY channel ID"
meshtastic --ch-set id 1234 --ch-index 0
```
**Name**
```shell title="Set channel name for the PRIMARY channel"
# without spaces
meshtastic --ch-set name MyChannel --ch-index 0
# with spaces
meshtastic --ch-set name "My Channel" --ch-index 0
```
**PSK**
If you use Meshtastic for exchanging messages you don't want other people to see, `random` is the setting you should use. Selecting `default` or any of the `simple` values from the following table will use publicly known encryption keys. They're shipped with Meshtastic source code and thus, anyone can listen to messages encrypted by them. They're great for testing and public channels.
| Setting | Behavior |
| :--------------------: | :-----------------------------------------------------------------------------------: |
| `none` | Disable Encryption |
| `default` | Default Encryption (use the weak encryption key) |
| `random` | Generate a secure 256-bit encryption key. Use this setting for private communication. |
| `simple0`- `simple254` | Uses a single byte encoding for encryption |
```shell title="Set encryption to default on PRIMARY channel"
meshtastic --ch-set psk default --ch-index 0
```
```shell title="Set encryption to random on PRIMARY channel"
meshtastic --ch-set psk random --ch-index 0
```
```shell title="Set encryption to single byte on PRIMARY channel"
meshtastic --ch-set psk simple15 --ch-index 0
```
```shell title="Set encryption to your own key on PRIMARY channel"
meshtastic --ch-set psk 0x1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b --ch-index 0
```
```shell title="Disable encryption on PRIMARY channel"
meshtastic --ch-set psk none --ch-index 0
```
**Uplink / Downlink**
For configuring gateways, please see [MQTT](/docs/settings/moduleconfig/mqtt)
```shell title="Enable/Disable Uplink on PRIMARY channel"
meshtastic --ch-set uplink_enabled true --ch-index 0
meshtastic --ch-set uplink_enabled false --ch-index 0
```
```shell title="Enable/Disable Downlink on SECONDARY channel"
meshtastic --ch-set downlink_enabled true --ch-index 1
meshtastic --ch-set downlink_enabled false --ch-index 5
```
</TabItem>
<TabItem value="flasher">
:::info
All Channel config options are available in the Flasher.
:::
</TabItem>
<TabItem value="web">
:::info
All Channel config options are available in the Web UI.
:::
</TabItem>
</Tabs>

View file

@ -10,6 +10,7 @@ There are several config sections in the Meshtastic firmware, these are broken o
| Name | Description |
|:----:|:-----------:|
| [Bluetooth](bluetooth) | Bluetooth config options are: Enabled, Pairing Mode and Fixed PIN. |
| [Channels](channels) | Channels config options are: Index, Role and Settings. |
| [Device](device) | Device config options are: Device Role, Serial Output, Debug Log and Factory Reset. |
| [Display](display) | Display config options are: Screen On Duration, Auto Carousel Interval, Always Point North, and GPS Format. |
| [LoRa](lora) | The LoRa config options are: Region, Modem Preset, Max Hops, Transmit Power, Bandwidth, Spread Factor, Coding Rate, Frequency Offset, Transmit Disabled and Ignore Incoming Array. |

View file

@ -131,7 +131,7 @@ meshtastic --set canned_message.send_bell false
```
```shell title="Set Messages"
meshtastic --set-canned-message "I need an alpinist!|Call Me|Roger Roger|Keep Calm|On my way|"
meshtastic --set-canned-message "I need an alpinist!|Call Me|Roger Roger|Keep Calm|On my way"
```
```shell title="Set Input Source"