2022-10-10 10:57:39 -07:00
---
id: channels
title: Channel Configuration
sidebar_label: Channels
---
2023-01-19 05:01:57 -08:00
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
2022-10-10 10:57:39 -07:00
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
2023-09-28 19:10:42 -07:00
**Channel Settings** (as described on this page) should not be confused with [Modem Preset Settings](/docs/configuration/radio/lora#modem-preset)
2022-10-10 10:57:39 -07:00
2023-09-28 19:10:42 -07:00
[Modem Preset Settings](/docs/configuration/radio/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.
2022-10-10 10:57:39 -07:00
2022-10-11 08:47:48 -07:00
**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.
2022-10-10 10:57:39 -07:00
:::
2023-07-04 23:47:11 -07:00
## Channel Config Values
2022-10-10 10:57:39 -07:00
### Index
2022-10-10 13:20:50 -07:00
The channel index begins at 0 and ends at 7.
2022-10-10 10:57:39 -07:00
_Indexing_ can not be modified.
2023-01-19 05:01:57 -08:00
| 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 |
2022-10-11 08:47:48 -07:00
:::note
2022-11-02 11:46:54 -07:00
You can **not** have `DISABLED` channels in-between active channels such as `PRIMARY` and `SECONDARY`. Active channels must be consecutive.
2022-10-11 08:47:48 -07:00
:::
2022-10-10 10:57:39 -07:00
### Role
Each channel is assigned one of 3 roles:
2023-01-19 05:01:57 -08:00
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.
2023-07-24 10:31:57 -07:00
- Periodic broadcasts like position and telemetry are only sent over this channel.
2022-10-10 13:20:50 -07:00
2. `SECONDARY` or `2`
2023-01-19 05:01:57 -08:00
- 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.
2022-10-10 10:57:39 -07:00
2023-03-05 02:13:52 -08:00
:::note
2024-01-05 11:17:11 -08:00
While you can have a different PRIMARY channel and communicate over SECONDARY channels with the same Name & PSK, a hash of the PRIMARY channel's name sets the LoRa channel number, which determines the actual frequency you are transmitting on in the band.
2023-03-05 02:13:52 -08:00
To ensure devices with different PRIMARY channel name transmit on the same frequency, you must explicitly set the LoRa channel number.
:::
2022-10-10 10:57:39 -07:00
## Channel Settings Values
2023-06-30 13:20:06 -07:00
The Channel Settings options are: Name, PSK, Downlink Enabled, and Uplink Enabled. Channel settings are embedded in the `Channel` protobuf as a `ChannelSettings` protobuf and sent as an admin message.
2022-10-10 10:57:39 -07:00
### Name
2023-01-19 05:01:57 -08:00
A short identifier for the channel. _(< 12 bytes)_
2022-10-10 10:57:39 -07:00
2023-01-19 05:01:57 -08:00
| 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 |
2022-10-10 10:57:39 -07:00
2024-01-05 11:17:11 -08:00
:::note
2024-01-05 11:22:55 -08:00
Matching channel names are required in order to communicate on the same channel with other devices. Example: If your device is using the channel name `LongFast` the device you are attempting to communicate with must also have a channel named `LongFast`.
2024-01-05 11:17:11 -08:00
:::
2022-10-10 10:57:39 -07:00
### PSK
2022-10-10 11:09:49 -07:00
The encryption key used for private channels.
2022-10-11 11:23:35 -07:00
Hex byte `0x01` for the Primary `default` channel.
2022-10-10 10:57:39 -07:00
Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
2024-01-05 11:17:11 -08:00
:::note
Matching PSKs are required in order to communicate on the same channel with other devices. Example: If your device is using a channel with the default PSK of `AQ==` the device you are attempting to communicate with must also have a matching channel with the same PSK.
:::
2022-10-10 10:57:39 -07:00
### 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.
2024-03-07 13:02:44 -08:00
## Channel Config Client Availability
2023-06-30 13:30:14 -07:00
2022-10-10 10:57:39 -07:00
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'Android', value: 'android'},
{label: 'Apple', value: 'apple'},
{label: 'CLI', value: 'cli'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="android">
2024-02-22 13:09:26 -08:00
#### Android
2022-10-10 10:57:39 -07:00
:::info
2023-06-18 21:46:32 -07:00
Channel Config options are available on Android.
2022-10-10 10:57:39 -07:00
:::
2024-02-03 05:33:07 -08:00
![Android Menu Tabs](/img/android/android-menu-channel.webp)
2023-06-18 21:46:32 -07:00
2023-06-19 09:11:55 -07:00
The Radio Configuration tab can be used for common tasks:
2024-01-05 11:17:11 -08:00
2023-06-18 21:46:32 -07:00
1. View your current channel configuration QR code and URL.
2. Quickly create or modify your primary channel.
3. Select a modem preset for all your channels i.e. `Long Range / Fast`.
See [Android App Usage](/docs/software/android/usage#setup-a-channel) for more further instruction on setting up your primary channel.
2024-02-03 05:33:07 -08:00
[![Channel Editor](/img/android/android-channel-edit-sm.webp)](/img/android/android-channel-edit.webp)
2023-06-18 21:46:32 -07:00
2023-06-19 09:11:55 -07:00
Tap the Channel Name (or the pen icon) to access the Channel Menu:
2023-06-18 21:46:32 -07:00
1. Add, remove, or modify secondary channels
2. Create or modify encryption keys
3. Enable uplink and downlink for individual channels
2022-10-10 10:57:39 -07:00
</TabItem>
<TabItem value="apple">
2024-02-22 13:09:26 -08:00
#### Apple
2022-10-10 10:57:39 -07:00
:::info
2024-03-07 13:02:44 -08:00
2024-03-07 13:10:48 -08:00
A channel editor is available on the iOS, iPadOS and macOS applications at Settings > Radio Configuration > Channels.
2024-03-07 13:02:44 -08:00
2022-10-10 10:57:39 -07:00
:::
</TabItem>
<TabItem value="cli">
2024-02-22 13:09:26 -08:00
#### CLI
2022-11-09 20:00:38 -08:00
:::info
2022-10-10 10:57:39 -07:00
All Channel config options are available in the python CLI. Example commands are below:
2022-11-09 20:00:38 -08:00
:::
2022-10-10 10:57:39 -07:00
2023-01-06 18:56:47 -08:00
:::tip
Because the device will reboot after each command is sent via CLI, it is recommended when setting multiple values in a config section that commands be chained together as one.
```shell title="Example:"
meshtastic --ch-set name "My Channel" --ch-set psk random --ch-set uplink_enabled true --ch-index 4
```
:::
2024-02-22 13:09:26 -08:00
##### Name
2022-10-10 10:57:39 -07:00
```shell title="Set channel name for the PRIMARY channel"
2022-10-10 13:20:50 -07:00
# without spaces
2022-10-10 10:57:39 -07:00
meshtastic --ch-set name MyChannel --ch-index 0
2022-10-10 13:20:50 -07:00
# with spaces
2022-10-10 10:57:39 -07:00
meshtastic --ch-set name "My Channel" --ch-index 0
```
2023-11-15 16:36:05 -08:00
2024-02-22 13:09:26 -08:00
##### PSK
2022-10-10 10:57:39 -07:00
2022-10-10 13:20:50 -07:00
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.
2022-10-10 10:57:39 -07:00
| 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
```
2023-03-27 02:54:51 -07:00
```shell title="Set encryption to your own key on PRIMARY channel (Base64 encoded)"
meshtastic --ch-set psk base64:puavdd7vtYJh8NUVWgxbsoG2u9Sdqc54YvMLs+KNcMA= --ch-index 0
```
:::tip
2023-06-09 17:16:03 -07:00
Use this to copy and paste the `base64` encoded (single channel) key from the meshtastic --info command. Please don't use the omnibus (all channels) code here, it is not a valid key.
2023-03-27 02:54:51 -07:00
:::
2022-10-10 10:57:39 -07:00
```shell title="Disable encryption on PRIMARY channel"
meshtastic --ch-set psk none --ch-index 0
```
2024-02-22 13:09:26 -08:00
##### Uplink / Downlink
2022-10-10 10:57:39 -07:00
2023-09-28 19:10:42 -07:00
For configuring gateways, please see [MQTT](/docs/configuration/module/mqtt)
2022-10-10 10:57:39 -07:00
```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="web">
2024-02-22 13:09:26 -08:00
#### Web
2022-10-10 10:57:39 -07:00
:::info
All Channel config options are available in the Web UI.
:::
</TabItem>
2023-01-19 05:01:57 -08:00
</Tabs>