diff --git a/locales/en/messages.json b/locales/en/messages.json index 68ffafca39..ed5c1ad39f 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -2191,6 +2191,12 @@ "pidTuningSliderModeHelp": { "message": "Pid Tuning Slider Mode

Pidtuning slider mode can be:

• OFF - no sliders, enter values manually
• RP - sliders control Roll and Pitch only, enter Yaw values manually
• RPY - sliders control all PID values

Warning:Going from RP to RPY mode will overwrite Yaw settings with firmware settings." }, + "receiverHelpModelId": { + "message": "If you set the Model Match below to a number other than 255, you can specify the receiver number in OpenTX/EdgeTX model setup page and turn on the Model Match in the ELRS LUA script for that model. Model match is between 0 and 63 inclusive.
See ELRS Documentation for more information." + }, + "receiverModelId": { + "message": "Model Match ID" + }, "receiverHelp": { "message": "• Always check that your Failsafe is working properly! The settings are in the Failsafe tab, which requires Expert Mode.
Use the latest Tx firmware!
Disable the hardware ADC filter in the Transmitter if using OpenTx or EdgeTx.
Basic Setup: Configure the 'Receiver' settings correctly. Choose the correct ‘Channel Map’ for your radio. Check that the Roll, Pitch and other bar graphs move correctly. Adjust the channel endpoint or range values in the transmitter to ~1000 to ~2000, and set the midpoint to 1500. For more information, read the documentation." }, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index d9f66179e6..26267dcc4a 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -8,7 +8,7 @@ import semver from 'semver'; import vtxDeviceStatusFactory from "../utils/VtxDeviceStatus/VtxDeviceStatusFactory"; import MSP from "../msp"; import MSPCodes from "./MSPCodes"; -import { API_VERSION_1_45, API_VERSION_1_46 } from '../data_storage'; +import { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from '../data_storage'; import EscProtocols from "../utils/EscProtocols"; import huffmanDecodeBuf from "../huffman"; import { defaultHuffmanTree, defaultHuffmanLenIndex } from "../default_huffman_tree"; @@ -1014,6 +1014,10 @@ MspHelper.prototype.process_data = function(dataHandler) { } } + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + FC.RX_CONFIG.elrsModelId = data.readU8(); + } + break; case MSPCodes.MSP_FAILSAFE_CONFIG: @@ -1906,6 +1910,11 @@ MspHelper.prototype.crunch = function(code, modifierCode = undefined) { FC.RX_CONFIG.elrsUid.forEach(b => buffer.push8(b)); } + // Introduced in 1.47 + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + buffer.push8(FC.RX_CONFIG.elrsModelId); + } + break; case MSPCodes.MSP_SET_FAILSAFE_CONFIG: diff --git a/src/js/tabs/receiver.js b/src/js/tabs/receiver.js index 3769a0b4d2..dbf603a6da 100644 --- a/src/js/tabs/receiver.js +++ b/src/js/tabs/receiver.js @@ -10,7 +10,7 @@ import Model from "../model"; import RateCurve from "../RateCurve"; import MSPCodes from "../msp/MSPCodes"; import windowWatcherUtil from "../utils/window_watchers"; -import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46 } from "../data_storage"; +import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from "../data_storage"; import DarkTheme from "../DarkTheme"; import { gui_log } from "../gui_log"; import { degToRad } from "../utils/common"; @@ -370,6 +370,13 @@ receiver.initialize = function (callback) { tab.elrsBindingPhraseEnabled = false; } + if (tab.elrsBindingPhraseEnabled && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + $('input[name="elrsModelId-number"]').val(FC.RX_CONFIG.elrsModelId); + } else { + $('input[name="elrsModelId-number"]').parent().hide(); + } + + // UI Hooks function updateSaveButton(reboot=false) { @@ -471,6 +478,10 @@ receiver.initialize = function (callback) { } else { FC.RX_CONFIG.elrsUid = [0, 0, 0, 0, 0, 0]; } + + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + FC.RX_CONFIG.elrsModelId = parseInt($('input[name="elrsModelId-number"]').val()); + } } function save_rssi_config() { diff --git a/src/tabs/receiver.html b/src/tabs/receiver.html index f6894d964f..c772a437c0 100644 --- a/src/tabs/receiver.html +++ b/src/tabs/receiver.html @@ -60,6 +60,11 @@
+
+ + +
+