|
| 1 | +--- |
| 2 | +title: "Installing Adaptive Link" |
| 3 | +description: "Install and configure Adaptive-Link for OpenIPC to optimize your wireless connection" |
| 4 | +--- |
| 5 | + |
| 6 | +## How Adaptive-Link Works |
| 7 | + |
| 8 | +Wireless communication can transmit data at high speeds over short distances with a strong signal, or slowly but over longer distances with a weaker signal. |
| 9 | + |
| 10 | +OpenIPC allows you to choose one fixed link speed and video bitrate. Default: |
| 11 | +- **Bitrate:** 4 Mbps |
| 12 | +- **Channel Width:** 20 MHz |
| 13 | +- **MCS:** 1 |
| 14 | +- **FEC:** 8/12 |
| 15 | +- **Guard Interval:** long |
| 16 | + |
| 17 | +This is a "universal" profile — moderate quality and average range. |
| 18 | + |
| 19 | +**Adaptive-Link** solves this by automatically selecting the best link and video profile based on signal quality (RSSI and SNR). |
| 20 | + |
| 21 | +Strong signal = high speed and quality |
| 22 | +Weak signal = long-range profile and lower bitrate |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## How It Works |
| 27 | + |
| 28 | +- **On the Ground Station**, `alink_gs` monitors RSSI and SNR, calculates a final "score" (1000–2000), and sends it to the drone. |
| 29 | +- **On the drone**, `alink_drone` receives the score and selects the appropriate profile from `/etc/txprofiles.conf`. |
| 30 | +- Profile transitions are controlled via `/etc/alink.conf`. |
| 31 | + |
| 32 | +### Example: |
| 33 | +```ini |
| 34 | +rssi_min = -80 |
| 35 | +rssi_max = -40 |
| 36 | +snr_min = 12 |
| 37 | +snr_max = 36 |
| 38 | +``` |
| 39 | + |
| 40 | +If RSSI = -60 and SNR = 20: |
| 41 | +- RSSI score = 1500 |
| 42 | +- SNR score = 1333 |
| 43 | +- Final score (with 0.5/0.5 weights) ≈ 1416 |
| 44 | +- `alink` selects profile: `1051 - 1500` |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Installation |
| 49 | + |
| 50 | +:::tip |
| 51 | +**An internet connection is required.** |
| 52 | +::: |
| 53 | + |
| 54 | +### On Drone (OpenIPC) |
| 55 | +```bash |
| 56 | +cd /etc |
| 57 | +curl -L -o alink_install.sh https://raw.githubusercontent.com/OpenIPC/adaptive-link/refs/heads/main/alink_install.sh |
| 58 | +chmod +x alink_install.sh |
| 59 | +./alink_install.sh drone install |
| 60 | +reboot |
| 61 | +``` |
| 62 | + |
| 63 | +Add to autostart: |
| 64 | +```bash |
| 65 | +/etc/rc.local >> alink_drone & |
| 66 | +``` |
| 67 | + |
| 68 | +### On Ground Station (Radxa / Android / PC) |
| 69 | +```bash |
| 70 | +sudo curl -L -o alink_install.sh https://raw.githubusercontent.com/OpenIPC/adaptive-link/refs/heads/main/alink_install.sh |
| 71 | +sudo chmod +x alink_install.sh |
| 72 | +sudo ./alink_install.sh gs install |
| 73 | +``` |
| 74 | + |
| 75 | +**Config will be located at:** |
| 76 | +- `/config/alink_gs.conf`, or |
| 77 | +- `/home/radxa/alink_gs.conf`, or |
| 78 | +- `/etc/alink_gs.conf` |
| 79 | + |
| 80 | +:::tip |
| 81 | +**Alternative installation method using SCP to install Adaptive Link - [here](/hardware/runcam/vtx/installing-alink-runcam/)** |
| 82 | +::: |
| 83 | + |
| 84 | +## Configuration Files |
| 85 | + |
| 86 | +### Profile Configuration: `/etc/txprofiles.conf` |
| 87 | + |
| 88 | +Example configuration: |
| 89 | +```bash |
| 90 | +999 - 999 long 0 8 12 1999 10 30 0,0,0,0 20 -12 |
| 91 | +1000 - 1050 long 0 8 12 2000 10 30 0,0,0,0 20 -12 |
| 92 | +1051 - 1500 long 1 8 12 4000 10 25 0,0,0,0 20 -12 |
| 93 | +1501 - 1950 long 2 8 12 8000 10 20 12,6,6,12 20 -12 |
| 94 | +1951 - 2001 short 2 8 12 9000 10 20 12,6,6,12 20 -12 |
| 95 | +``` |
| 96 | + |
| 97 | +:::tip |
| 98 | +Safe TX profiles can be found [here](https://github.com/OpenIPC/adaptive-link/tree/main/txprofiles) |
| 99 | +::: |
| 100 | + |
| 101 | +:::caution |
| 102 | +Set the transmission power levels in `/etc/txprofiles.conf` carefully. The default is `30`, which is safe for most adapters but may be too low for some. Adjust the power accordingly to ensure optimal performance. |
| 103 | +::: |
| 104 | +--- |
| 105 | +## Parameter TX profile |
| 106 | + |
| 107 | +| Parameter | Description | |
| 108 | +|------------------|-----------------------------------------------------------------------------| |
| 109 | +| **Range** | Score range where this profile applies | |
| 110 | +| **GI (Guard Interval)** | `short`: higher speed, less protection `long`: more reliable at long range | |
| 111 | +| **MCS (Modulation and Coding Scheme)** | Lower value = lower speed, better stability Higher value = higher throughput, requires stronger signal | |
| 112 | +| **FEC (Forward Error Correction)** | Example: `8/12` means 8 bits data, 4 bits for error correction Lower ratio = faster speed, less error protection | |
| 113 | +| **Bitrate** | Video stream speed in bits per second Higher value = better quality, more bandwidth usage | |
| 114 | +| **GOP (Group of Pictures)** | Determines how often keyframes appear Lower value = more I-frames, better recovery from packet loss | |
| 115 | +| **Pwr (Transmit Power)** | Transmission power of the radio signal Higher power = longer range, more interference | |
| 116 | +| **roiQP (Region of Interest QP)** | Prioritizes video quality in important parts of the frame Lower value = better quality in the ROI area | |
| 117 | +| **Bandwidth** | Width of the radio channel in MHz Wider = higher speed, narrower = better range | |
| 118 | +| **qpDelta** | Global video compression tuning Lower value = higher quality, less compression | |
| 119 | + |
| 120 | +--- |
| 121 | +### Behavior Configuration: `/etc/alink.conf` |
| 122 | + |
| 123 | +Example configuration: |
| 124 | +```ini |
| 125 | +rssi_weight=0.3 |
| 126 | +snr_weight=0.7 |
| 127 | +fallback_ms=1000 |
| 128 | +hold_fallback_mode_s=3 |
| 129 | +min_between_changes_ms=150 |
| 130 | +hold_modes_down_s=4 |
| 131 | +hysteresis_percent=15 |
| 132 | +``` |
| 133 | + |
| 134 | + |
| 135 | +| Parameter | Description | |
| 136 | +|-----------|-------------| |
| 137 | +| **rssi_weight** | Weight given to RSSI (Received Signal Strength Indicator) in link quality calculations. Value of 0.3 means RSSI contributes 30% to the overall link quality assessment. | |
| 138 | +| **snr_weight** | Weight given to SNR (Signal-to-Noise Ratio) in link quality calculations. Value of 0.7 means SNR contributes 70% to the overall link quality assessment. | |
| 139 | +| **fallback_ms** | Time in milliseconds (1000ms = 1 second) the system waits before activating fallback mode when signal deteriorates. | |
| 140 | +| **hold_fallback_mode_s** | Duration in seconds (3s) the system remains in fallback mode even if signal improves, ensuring stability before switching back. | |
| 141 | +| **min_between_changes_ms** | Minimum time in milliseconds (150ms) between transmission mode changes, preventing rapid fluctuations. | |
| 142 | +| **hold_modes_down_s** | Time in seconds (4s) the system maintains lower transmission modes before attempting to increase quality/speed again. | |
| 143 | +| **hysteresis_percent** | Percentage buffer (15%) required for a mode change, preventing minor signal fluctuations from causing unnecessary mode switches. | |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +## Troubleshooting |
| 148 | + |
| 149 | +### If the drone stays in long-range mode (profile 999): |
| 150 | +- Check ground station transmitter power |
| 151 | +- Verify antenna connections |
| 152 | +- Review `/etc/txprofiles.conf` settings |
| 153 | + |
| 154 | +### If video quality is poor despite strong signal: |
| 155 | +- Check bitrate settings in `/etc/txprofiles.conf` |
| 156 | +- Ensure RSSI and SNR weights in `/etc/alink.conf` are set correctly |
| 157 | + |
| 158 | +### If the system frequently changes settings: |
| 159 | +- Increase `min_between_changes_ms` value in `/etc/alink.conf` |
| 160 | +- Increase `hysteresis_percent` value in `/etc/alink.conf` |
| 161 | + |
| 162 | +## Recommendations |
| 163 | + |
| 164 | +- Don't choose profiles with high bitrate if your system can't handle the traffic |
| 165 | +- Always tailor `txprofiles.conf` to your adapter — especially **power levels** |
| 166 | +- Consider your specific use case when configuring profiles |
0 commit comments