Merge pull request #51 from jfirwin/settings-enhancments

Settings enhancments
This commit is contained in:
Sacha Weatherstone 2021-06-09 14:23:49 +10:00 committed by GitHub
commit c3ee08be96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 580 additions and 25 deletions

View file

@ -0,0 +1,152 @@
---
id: channel-advanced
title: Channel Settings - Advanced
sidebar_label: Channel
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
:::caution
These settings are for advanced users only. If you don't know what you are doing you could damage your radio or break local radio laws. Proceed with caution.
:::
## Overview
Most
## Settings
| Setting | Acceptable Values | Default |
| :-----: | :---------------: | :-----: |
| bandwidth | | |
| channel_num | | |
| coding_rate | | |
| spread_factor | `7`, `8`, `9`, `10`, `11`, `12` | TODO |
| tx_power | `integer` (in dBm) | `0` |
### bandwidth
TODO
### channel_num
TODO
### coding_rate
TODO
### spread_factor
TODO
### tx_power
TODO
## Examples
### Set Bandwidth
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Set Channel Number
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Set Coding Rate
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Set Spread Factor
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Set TX Power
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>

View file

@ -16,7 +16,62 @@ Channel settings are an integral part of the way your devices communicate across
| Setting | Acceptable Values | Default |
| :-----: | :---------------: | :-----: |
| downlink_enabled | `true`, `false` | `false` |
| id | `integer` | `0` |
| modem_config | `Bw125Cr45Sf128`, `Bw500Cr45Sf128`, `Bw31_25Cr48Sf512`, `Bw125Cr48Sf4096` | TODO |
| name | `string` | `""` |
| psk | `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9` | `1` |
| region | `Unset`, `US`, `EU433`, `EU865`, `CN`, `JP`, `ANZ`, `KR`, `TW`, `RU` | `Unset` |
| uplink_enabled | `true`, `false` | `false` |
### downlink_enabled
If `true`, messages seen on the internet will be forwarded to the local mesh through a gateway node. See [MQTT settings](mqtt) for more details.
:::caution
This is in active development and not ready for casual users. Testing only.
:::
### id
<!--- Used to construct a globally unique channel ID. The full globally unique ID will be: "name.id" where ID is shown as base36. 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. And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to try multiple candidate channels. Any time a non wire compatible change is made to a channel, this field should be regenerated. There are a small number of 'special' globally known (and fairly) insecure standard channels. Those channels do not have a numeric id included in the settings, but instead it is pulled from a table of well known IDs. (see Well Known Channels FIXME) --->
### modem_config
| Setting | Name | Bandwidth | Coding Rate | Spread Factor | Speed |
| :-----: | :--: | :-------: | :---------: | :-----------: | :-----: |
| `Bw125Cr45Sf128` | Medium | 125 kHz | 4/5 | 7 = 128chips/symbol | 5.469 kbps |
| `Bw500Cr45Sf128` | ShortFast | 500 kHz | 4/5 | 7 = 128chips/symbol | 21.875 kbps |
| `Bw31_25Cr48Sf512` | LongAlt | 31.25 kHz | 4/8 | 9 = 512chips/symbol | 275 bps |
| `Bw125Cr48Sf4096` | LongSlow | 125 kHz | 4/8 | 12 = 4096chips/symbol | 183 bps |
### name
<!--- A SHORT name that will be packed into the URL. Less than 12 bytes. Something for end users to call the channel If this is the empty string it is assumed that this channel is the special (minimally secure) "Default"channel. In user interfaces it should be rendered as a local language translation of "X". For channel_num hashing empty string will be treated as "X". Where "X" is selected based on the English words listed above for ModemConfig --->
### psk
<!--- TODO pick which psk description to keep --->
<!--- option A as documented in the protobufs --->
<!--- A simple pre-shared key for now for crypto. Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256). A special shorthand is used for 1 byte long psks. These psks should be treated as only minimally secure, because they are listed in this source code. Those bytes are mapped using the following scheme: 0 = No crypto 1 = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf} 2 through 10 = The default channel key, except with 1 through 9 added to the last byte. Shown to user as simple1 through 10 --->
| Setting | Behavior |
| :-----: | :------: |
| `0` | Disable Encryption |
| `1` | Default Encryption |
| `2`-`10` | Default Encryption, except with 1-9 added to the last byte |
<!--- option B as documented in the python library --->
<!--- Use "--setchan psk none" to turn off encryption. Use "--setchan psk random" will assign a new (high quality) random AES256 key to the primary channel (similar to what the Android app does when making new channels). Use "--setchan psk default" to restore the standard 'default' (minimally secure, because it is in the source code for anyone to read) AES128 key. --->
| Setting | Behavior |
| :-----: | :------: |
| `none` | Disable Encryption |
| `default` | Default Encryption |
| `random` | TODO |
### region
@ -38,10 +93,119 @@ The `region` variable sets which region your radio is configured to work in. It
For more details about `region` settings, you can see the source code [here](https://github.com/meshtastic/Meshtastic-device/blob/master/src/mesh/RadioInterface.cpp)
:::
## Details
### uplink_enabled
If `true`, messages on the mesh will be sent to the public internet by any gateway node. See [MQTT settings](mqtt) for more details.
## Examples
### Set Channel ID
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Set channel ID"
meshtastic --ch-set id 1234
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
The channel `id` must be an integer.
:::
### Set Channel Name
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Set channel name"
meshtastic --ch-set name MyChannel
```
```bash title="Set channel name with spaces"
meshtastic --ch-set name "My Channel"
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
A channel `id` must be set in order to name a channel.
:::
### Set Encryption
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Set psk"
meshtastic --ch-set psk default
```
<!--- TODO random and none --->
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
See [`psk`](#psk) for details.
:::
### Set Modem
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Set Modem - LongSlow"
meshtastic --ch-set modem_config Bw125Cr48Sf4096
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
See [`modem_config`](#modem_config) for details. For advanced modem configuration, see [Channel Settings - Advanced](channel-advanced).
:::
### Set Region
<Tabs
groupId="settings"
@ -63,3 +227,5 @@ For more details about `region` settings, you can see the source code [here](htt
</TabItem>
</Tabs>
<!--- TODO add downlink_enabled & uplink_enabled examples --->

View file

@ -35,7 +35,7 @@ If you wish to disable any GPS features, see below for more information.
### fixed_position
If set, this node is at a fixed position. The device will generate GPS position updates at the regular `gps_update_interval`, but use whatever the last lat/lon/alt it saved for the node. The lat/lon/alt can be set by an internal GPS or with the help of the mobile device's GPS.
If set, this node is at a fixed position. The device will generate GPS updates at the regular `gps_update_interval`, but use whatever the last lat/lon/alt it saved for the node. The lat/lon/alt can be set by an internal GPS or with the help of the mobile device's GPS.
### gps_attempt_time
@ -77,10 +77,34 @@ How often our position is sent to the mesh (but only if it has changed significa
The gps updates will be sent out every `position_broadcast_secs`, with either the actual gps location, or an empty location if no gps fix was achieved. This defaults to broadcast every 15 minutes.
## Details
## Examples
### Disable GPS Completely
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Disable GPS Completely"
meshtastic --set gps_operation GpsOpDisabled
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
`gps_operation GpsOpTimeOnly` is prefered to `gps_operation GpsOPDisabled` because it allows the device to get a highres time.
:::
### Disable Location Sharing
<Tabs
groupId="settings"
@ -107,8 +131,7 @@ The gps updates will be sent out every `position_broadcast_secs`, with either th
Disabling location sharing does not disable the GPS functionality, only the location sharing via the mesh.
:::
### Disable GPS Completely
### Set Fixed Position Current Lat/Lon
<Tabs
groupId="settings"
defaultValue="cli"
@ -118,8 +141,8 @@ Disabling location sharing does not disable the GPS functionality, only the loca
]}>
<TabItem value="cli">
```bash title="Disable GPS Completely"
meshtastic --set gps_operation GpsOpDisabled
```bash title="Set Fixed Position"
meshtastic --set fixed_position true
```
</TabItem>
@ -131,5 +154,53 @@ Disabling location sharing does not disable the GPS functionality, only the loca
</Tabs>
:::note
`gps_operation GpsOpTimeOnly` is prefered to `gps_operation GpsOPDisabled` because it allows the device to get a highres time.
The device will continue to aquire GPS coordinates according to the `gps_update_interval`, but will use the last saved coordinates as its fixed point.
:::
### Set Fixed Position Specify Lat/Lon
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Set Fixed Position"
meshtastic --setlat 37.8651 --setlon -119.5383
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Unset Fixed Position
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Unset Fixed Position"
meshtastic --set fixed_position false
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
:::note
It may take some time to see that the change has taken effect. The GPS location is updated according to the value specified on `gps_update_interval` and the mesh will be notified of the new position in relation to the `position_broadcast_secs` value.
:::

View file

@ -23,7 +23,7 @@ import TabItem from '@theme/TabItem';
### debug_log_enabled
By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). Set this to true to leave the debug log outputting even when API is active.
By default we turn off logging as soon as an API client connects (to keep shared serial link quiet and save bandwidth). Set this to true to leave the debug log outputting even when API is active.
### factory_reset
@ -41,12 +41,82 @@ If true, radio should not try to be smart about what packets to queue to the pho
If set, this will disable the SerialConsole by not initilizing the StreamAPI.
## Details
<!--- TODO --->
## Examples
### Debug Log - Disable
:::note
`debug_log_enabled` set to `false` is the default behavior.
:::
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Example - Disable debug log"
meshtastic --set debug_log_enabled false
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Debug Log - Enable
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Example - Enable debug log"
meshtastic --set debug_log_enabled true
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Factory reset
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Example - Factory reset"
meshtastic --set factory_reset true
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Frequency Offset
<Tabs
groupId="settings"
defaultValue="cli"
@ -65,3 +135,76 @@ If set, this will disable the SerialConsole by not initilizing the StreamAPI.
</TabItem>
</Tabs>
### Ignore Incoming
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
TODO
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Serial - Disable
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Example - Disable serial"
meshtastic --set disable_serial true
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>
### Serial - Enable
:::note
`disable_serial` set to `false` is the default behavior.
:::
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
]}>
<TabItem value="cli">
```bash title="Example - Enable serial"
meshtastic --set disable_serial false
```
</TabItem>
<TabItem value="android">
TODO
</TabItem>
</Tabs>

View file

@ -7,11 +7,27 @@ slug: /settings
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Changing settings is currently most reliably done using the Commandline Interface available within `Meshtastic-python`. Setting support is being added to all other methods of interfacing with your device.
Customization of your settings is vital to configuring your own mesh. Changing settings is currently most reliably done using the commandline interface available within `Meshtastic-python`. Setting support is being added to all other methods of interfacing with your device.
## First Steps
## Settings
If you've just flashed your device, you'll want to make sure to set your region first. Every freshly flashed device will have the same default channel settings. If you ever want to return your device to all defaults.
Below are some of the most common settings that a new user will want to become aquainted with, but it isn't an exhaustive list. Make sure to take a look at the sidebar for additional settings. If you find something missing or incorrect, please help us improve our docs by filing an issue, creating a pull request, or mentioning it in our forum.
### Channel Settings
Channel settings are very important, if channels are misconfigured between devices they won't be able to communicate! A freshly flashed device will use the default channel settings. Depending on your use case you may want to change your encryption using `psk`, your range of communication by setting one of the four pre-set bands using `modem_config`, or even just the name of your channel! Before you begin, don't forget to set your `region` correctly! Take a look at the [basic channel configuration](software/settings/channel) and if you're tech savvy or a radio head check out the [advanced channel settings](software/settings/channel-advanced).
:::note
It is very important that you set your device's `region` setting. This will ensure that you are operating within the legal limits for your area.
:::
### GPS Settings
For most, GPS is a really cool, desirable feature. Knowing where everyone on your local mesh is has some major advantages. However, it's possible you want to hide the location of a particular device (like a router mounted on your home). All of the settings related to GPS are located [here](software/settings/gps).
### WiFi Settings
Whether you're using the upcoming [web interface](software/web/web-app-software) or you're interested in broadcasting messages to/from the internet using [MQTT](software/settings/mqtt), the [WiFi settings](software/settings/wifi) are your first stop towards an IOT radio.
## Examples
@ -27,11 +43,10 @@ At the bottom of each setting page, examples will be available displaying how to
<TabItem value="cli">
:::note
<!--- TODO add link --->
The CLI examples will require you to utilize the Commandline Interface that is available through Meshtastic-python. Installation instructions can be found here.
The CLI examples will require you to utilize the Commandline Interface that is available through Meshtastic-python. Installation instructions can be found [here](software/python/python-installation).
:::
```bash title="Example"
```bash title="Example - Set Region (an important first step!)"
meshtastic --set region Unset
```

View file

@ -90,8 +90,6 @@ For instance the default interval of 4 will send the node owner information for
Power management state machine option. See the [power page](../other/power) for details. 0 for default of 1 minute
## Details
## Examples
<Tabs

View file

@ -40,6 +40,7 @@ Toggling `is_router` changes your device settings in the following ways.
## Examples
### Set Router
<Tabs
groupId="settings"
defaultValue="cli"
@ -49,7 +50,9 @@ Toggling `is_router` changes your device settings in the following ways.
]}>
<TabItem value="cli">
TODO
```bash title="Set Router"
meshtastic --set is_router true
```
</TabItem>
<TabItem value="android">

View file

@ -8,12 +8,16 @@ import TabItem from '@theme/TabItem';
## Overview
WiFi support can be configured as either a WiFi Client or a Software Access Point (SoftAP). The WiFi client will connect to your existing WiFi network, as opposed to the SoftAP which will broadcast a new SSID and Password. See below for more details.
The ESP32 based devices have the ability to connect to WiFi as a client and also are able to create a software based access point (SoftAP). See below for more details.
:::note
The device can be either a WiFi client or a software access point. It **cannot** operate as both at the same time.
:::
:::note
The first time your device restarts after enabling the WiFi access point, it will take an additional 20-30 seconds to boot. This is to generate self-signed SSL keys. The keys will be saved for future reuse.
:::
## Settings
| Setting | Acceptable Values | Default |

View file

@ -116,8 +116,11 @@ module.exports = {
"software/settings/serial-plugin",
"software/settings/store-and-forward-plugin",
],
},
"Advanced": [
"software/settings/channel-advanced",
"software/settings/misc",
],
},
]
},
],