meshtastic/docs/configuration/radio/lora.mdx

231 lines
11 KiB
Plaintext
Raw Normal View History

2022-06-24 19:42:37 -07:00
---
id: lora
title: LoRa Configuration
sidebar_label: LoRa
description: Understanding the LoRa configuration settings on your Meshtastic device including region, modem, hop limit, and more.
2022-06-24 19:42:37 -07:00
---
2023-01-19 05:01:57 -08:00
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import LoRaRegions from "../../blocks/_lora-regions.mdx";
2022-06-24 19:42:37 -07:00
2024-03-14 14:23:18 -07:00
The LoRa config options are: Region, Modem Preset, Max Hops, Transmit Power, Bandwidth, Spread Factor, Coding Rate, Frequency Offset, Transmit Enabled, Frequency Slot, Ignore Incoming Array, Ignore MQTT, Override Duty Cycle Limit, SX126x RX Boosted Gain, and Override Frequency. LoRa config uses an admin message sending a `Config.LoRa` protobuf.
2022-06-24 19:42:37 -07:00
2023-01-26 14:49:24 -08:00
:::note
In order to communicate fully, devices within a mesh must have identical settings for Region and Modem Preset, or identical custom Modem settings.
:::
2022-06-24 19:42:37 -07:00
## LoRa Config Values
:::note
2022-08-18 07:34:39 -07:00
You must set your device's `lora.region` setting. This will ensure that you are operating within the legal limits for your area.
2022-06-24 19:42:37 -07:00
:::
### Region
2023-01-19 05:01:57 -08:00
2022-11-09 01:50:40 -08:00
Sets the region for your node. Default is `unset`. As long as this is not set, the node screen will display a message and not transmit any packets.
2022-06-24 19:42:37 -07:00
<LoRaRegions />
2022-06-24 19:42:37 -07:00
### Modem Preset
2023-01-19 05:01:57 -08:00
2023-01-26 14:49:24 -08:00
Default is `unset` which equates to `LONG_FAST`. Presets are pre-defined modem settings (Bandwidth, Spread Factor, and Coding Rate) which influence both message speed and range. The default will provide a strong mixture of speed and range, for most users.
The presets are designed to provide further options for optimizing either speed (and reduced network congestion) or range, which can be useful for two real world scenarios:
1. A high number of devices exist in the mesh, or messages are sent very frequently. Faster speeds (and therefore lower radio time per device) can help with mesh network congestion.
2. Maximum range is desired, for long range scenarios where a several second delay in message receipt is acceptable (for instance, attempting to send messages from a town to a distant mountain top).
The Presets available are as follows, and follow a linear pattern of Fastest \<\-\-\> Slowest, and Shortest \<\-\-\> Longest range:
2023-01-26 14:49:24 -08:00
1. `SHORT_FAST` (Fastest, highest bandwidth, lowest airtime, shortest range)
2. `SHORT_SLOW`
3. `MEDIUM_FAST`
4. `MEDIUM_SLOW`
5. `LONG_FAST` (Default)
2023-01-30 08:06:12 -08:00
6. `LONG_MODERATE`
7. `LONG_SLOW`
8. `VERY_LONG_SLOW` (Slowest, lowest bandwidth, highest airtime, longest range. Not recommended for regular usage as does not form meshes well and is unreliable)
2022-06-24 19:42:37 -07:00
### Max Hops
2023-01-19 05:01:57 -08:00
2022-11-09 01:50:40 -08:00
Maximum number of hops. This can't be greater than 7. Default is 3 which should be fine for most applications. _**Really, 3 is fine.**_
2022-06-24 19:42:37 -07:00
![Hop Count](/img/configuration/max-hops.webp)
2023-11-09 23:15:20 -08:00
2022-06-29 08:55:33 -07:00
### Transmit Power
2022-10-05 06:25:07 -07:00
If zero then, use default max legal continuous power (i.e. something that won't burn out the radio hardware)
2022-06-29 08:55:33 -07:00
In most cases you should use zero here. Units are in dBm.
### Bandwidth
Certain bandwidth numbers are 'special' and will be converted by the device firmware to the appropriate floating point value:
2023-04-20 13:46:51 -07:00
| Special Value | Interpreted As |
| :-----------: | :------------: |
| 31 | 31.25 kHz |
| 62 | 62.5 kHz |
| 200 | 203.125 kHz |
| 400 | 406.25 kHz |
| 800 | 812.5 kHz |
| 1600 | 1625.0 kHz |
Please be aware that values < 62.5kHz may require a TCXO on some hardware devices.
2022-06-29 08:55:33 -07:00
2022-10-22 09:50:38 -07:00
### Spread Factor
2022-06-29 08:55:33 -07:00
A number from 7 to 12. Indicates the number of chirps per symbol as 1[\<\<]spread_factor.
2022-06-29 08:55:33 -07:00
### Coding Rate
The denominator of the coding rate. ie for 4/5, the value is 5. 4/8 the value is 8.
2022-06-29 08:55:33 -07:00
### Frequency Offset
This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
A frequency offset that is added to to the calculated band center frequency. Used to correct for crystal calibration errors.
2022-10-22 09:50:38 -07:00
### Transmit Enabled
2022-06-29 08:55:33 -07:00
2022-09-22 18:51:41 -07:00
Allows you to enable and disable transmit (TX) from the LoRa radio. Useful for hot-swapping antennas and other tests.
2022-06-29 08:55:33 -07:00
2022-11-09 01:50:40 -08:00
Defaults to true
### Frequency Slot
2023-01-19 05:01:57 -08:00
2024-03-01 14:22:43 -08:00
This setting controls the actual hardware frequency at which the radio transmits, represented by a frequency slot between 1 and NUM_SLOTS (the maximum for the current region and modem preset). If set to `0`/UNSET, the device reverts to the older channel name hash-based algorithm for determining the frequency slot.
2023-09-25 18:50:51 -07:00
2022-06-29 08:55:33 -07:00
### Ignore Incoming Array
2022-10-05 06:25:07 -07:00
For testing it is useful sometimes to force a node to never listen to particular other nodes (simulating radio out of range). All nodenums listed in the ignore_incoming array will have packets they send dropped on receive (by router.cpp)
2022-06-24 19:42:37 -07:00
### Ignore MQTT
Setting this to option to 'true' means the device will ignore any messages it receives via LoRa that came via MQTT somewhere along the path towards the device. Note this only works when your device and the MQTT node are running at least firmware version 2.2.19.
2023-01-04 08:05:39 -08:00
### Override Duty Cycle Limit
2023-01-05 08:32:08 -08:00
Setting this option to 'true' means the device will ignore the hourly duty cycle limit in Europe. This means that you might violate regulations if the device transmits too much. By default, this option is set to 'false,' which means the device will stop sending data when it reaches the hourly limit and will start again when it is allowed to do so.
2023-01-04 08:05:39 -08:00
2023-05-09 11:31:11 -07:00
### SX126x RX Boosted Gain
This is an option specific to the SX126x chip series which allows the chip to consume a small amount of additional power to increase RX sensitivity.
### Override Frequency
This parameter is for advanced users and licensed HAM radio operators. When enabled, the channel calculation will be ignored, and the set frequency will be used instead (frequency_offset still applies). This will allow you to use out-of-band frequencies. Please respect your local laws and regulations. If you are a license HAM operator, make sure you enable HAM mode and turn off encryption.
2022-06-24 19:42:37 -07:00
## LoRa Config Client Availability
<Tabs
groupId="settings"
defaultValue="apple"
2022-06-24 19:42:37 -07:00
values={[
{label: 'Android', value: 'android'},
{label: 'Apple', value: 'apple'},
2022-06-29 08:55:33 -07:00
{label: 'CLI', value: 'cli'},
2022-06-24 19:42:37 -07:00
{label: 'Web', value: 'web'},
]}>
<TabItem value="android">
2024-02-22 13:09:26 -08:00
#### Android
2022-06-24 19:42:37 -07:00
:::info
2022-12-04 13:07:48 -08:00
2023-07-04 22:28:28 -07:00
LoRa Config options are available on Android.
2022-12-04 13:07:48 -08:00
1. Open the Meshtastic App
2023-06-17 22:06:11 -07:00
2. Navigate to: **Vertical Ellipsis (3 dots top right) > Radio Configuration > LoRa**
2022-12-04 13:07:48 -08:00
2022-06-24 19:42:37 -07:00
:::
</TabItem>
<TabItem value="apple">
2024-02-22 13:09:26 -08:00
#### Apple
2022-06-24 19:42:37 -07:00
:::info
2024-03-07 13:08:23 -08:00
All LoRa config options are available on iOS, iPadOS and macOS at Settings > Radio Configuration > LoRa.
2022-06-24 19:42:37 -07:00
:::
</TabItem>
<TabItem value="cli">
2024-02-22 13:09:26 -08:00
#### CLI
:::info
2022-10-05 06:25:07 -07:00
LoRa config commands are available in the python CLI. Example commands are below:
2022-06-24 19:42:37 -07:00
:::
2024-02-12 22:24:32 -08:00
| Setting | Acceptable Values | Default |
|:---------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------:|
| lora.modem_preset | `LONG_FAST`, `LONG_SLOW`, `VERY_LONG_SLOW`, `MEDIUM_SLOW`, `MEDIUM_FAST`, `SHORT_SLOW`, `SHORT_FAST` | `LONG_FAST`, `LONG_MODERATE` |
| lora.use_preset | `false`, `true` | `false` |
| lora.region | `UNSET`, `US`, `EU_433`, `EU_868`, `CN`, `JP`, `ANZ`, `KR`, `TW`, `RU` ,`IN`, `NZ_865`, `TH`, `LORA_24`, `UA_433`, `UA_868`, `MY_433`, `MY_919`, `SG_923` | `UNSET` |
| lora.bandwidth | `31`, `62`, `125`, `250`, `500` | `250` |
| lora.spread_factor | `7`, `8`, `9`, `10`, `11`, `12` | `12` |
| lora.coding_rate | `5`, `6`, `7`, `8` | `8` |
| lora.frequency_offset | `0` to `1000000` | `0` |
| lora.hop_limit | `1`,`2`,`3`,`4`,`5`,`6`,`7` | `3` |
| lora.tx_power | `0` to `30` | `0` |
| lora.tx_enabled | `false`, `true` | `true` |
| lora.channel_num | `0`, `1` to `NUM_CHANNELS` | `0` |
| lora.ignore_mqtt | `false`, `true` | `false` |
| lora.override_duty_cycle | `false`, `true` | `false` |
| lora.sx126x_rx_boosted_gain | `false`, `true` | `false` |
| lora.override_frequency | Any supported frequency the LoRA radio is capable of. Please respect local rules and regulations | `0` |
:::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 --set lora.region US --set lora.modem_preset LONG_FAST
```
:::
```shell title="Set Modem Preset"
meshtastic --set lora.modem_preset LONG_FAST
meshtastic --set lora.modem_preset MEDIUM_FAST
```
```shell title="Set Region"
meshtastic --set lora.region US
meshtastic --set lora.region EU_433
```
```shell title="Set Hop Limit"
meshtastic --set lora.hop_limit 2
```
```shell title="Override Duty Cycle"
meshtastic --set lora.override_duty_cycle true
meshtastic --set lora.override_duty_cycle false
```
</TabItem>
<TabItem value="web">
2022-06-24 19:42:37 -07:00
2024-02-22 13:09:26 -08:00
#### Web
2022-06-24 19:42:37 -07:00
:::info
2022-11-02 11:46:54 -07:00
All LoRa config options are available in the Web UI.
2022-06-24 19:42:37 -07:00
:::
2022-10-22 09:50:38 -07:00
2024-02-22 13:09:26 -08:00
</TabItem>
</Tabs>