V0.54 Enhacements (#846)

* #751 DSM Enhancements

 #751 DSM Forward Programming Enhancements (New GUI, etc)

* Make both work on EdgeTx and OpenTX

* #751 Turn OFF simulation by default

Distribution code with RX simulation OFF
Simulation should be only for Development

* #751 Update Readme Documentation

Updated the Readme.txt documentation
and removed compiled luac file that was check in by mistake

* #751 Fix problems With Reset RX

1. Fix problem when trying to Factory Reset. Enter Bind Mode. Save backup, Restore Backup

2. Found a way to advance on the Gyro initial Setup menus.. a bit of a hack, but works.

3. Handle RX resets properly. It needed after initial setup

* #751 Cosmetic and Show Orientation Images

#751
1. Fix problems when text contradictions between Menu/Line Headers and List Values
2. Show Images of RX orientations
3. Able to Hack getting into Initial Setup and other menus who was failing before
4. Custumize the way Flight Mode reports the Value on Screen

* #751 add check for required libraries

Add check that the required files in DSMLIB exist

* #751

Write documentation about the protocol so that we don't forget later what we know, and enable others to understand the logs and maybe help solve problems.

* #766

Change the way to detect that the files exist. now works on both ETX and OTX

* #766 Strange Flickering in OTX

Strange Flickering happening on OTX. Refreshing the screen on every cycle fixed the problem

* #766 Change way of dectecting EdgeTX

Change way of detecting OTX in multiple versions: OTX 2.3.14 and 2.3.15

* #766  make editable Gain Values

Gains and other settings should be editable even when they are VALUE_NOCHANGING. Flight Mode is an exception that is handled properly. Right align numbers.

* #766 More enhacements

Added AR630
Make numbers right justified
Cleanup some log messages and line types.
Updated DSM FWD prog documentation

* #751 more cosmetic things

1. Added AR10360T,
2. Simplify way to configured the hack for more receivers.
3. Change some texts on menus to march spektrum
4. Background color in Spektrum theme to match

* #751 A few final changes

1. Update channel names to include channel number. i.e: Ch5 (Gear)
2,  Fix flight mode display for Heli Receiver
3. i think the unknown lines are to request info about the TX settings

* #751

1. Added Warning Screen
2. Correct handling of Unknown lines in Gyro Settings->Initial Setup

* #751

New v0.51 version.
- Added new menus to configure Model/Wing type.  Without it, the initial setup will not work properly.

* #751 More fixes on mixers and servo reverse

-- Fix problem reversing servos when using vtail/delta mix
-- Properly detect ch order of multimodule

* #751 Updated channel naming and docs

Updated readme documentation
Consistent naming of Ch across the code.

* #751 Fix message displaying data path

* #751  More improvements

1. Much easier to select channels > Ch6 for FMode, Gain and Panic channels
2. B&W version for smaller screens (128x64).. Memory footprint still a problem.
3. Fix a lot typos/misspell/grammar in the documentation

* Create DSM_AR636_TextGen.lua

Script to show Telemetry TextGen screens
for AR636 Receiver.
Really useful for BLADE helis using the AR636

Could replace dsmPID.lua

Still needs to be ported to smaller screens.

* #751 Enhancements for Lua Script tools

Enhancements

* Delete DSM_AR636_TextGen.lua

The TextGen functionality is included in DSM_AR636_Tel.lua. No longer needed

* Version 0.54

1. Fix problem with "Attitude Trim" Menu
2. New "MINimalistic" version for radios with very low memory
3. Externalized menu messages shared by all versions. the idea is to allow to translate it into other languages.
4. Correction of TextGen tools to work on black&white radios (some Lua functional differences). TextGen will be working on EdgeTx 2,8.3

---------

Co-authored-by: pascallanger <pascal_langer@yahoo.fr>
This commit is contained in:
Frankie Arzu
2023-04-16 14:42:31 -05:00
committed by GitHub
parent 89023d4b55
commit b2f8f482bb
11 changed files with 1510 additions and 403 deletions

View File

@@ -40,7 +40,13 @@
local DEBUG_ON = ... -- Get Debug_ON from parameters. -- 0=NO DEBUG, 1=HIGH LEVEL 2=MORE DETAILS
local LIB_VERSION = "0.53"
local LIB_VERSION = "0.54"
local LANGUAGE = "en"
local LOG_FILE = "/LOGS/dsm_log.txt"
local MSG_FILE = "/SCRIPTS/TOOLS/DSMLIB/msg_fwdp_"..LANGUAGE..".txt"
local Lib = { Init_Text = function (rxId) end }
@@ -152,15 +158,14 @@ local TxInfo_Step = 0
-- Text Arrays for Display Text and Debuging
local PhaseText = {}
local LineTypeText = {}
local RxName = {}
local Text = {} -- Text for Menu and Menu Lines (Headers only)
local List_Text = {} -- Messages for List Options (values only)
local List_Text_Img = {} -- If the Text has Attached Images
local List_Values = {} -- Additiona restrictions on List Values when non contiguos (L_M1 lines has this problem)
local RxName = {}
local Flight_Mode = {[0]="Flight Mode"}
local LOG_FILE = "/LOGS/dsm_log.txt"
local logFile = nil
@@ -288,6 +293,9 @@ end
------------------------------------------------------------------------------------------------------------
local function Get_Text(index)
local out = Text[index] -- Find in regular header first
if (index >= 0x8000) then
out = Flight_Mode[0]
end
if out== nil then
out = List_Text[index] -- Try list values, don't think is necesary, but just playing Safe
end
@@ -1331,6 +1339,69 @@ local function DSM_Send_Receive()
end
end
local function load_msg_from_file(fileName, mem, Text, List_Text, List_Text_Img, RxName, Flight_Mode)
local function rtrim(s)
local n = string.len(s)
while n > 0 and string.find(s, "^%s", n) do n = n - 1 end
return string.sub(s, 1, n)
end
--print(string.format("Loading messages from [%s]",fileName))
local dataFile = io.open(fileName, "r") -- read File
-- cannot read file???
assert(dataFile, "Cannot load Message file:" .. fileName)
local data = io.read(dataFile, mem * 1024) -- read up to 10k characters (newline char also counts!)
io.close(dataFile)
collectgarbage("collect")
local lineNo = 0
for line in string.gmatch(data, "[^\r\n]+") do
lineNo = lineNo + 1
--print(string.format("Line [%d]: %s",lineNo,line))
-- Remove Comments
local s = string.find(line, "--", 1, true)
if (s ~= nil) then
line = string.sub(line, 1, s - 1)
end
line = rtrim(line)
if (string.len(line) > 0) then
local a, b, c = string.match(line, "%s*(%a*)%s*|%s*(%w*)%s*|(.*)%s*")
--print(string.format("[%s] [%s] [%s]",a,b,c))
if (a ~= nil) then
local index = tonumber(b)
if (index == nil) then
assert(false, string.format("%s:%d: Invalid Hex num [%s]", fileName, lineNo, b))
elseif (a == "T") then
Text[index] = c
elseif (a == "LT") then
List_Text[index] = c
elseif (a == "LI") then
List_Text_Img[index] = c
elseif (a == "FM") then
Flight_Mode[0] = c
elseif (a == "RX") then
RxName[index] = c
else
assert(false, string.format("%s:%d: Invalid Line Type [%s]", fileName, lineNo, a))
end
end
end
if (lineNo % 50 == 0) then
collectgarbage("collect")
end
end -- For
--print(string.format("Loaded [%d] messages",lineNo))
data = nil
end
-- Init
local function DSM_Init(toolName)
local dateTime = getDateTime()
@@ -1374,20 +1445,13 @@ local function DSM_Init(toolName)
LineTypeText[LINE_TYPE.VALUE_NUM_SI16] = "V_s16"
LineTypeText[LINE_TYPE.LT_EMPTY] = "Z"
--RX names--
RxName[RX.AR636B] = "AR636B"
RxName[RX.SPM4651T] = "SPM4651T"
RxName[RX.AR637T] = "AR637T"
RxName[RX.AR637TA] = "AR637TA"
RxName[RX.FC6250HX] = "FC6250HX"
RxName[RX.AR630] = "AR630"
RxName[RX.AR8360T] = "AR8360T"
RxName[RX.AR10360T] = "AR10360T"
RxName[RX.AR631] = "AR631"
DSM_ReadTxModelData()
-- Load messages from external file (/DSMLIB/msg_en.txt)
load_msg_from_file(MSG_FILE,10,Text,List_Text,List_Text_Img,RxName,Flight_Mode)
end
local function DSM_Init_Text(rxId)
--Text to be displayed
-- For menu lines who are not navigation to other menus (SubHeders or Plain text)
@@ -1411,36 +1475,30 @@ local function DSM_Init_Text(rxId)
return " ("..(MODEL.TX_CH_TEXT[ch] or "--")..")"
end
List_Text[0x0001] = "Off"
List_Text[0x0002] = "On"
-- Ihn/Act List Options
List_Text[0x0003] = "Inh"
List_Text[0x0004] = "Act"
-- OVERRIDES for list of valid VALUES and channel names
-- Channel selection for SAFE MODE and GAINS on FC6250HX
List_Text[0x000C] = "Inhibit?" --?
-- List_Text[0x000C] = "Inhibit?" --?
for i = 0, 7 do List_Text[0x000D + i] = "Ch"..(i+5) ..getTxChText(i+4) end -- Aux channels (Ch5 and Greater)
-- Servo Output values..
local servoOutputValues = {0x0003,0x002D,0x002E,0x002F} --Inh (GAP), 5.5ms, 11ms, 22ms. Fixing L_m1 with 0..244 range!
List_Text[0x002D] = "5.5ms"
List_Text[0x002E] = "11ms"
List_Text[0x002F] = "22ms"
--List_Text[0x002D] = "5.5ms"
--List_Text[0x002E] = "11ms"
--List_Text[0x002F] = "22ms"
-- Gain Values
local gainValues = {0x0032,0x0033,0x0034} -- 1X, 2X, 4X -- Fixing L_m1 with 0..244 range!
List_Text[0x0032] = "1 X"
List_Text[0x0033] = "2 X"
List_Text[0x0034] = "4 X"
--List_Text[0x0032] = "1 X"
--List_Text[0x0033] = "2 X"
--List_Text[0x0034] = "4 X"
-- List of Channels for Safe, Gains, Panic, except FC6250HX that uses other range (0x00C..0x015)
-- the valid range Starts with GEAR if enabled (Thr,Ail,Ele,Rud are not valid, the RX reject them )
-- Valid Values: Inhibit? (GAP), Gear,Aux1..Aux7,X-Plus-1..XPlus-8
local channelValues = {0x0035,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049}
List_Text[0x0035] = "Inhibit?"
--List_Text[0x0035] = "Inhibit?"
for i = 0, 11 do List_Text[0x0036 + i] = "Ch"..(i+1) .. getTxChText(i) end -- Channels on AR637T
for i = 1, 8 do -- 41..49
@@ -1450,38 +1508,6 @@ local function DSM_Init_Text(rxId)
-- ****No longer overrides of previous XPlus values, since using different array
-- for List_Text values
Text[0x0040] = "Roll"
Text[0x0041] = "Pitch"
Text[0x0042] = "Yaw"
Text[0x0043] = "Gain/c/b" -- FC6250HX, AR631
Text[0x0045] = "Differential"
Text[0x0046] = "Priority"
Text[0x0049] = "Output Setup" -- FC6250HX, AR631
--******
Text[0x004A] = "Failsafe"
Text[0x004B] = "Main Menu"
Text[0x004E] = "Position"
Text[0x0050] = "Outputs";
Text[0x0051] = "Output Channel 1"
Text[0x0052] = "Output Channel 2"
Text[0x0053] = "Output Channel 3"
Text[0x0054] = "Output Channel 4"
Text[0x0055] = "Output Channel 5"
Text[0x0056] = "Output Channel 6"
if LCD_W <= 128 then -- Override for smaller screens
Text[0x0051] = "Output Ch 1"
Text[0x0052] = "Output Ch 2"
Text[0x0053] = "Output Ch 3"
Text[0x0054] = "Output Ch 4"
Text[0x0055] = "Output Ch 5"
Text[0x0056] = "Output Ch 6"
end
if (rxId ~= RX.FC6250HX) then -- Restrictions for non FC6250HX
List_Values[0x0051]=servoOutputValues
List_Values[0x0052]=servoOutputValues
@@ -1491,278 +1517,30 @@ local function DSM_Init_Text(rxId)
List_Values[0x0056]=servoOutputValues
end
-- FailSafe Options
--Text[0x005E]="Inhibit"
List_Text[0x005F] = "Hold Last"
List_Text[0x0060] = "Preset"
--Text[0x0061]="Custom"
--FC6250HX
Text[0x0071] = "Proportional"
Text[0x0072] = "Integral"
Text[0x0073] = "Derivate"
-- Flight mode channel selection
Text[0x0078] = "FM Channel"
--Text[0x0078] = "FM Channel"
if (rxId ~= RX.FC6250HX) then List_Values[0x0078]=channelValues end --FC6250HX uses other range
Text[0x007F] = "Attitude Gain" -- AR636B
Text[0x0080] = "Orientation"
Text[0x0082] = "Heading"
Text[0x0085] = "Frame Rate"
Text[0x0086] = "System Setup"
Text[0x0087] = "F-Mode Setup"
Text[0x0088] = "Enabled F-Modes"
-- Gain channel selection
Text[0x0089] = "Gain Channel"
--Text[0x0089] = "Gain Channel"
if (rxId ~= RX.FC6250HX) then List_Values[0x0089]=channelValues end --FC6250HX uses other range
-- Gain Sensitivity selection
Text[0x008A] = "Gain Sensitivity/r"; List_Values[0x008A]=gainValues -- Right Alight, (L_M1 was wide open range 0->244)
Text[0x008B] = "Panic"
Text[0x008E] = "Panic Delay"
Text[0x0090] = "Apply"
Text[0x0091] = "Begin" -- FC6250HX: Callibration Menu -> Begin..Start, Complete, Done
Text[0x0092] = "Start"
Text[0x0093] = "Complete"
Text[0x0094] = "Done"
Text[0x0097] = "Factory Reset"
Text[0x0098] = "Factory Reset" -- FC6250HX: Title
Text[0x0099] = "Advanced Setup"
Text[0x009A] = "Capture Failsafe Positions"
Text[0x009C] = "Custom Failsafe"
Text[0x009F] = "Save Settings" -- Save & Reboot RX
Text[0x00A5] = "First Time Setup"
Text[0x00AA] = "Capture Gyro Gains"
Text[0x00AD] = "Gain Channel Select"
--Text[0x008A] = "Gain Sensitivity/r";
List_Values[0x008A]=gainValues -- Right Alight, (L_M1 was wide open range 0->244)
-- Safe mode options, Ihnibit + this values
local safeModeOptions = {0x0003,0x00B0,0x00B1} -- inh (gap), "Self-Level/Angle Dem, Envelope
List_Text[0x00B0] = "Self-Level/Angle Dem"
List_Text[0x00B1] = "Envelope"
--List_Text[0x00B0] = "Self-Level/Angle Dem"
--List_Text[0x00B1] = "Envelope"
-- Flight Modes List Options
List_Text[0x00B5] = "Inhibit"
for i = 1, 10 do List_Text[0x00B5 + i] = "F Mode " .. i end
Text[0x00BE] = "Unknown_BE" -- Used in Reset menu (0x0001) while the RX is rebooting
Text[0x00C7] = "Calibrate Sensor"
Text[0x00C8] = "Complete" -- FC6250HX calibration complete
Text[0x00CA] = "SAFE/Panic Mode Setup"
Text[0x00CD] = "Level model and capture attitude/m"; -- Different from List_Text , and force it to be a menu button
if LCD_W <= 128 then -- Override for small screens
Text[0x00CD] = "Level model, cap attitude/m"; -- Different from List_Text , and force it to be a menu button
end
-- RX Orientations for AR631/AR637, Optionally attach an Image + Alt Text to display
List_Text[0x00CB] = "Pos 1"; List_Text_Img[0x00CB] = "rx_pos_1.png|Pilot View: RX Label Up, Pins Back"
List_Text[0x00CC] = "Pos 2"; List_Text_Img[0x00CC] = "rx_pos_2.png|Pilot View: RX Label Left, Pins Back"
List_Text[0x00CD] = "Pos 3"; List_Text_Img[0x00CD] = "rx_pos_3.png|Pilot View: RX Label Down, Pins Back"
List_Text[0x00CE] = "Pos 4"; List_Text_Img[0x00CE] = "rx_pos_4.png|Pilot View: RX Label Right, Pins Back"
List_Text[0x00CF] = "Pos 5"; List_Text_Img[0x00CF] = "rx_pos_5.png|Pilot View: RX Label UP, Pins to Front"
List_Text[0x00D0] = "Pos 6"; List_Text_Img[0x00D0] = "rx_pos_6.png|Pilot View: RX Label Left, Pins Front"
List_Text[0x00D1] = "Pos 7"; List_Text_Img[0x00D1] = "rx_pos_7.png|Pilot View: RX Label Down, Pins Front"
List_Text[0x00D2] = "Pos 8"; List_Text_Img[0x00D2] = "rx_pos_8.png|Pilot View: RX Label Right, Pins Front"
List_Text[0x00D3] = "Pos 9"; List_Text_Img[0x00D3] = "rx_pos_9.png|Pilot View: RX Label Up, Pins Left"
List_Text[0x00D4] = "Pos 10"; List_Text_Img[0x00D4] = "rx_pos_10.png|Pilot View: RX Label Back, Pins Left"
List_Text[0x00D5] = "Pos 11"; List_Text_Img[0x00D5] = "rx_pos_11.png|Pilot View: RX Label Down, Pins Left"
List_Text[0x00D6] = "Pos 12"; List_Text_Img[0x00D6] = "rx_pos_12.png|Pilot View: RX Label Front, Pins Left"
List_Text[0x00D7] = "Pos 13"; List_Text_Img[0x00D7] = "rx_pos_13.png|Pilot View: RX Label Up, Pins Right"
List_Text[0x00D8] = "Pos 14"; List_Text_Img[0x00D8] = "rx_pos_14.png|Pilot View: RX Label Back, Pins Right"
List_Text[0x00D9] = "Pos 15"; List_Text_Img[0x00D9] = "rx_pos_15.png|Pilot View: RX Label Down, Pins Right"
List_Text[0x00DA] = "Pos 16"; List_Text_Img[0x00DA] = "rx_pos_16.png|Pilot View: RX Label Front, Pins Right"
List_Text[0x00DB] = "Pos 17"; List_Text_Img[0x00DB] = "rx_pos_17.png|Pilot View: RX Label Back, Pins Down"
List_Text[0x00DC] = "Pos 18"; List_Text_Img[0x00DC] = "rx_pos_18.png|Pilot View: RX Label Left, Pins Down"
List_Text[0x00DD] = "Pos 19"; List_Text_Img[0x00DD] = "rx_pos_19.png|Pilot View: RX Label Front, Pins Down"
List_Text[0x00DE] = "Pos 20"; List_Text_Img[0x00DE] = "rx_pos_20.png|Pilot View: RX Label Right, Pins Down"
List_Text[0x00DF] = "Pos 21"; List_Text_Img[0x00DF] = "rx_pos_21.png|Pilot View: RX Label Back, Pins Up"
List_Text[0x00E0] = "Pos 22"; List_Text_Img[0x00E0] = "rx_pos_22.png|Pilot View: RX Label Left, Pins Up"
List_Text[0x00E1] = "Pos 23"; List_Text_Img[0x00E1] = "rx_pos_23.png|Pilot View: RX Label Front, Pins Up"
List_Text[0x00E2] = "Pos 24"; List_Text_Img[0x00E2] = "rx_pos_24.png|Pilot View: RX Label Right, Pins Up"
List_Text[0x00E3] = "Pos Invalid"; List_Text_Img[0x00E3] = "rx_pos_25.png|Cannot detect orientation of RX"
Text[0x00D1] = "Receiver will Reboot/b"
--FC6250HX
Text[0x00D2] = "Panic Channel"
--Text[0x00D2] = "Panic Channel"
if (rxId ~= RX.FC6250HX) then List_Values[0x00D2]=channelValues end --FC6250HX uses other range
Text[0x00D3] = "Swashplate"
Text[0x00D5] = "Agility"
Text[0x00D8] = "Stop"
Text[0x00DA] = "SAFE/c/b" --SubTitle
Text[0x00DB] = "Stability"
Text[0x00DC] = "Deg. per sec"
Text[0x00DD] = "Tail rotor"
Text[0x00DE] = "Setup"
Text[0x00DF] = "AFR"
Text[0x00E0] = "Collective"
Text[0x00E1] = "Subtrim"
Text[0x00E2] = "Phasing"
Text[0x00E4] = "E-Ring"
Text[0x00E7] = "Left"
Text[0x00E8] = "Right"
-- Gain Capture options
List_Text[0x00F2] = "Fixed"
List_Text[0x00F3] = "Adjustable"
Text[0x00F9] = "Gyro settings"
Text[0x00FE] = "Stick Priority/c/b" --SubTitle
Text[0x0100] = "Make sure the model has been"
Text[0x0101] = "configured, including wing"
Text[0x0102] = "type, reversing, travel,"
Text[0x0103] = "trimmed, etc. before "
Text[0x0104] = "continuing setup."
Text[0x0105] = "" -- empty??
Text[0x0106] = "Any wing type, channel assignment,"
Text[0x0107] = "subtrim, or servo reversing changes"
Text[0x0108] = "require running through initial"
Text[0x0109] = "setup again."
Text[0x010A] = "" -- empty??
Text[0x010B] = "" -- empty??
Text[0x0190] = "Relearn Model/Servo Settings (TX->RX)"
Text[0x019C] = "Enter Receiver Bind Mode"
Text[0x01D7] = "SAFE Select Channel"
Text[0x01DC] = "AS3X/c/b" -- Subtitle, Center+bold
Text[0x01DD] = "AS3X Settings"
Text[0x01DE] = "AS3X Gains"
Text[0x01E0] = "Rate Gains/c/b" -- SubTitle, Center+bold
Text[0x01E2] = "SAFE Settings"
Text[0x01E3] = "SAFE Gains"
Text[0x01E6] = "Attitude Trim/c/b" -- SubTitle, Center+bold
Text[0x01E7] = "Envelope"
Text[0x01E9] = "Roll Right"
Text[0x01EA] = "Roll Left"
Text[0x01EB] = "Pitch Down"
Text[0x01EC] = "Pitch Up"
Text[0x01EE] = "Throttle to Pitch"
Text[0x01EF] = "Low Thr to Pitch/c/b" -- SubTitle, Center+bold
Text[0x01F0] = "High Thr to Pitch/c/b" -- SubTitle, Center+bold
Text[0x01F3] = "Threshold"
Text[0x01F4] = "Angle"
Text[0x01F6] = "Failsafe Angles/c/b" -- SubTitle, Center+bold
--Inh, Self-Level/Angle Dem, Envelope -- (L_M was wide open range 0->244)
Text[0x01F8] = "Safe Mode"; List_Values[0x01F8]=safeModeOptions
Text[0x01F9] = "SAFE Select/c/b" -- SubTitle
Text[0x01FC] = "Panic Flight Mode"
Text[0x01FD] = "SAFE Failsafe FMode"
Text[0x0208] = "Decay"
Text[0x0209] = "Save to Backup"
Text[0x020A] = "Restore from Backup"
Text[0x020D] = "First Time SAFE Setup"
-- First time safe setup Page 3 :
Text[0x020E] = "AS3X gains must be tuned"
Text[0x020F] = "and active in SAFE Flight Modes"
Text[0x0210] = "to help reduce wobble."
Text[0x0211] = "" -- empty
Text[0x0212] = "" -- empty
Text[0x0213] = "" -- empty
-- AS3X orientation Setting menu (Level)
Text[0x021A] = "Set the model level,"
Text[0x021B] = "and press Continue."
Text[0x021C] = "" -- empty??
Text[0x021D] = "" -- empty??
-- AS3X orientation Setting menu (Nose down)
Text[0x021F] = "Set the model on its nose,"
Text[0x0220] = "and press Continue. If the"
Text[0x0221] = "orientation on the next"
Text[0x0222] = "screen is wrong go back"
Text[0x0223] = "and try again."
Text[0x0224] = "Continue"
Text[0x0226] = "Angle Limits/c/b"
Text[0x0227] = "Other settings"
Text[0x0229] = "Set Orientation Manually"
-- Factory Default Warning
Text[0x022B] = "WARNING!"
Text[0x022C] = "This will reset the"
Text[0x022D] = "configuration to factory"
Text[0x022E] = "defaults. This does not"
Text[0x022F] = "affect the backup config."
Text[0x0230] = "" -- empty??
-- Backup Warning
Text[0x0231] = "This will overwrite the"
Text[0x0232] = "backup memory with your"
Text[0x0233] = "current configuartion."
Text[0x0234] = "" -- blank line
Text[0x0235] = "" -- blank line
-- Restore from Backup Warning
Text[0x0236] = "This will overwrite the"
Text[0x0237] = "current config with"
Text[0x0238] = "that which is in"
Text[0x0239] = "the backup memory."
Text[0x023A] = "" -- blank line
-- Utilities Copy flight modes
Text[0x023D] = "Copy Flight Mode Settings"
Text[0x023E] = "Source Flight Mode"
Text[0x023F] = "Target Flight Mode"
Text[0x0240] = "Utilities"
-- Gain Capture Page
Text[0x024C] = "Gains will be captured on"
Text[0x024D] = "Captured gains will be"
Text[0x024E] = "Gains on"
Text[0x024F] = "were captured and changed"
Text[0x0250] = "from Adjustable to Fixed"
Text[0x0254] = "Postive = Up, Negative = Down"
--Utilities, Copy flight mode (Copy Confirmation, oveerriding FM)
Text[0x0251] = "Are you sure you want to ovewrite the \"Target\""
Text[0x0252] = "with the \"Source\" ? "
Text[0x0253] = "" -- Blank
-- First time safe setup Page 1 (maybe ask to select Flight Mode cannel)
Text[0x0255] = "Before setting up SAFE"
Text[0x0256] = "a Flight Mode channel"
Text[0x0257] = "most be configured."
--First time safe setup Page 2 (something related for flight mode)
Text[0x025A] = "Select the desired flight mode"
Text[0x025B] = "switch position to adjust settings"
Text[0x025C] = "for each flight mode"
Text[0x025D] = "" -- Blank
Text[0x025E] = "" -- Blank
--Utilities, Copy flight mode (Confirm)
Text[0x0259] = "YES"
Text[0x0260] = "WARNING: \"Target\""
Text[0x0261] = "flight mode will be overwritten"
Text[0x0262] = "by \"Source\""
Text[0x0263] = "Fixed/Adjustable Gains /c/b"
Text[0x0266] = "Heading Gain/c/b"
Text[0x0267] = "Positive = Nose Up/Roll Right"
Text[0x0268] = "Negative = Nose Down/Roll Left"
Text[0x0269] = "SAFE - Throttle to Pitch"
Text[0x026A] = "Use CAUTION for Yaw gain!/b" -- SubTitle
Text[0x8000] = "Flight Mode/c/b" --FC6250HX: 1=NORMAL 2= Stunt-1, 3=Stunt-2, 4=Hold
Text[0x8001] = "Flight Mode/c/b" --AR63X family: WAS "Flight Mode 1".. This usually is a Flight Mode w value relative to 0 (AR631/AR637)
Text[0x8002] = "Flight Mode/c/b" -- what RX does this show up??
Text[0x8003] = "Flight Mode/c/b"
--Text[0x01F8] = "Safe Mode";
List_Values[0x01F8]=safeModeOptions
end
-- Adjust the displayed value for Flight mode line as needed
@@ -1855,5 +1633,6 @@ Lib.Init = DSM_Init
Lib.Init_Text = DSM_Init_Text
Lib.SetDSMChannelInfo = DSM_SetDSMChannelInfo
Lib.Get_RxName = Get_RxName
return Lib

View File

@@ -1337,8 +1337,8 @@ local function loadMenu(menuId)
--L[#1 T=M VId=0x105E val=nil [0->0,2] Text="Other settings" MId=0x1000 ]
ctx.Menu = { MenuId = 0x1000, Text = "RX SIMULATION", PrevId = 0, NextId = 0, BackId = 0, TextId=0 }
ctx.MenuLines[0] = { MenuId = 0x1000, Type = LINE_TYPE.MENU, Text = "AR630/631/637 (NEW)", ValId = 0x1001,TextId=0 }
ctx.MenuLines[1] = { MenuId = 0x1000, Type = LINE_TYPE.MENU, Text = "AR630/631/637 (INITIALIZED)", ValId = 0x1002, TextId=0 }
ctx.MenuLines[0] = { MenuId = 0x1000, Type = LINE_TYPE.MENU, Text = "AR631 (NEW)", ValId = 0x1001,TextId=0 }
ctx.MenuLines[1] = { MenuId = 0x1000, Type = LINE_TYPE.MENU, Text = "AR631 (INITIALIZED)", ValId = 0x1002, TextId=0 }
ctx.MenuLines[4] = { MenuId = 0x1000, Type = LINE_TYPE.MENU, Text = "FC6250HX", ValId = 0x1005, TextId=0 }
ctx.SelLine = 0
@@ -1346,25 +1346,25 @@ local function loadMenu(menuId)
elseif (menuId==0x1001) then
RX_Initialized = false
ctx.RX.Id = dsmLib.RX.AR631
ctx.RX.Name = "AR630/631/637-SIM"
ctx.RX.Version = "2.38.5"
dsmLib.Init_Text(ctx.RX.Id)
ctx.RX.Name = dsmLib.Get_RxName(ctx.RX.Id)..' SIM'
ctx.RX.Version = "2.38.5"
RX_loadMenu = AR631_loadMenu
RX_loadMenu(0x01000)
elseif (menuId==0x1002) then
ctx.RX.Id = dsmLib.RX.AR631
ctx.RX.Name = "AR630/631/637-SIM"
ctx.RX.Version = "2.38.5"
dsmLib.Init_Text(ctx.RX.Id)
ctx.RX.Name = dsmLib.Get_RxName(ctx.RX.Id)..' SIM'
ctx.RX.Version = "2.38.5"
RX_loadMenu = AR631_loadMenu
RX_loadMenu(0x01000)
elseif (menuId==0x1005) then
ctx.RX.Id = dsmLib.RX.FC6250HX
ctx.RX.Name = "FC6250HX-SIM"
ctx.RX.Version = "5.6.255"
dsmLib.Init_Text(ctx.RX.Id)
ctx.RX.Name = dsmLib.Get_RxName(ctx.RX.Id)..' SIM'
ctx.RX.Version = "5.6.255"
RX_loadMenu = FC6250HX_loadMenu
RX_loadMenu(0x01000)
@@ -1380,7 +1380,7 @@ local function SIM_Send_Receive()
if ctx.Phase == PHASE.RX_VERSION then -- request RX version
ctx.RX.Name = "SIMULATOR"
ctx.RX.Version = "1.0.0"
ctx.RX.Version = "0.54"
ctx.Phase = PHASE.MENU_TITLE
ctx.Refresh_Display = true

View File

@@ -24,7 +24,7 @@
------------------------------------------------------------------------------
local DEBUG_ON, SIMULATION_ON = ... -- Get DebugON from parameters
local SETUP_LIB_VERSION = "0.53"
local SETUP_LIB_VERSION = "0.54"
local DATA_PATH = "/MODELS/DSMDATA" -- Path to store model settings files
local dsmLib = assert(loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua"))(DEBUG_ON)
@@ -193,7 +193,7 @@ local function ST_PlaneWingInit(wingType)
elseif (wingType==WING_TYPE.AIL_2_FLP_2) then
MENU_DATA[MEMU_VAR.CH_L_AIL] = PORT.PORT6
MENU_DATA[MEMU_VAR.CH_R_AIL] = PORT.PORT2
MENU_DATA[MEMU_VAR.CH_L_FLP] = PORT.PORT5
MENU_DATA[MEMU_VAR.CH_R_FLP] = PORT.PORT5
MENU_DATA[MEMU_VAR.CH_L_FLP] = PORT.PORT7
elseif (wingType==WING_TYPE.ELEVON_A) then
MENU_DATA[MEMU_VAR.CH_L_AIL] = PORT.PORT2
@@ -787,7 +787,7 @@ local function ST_LoadMenu(menuId)
ctx.MenuLines[4] = { Type = LINE_TYPE.LIST_MENU_NC, Text=leftFlapText, TextId = 0, ValId = MEMU_VAR.CH_L_FLP, Min=0, Max=9, Def=0, Val= leftFlap }
end
if (rightFlap~=nil) then
ctx.MenuLines[5] = { Type = LINE_TYPE.LIST_MENU_NC, Text=rightFlapText, TextId = 0, ValId = MEMU_VAR.CH_L_FLP, Min=0, Max=9, Def=0, Val= leftFlap }
ctx.MenuLines[5] = { Type = LINE_TYPE.LIST_MENU_NC, Text=rightFlapText, TextId = 0, ValId = MEMU_VAR.CH_R_FLP, Min=0, Max=9, Def=0, Val= rightFlap }
end
ctx.SelLine = 1

View File

@@ -0,0 +1,15 @@
-- OVERRIDES Messges for MIN 128x64 screns
-- FORMAT <LineType>|<Msg#>|<Text>
-- Line Type: Text for Menus (T), List_Text Options (LT), List_Text_Image (LI), Flight Mode (FM), RX Name (RX)
-- IMPORTANT: NO EMPTY LINES
--
T |0x0097|DONT USE: Factory Reset
T |0x0098|DONT USE: Factory Reset
T |0x00A5|DONT USE: First Time Setup
T |0x00B0|Self-Lev/Ang Dem
T |0x00CD|Level model & capt attitude
T |0x0190|DONT USE: Relearn Servo Settings
T |0x020D|DONT USE: First Time SAFE Setup
T |0x0254|Pos = Up, Neg = Down
T |0x0267|Pos = Nose Up/Roll Right
T |0x0268|Neg = Nose Down/Roll Left

View File

@@ -0,0 +1,375 @@
-- FORMAT <LineType>|<Msg#>|<Text>
-- Line Type: Text for Menus (T), List_Text Options (LT), List_Text_Image (LI), Flight Mode (FM), RX Name (RX)
-- NO EMPTY LINES
-- Formmatting at end of line: /c=Center, /r=Right, /b=Bold, /m=menu
LT|0x0001|Off
LT|0x0002|On
-- Ihn/Act List Options
LT|0x0003|Inh
LT|0x0004|Act
--
-- Channel selection for SAFE MODE and GAINS on FC6250HX
LT|0x000C|Inhibit?
LT|0x000D|Ch5
LT|0x000E|Ch6
LT|0x000F|Ch7
LT|0x0010|Ch8
LT|0x0011|Ch9
LT|0x0012|Ch10
LT|0x0013|Ch11
LT|0x0014|Ch12
--
-- Servo Output values
LT|0x002D|5.5ms
LT|0x002E|11ms
LT|0x002F|22ms
--
-- Gain Multiplier Values
LT|0x0032|1 X
LT|0x0033|2 X
LT|0x0034|4 X
--
LT|0x0035|Inh?
LT|0x0036|Thr
LT|0x0037|Ail
LT|0x0038|Ele
LT|0x0039|Rud
LT|0x003A|Ch5
LT|0x003B|Ch6
LT|0x003C|Ch7
LT|0x003D|Ch8
LT|0x003E|Ch9
LT|0x003F|Ch10
LT|0x0040|Ch11
LT|0x0041|Ch12
LT|0x0042|Ch13
LT|0x0043|Ch14
LT|0x0044|Ch15
LT|0x0045|Ch16
LT|0x0046|Ch17
LT|0x0047|Ch18
LT|0x0048|Ch19
LT|0x0049|Ch20
--
T |0x0040|Roll
T |0x0041|Pitch
T |0x0042|Yaw
T |0x0043|Gain/c/b
T |0x0045|Differential
T |0x0046|Priority
T |0x0049|Output Setup
T |0x004A|Failsafe
T |0x004B|Main Menu
T |0x004E|Position
--
T |0x0050|Outputs
T |0x0051|Output Channel 1
T |0x0052|Output Channel 2
T |0x0053|Output Channel 3
T |0x0054|Output Channel 4
T |0x0055|Output Channel 5
T |0x0056|Output Channel 6
--
-- FailSafe Options
--LT|0x005E|Inhibit
LT|0x005F|Hold Last
LT|0x0060|Preset
--LT|0x0061|Custom
--
T |0x0071|Proportional
T |0x0072|Integral
T |0x0073|Derivate
--
T |0x0078|FM Channel
--
T |0x0080|Orientation
T |0x0082|Heading
T |0x0085|Frame Rate
T |0x0086|System Setup
T |0x0087|F-Mode Setup
T |0x0088|Enabled F-Modes
T |0x0089|Gain Channel
T |0x008A|Gain Sensitivity/r -- Right Align
T |0x008B|Panic
T |0x008E|Panic Delay
--
LT|0x008D|560hz
--
-- FC6250HX: Callibration Menu -> Begin..Start, Complete, Done
T |0x0091|Begin
T |0x0090|Apply
T |0x0092|Start
T |0x0093|Complete
T |0x0094|Done
--
T |0x0097|Factory Reset
T |0x0098|Factory Reset
--
T |0x0099|Advanced Setup
T |0x009A|Capture Failsafe Positions
T |0x009C|Custom Failsafe
--
T |0x009F|Save Settings -- Save & Reboot RX
--
T |0x00A5|First Time Setup
T |0x00AA|Capture Gyro Gains
T |0x00AD|Gain Channel Select
T |0x00AF|Dynamic
T |0x00B0|Self-Level/Angle Dem
T |0x00B1|Envelope
--
-- Flight Modes List Options
LT|0x00B5|Inhibit
LT|0x00B6|FM1
LT|0x00B7|FM2
LT|0x00B8|FM3
LT|0x00B9|FM4
LT|0x00BA|FM5
LT|0x00BB|FM6
LT|0x00BC|FM7
LT|0x00BD|FM8
LT|0x00BE|FM9
LT|0x00BF|FM10
--
T |0x00BE|Unknown_BE -- Used in Reset menu (0x0001) while the RX is rebooting
--
T |0x00C7|Calibrate Sensor
T |0x00CA|SAFE/Panic Mode Setup
--
T |0x00CD|Level model and capture attitude/m -- SPECIAL MENU to itself who is not a comment
--
-- RX Orientations for AR631/AR637, Optionally attach an Image + Alt Text to display
LT|0x00CB|Pos 1
LI|0x00CB|rx_pos_1.png|Pilot View: RX Label Up, Pins Back
LT|0x00CC|Pos 2
LI|0x00CC|rx_pos_2.png|Pilot View: RX Label Left, Pins Back
LT|0x00CD|Pos 3
LI|0x00CD|rx_pos_3.png|Pilot View: RX Label Down, Pins Back
LT|0x00CE|Pos 4
LI|0x00CE|rx_pos_4.png|Pilot View: RX Label Right, Pins Back
LT|0x00CF|Pos 5
LI|0x00CF|rx_pos_5.png|Pilot View: RX Label UP, Pins to Front
LT|0x00D0|Pos 6
LI|0x00D0|rx_pos_6.png|Pilot View: RX Label Left, Pins Front
LT|0x00D1|Pos 7
LI|0x00D1|rx_pos_7.png|Pilot View: RX Label Down, Pins Front
LT|0x00D2|Pos 8
LI|0x00D2|rx_pos_8.png|Pilot View: RX Label Right, Pins Front
LT|0x00D3|Pos 9
LI|0x00D3|rx_pos_9.png|Pilot View: RX Label Up, Pins Left
LT|0x00D4|Pos 10
LI|0x00D4|rx_pos_10.png|Pilot View: RX Label Back, Pins Left
LT|0x00D5|Pos 11
LI|0x00D5|rx_pos_11.png|Pilot View: RX Label Down, Pins Left
LT|0x00D6|Pos 12
LI|0x00D6|rx_pos_12.png|Pilot View: RX Label Front, Pins Left
LT|0x00D7|Pos 13
LI|0x00D7|rx_pos_13.png|Pilot View: RX Label Up, Pins Right
LT|0x00D8|Pos 14
LI|0x00D8|rx_pos_14.png|Pilot View: RX Label Back, Pins Right
LT|0x00D9|Pos 15
LI|0x00D9|rx_pos_15.png|Pilot View: RX Label Down, Pins Right
LT|0x00DA|Pos 16
LI|0x00DA|rx_pos_16.png|Pilot View: RX Label Front, Pins Right
LT|0x00DB|Pos 17
LI|0x00DB|rx_pos_17.png|Pilot View: RX Label Back, Pins Down
LT|0x00DC|Pos 18
LI|0x00DC|rx_pos_18.png|Pilot View: RX Label Left, Pins Down
LT|0x00DD|Pos 19
LI|0x00DD|rx_pos_19.png|Pilot View: RX Label Front, Pins Down
LT|0x00DE|Pos 20
LI|0x00DE|rx_pos_20.png|Pilot View: RX Label Right, Pins Down
LT|0x00DF|Pos 21
LI|0x00DF|rx_pos_21.png|Pilot View: RX Label Back, Pins Up
LT|0x00E0|Pos 22
LI|0x00E0|rx_pos_22.png|Pilot View: RX Label Left, Pins Up
LT|0x00E1|Pos 23
LI|0x00E1|rx_pos_23.png|Pilot View: RX Label Front, Pins Up
LT|0x00E2|Pos 24
LI|0x00E2|rx_pos_24.png|Pilot View: RX Label Right, Pins Up
LT|0x00E3|Pos Invalid
LI|0x00E3|rx_pos_25.png|Cannot detect orientation of RX
--
T |0x00D1|Receiver will Reboot/b
T |0x00D2|Panic Channel
T |0x00D3|Swashplate
T |0x00D5|Agility
T |0x00D8|Stop
T |0x00DA|SAFE/c/b -- Center + Bold
T |0x00DB|Stability
T |0x00DC|@ per sec
T |0x00DD|Tail rotor
T |0x00DE|Setup
T |0x00DF|AFR
T |0x00E0|Collective
T |0x00E1|Subtrim
T |0x00E2|Phasing
T |0x00E4|E-Ring
T |0x00E5|Swash Type
T |0x00E6|Travel
T |0x00E7|Left
T |0x00E8|Right
--
LT|0x00F2|Fixed
LT|0x00F3|Adjustable
--
T |0x00F6|Direction
T |0x00F8|Settings -- ?? validate on a Spektrum radio
T |0x00F9|Gyro settings
T |0x00FE|Stick Priority/c/b
--
T |0x0100|Make sure the model has been
T |0x0101|configured, including wing type,
T |0x0102|reversing, travel, trimmed, etc.
T |0x0103|before continuing setup.
T |0x0104| -- Blank
--
T |0x0106|Any wing type, channel assignment,
T |0x0107|subtrim, or servo reversing changes
T |0x0108|require running through initial
T |0x0109|setup again.
T |0x010A| -- Blank
--
T |0x0190|Relearn Servo Settings
T |0x019C|Enter Receiver Bind Mode
T |0x01AA|Offset
T |0x01D7|SAFE Select Channel
T |0x01DC|AS3X/c/b -- Center + Bold
T |0x01DD|AS3X Settings
T |0x01DE|AS3X Gains
T |0x01E0|Rate Gains/c/b
T |0x01E2|SAFE Settings
T |0x01E3|SAFE Gains
T |0x01E6|Attitude Trim/c/b
T |0x01E7|Envelope
T |0x01E9|Roll Right
T |0x01EA|Roll Left
T |0x01EB|Pitch Down
T |0x01EC|Pitch Up
T |0x01EE|Thr to Pitch
T |0x01EF|Low Thr to Pitch/c/b
T |0x01F0|High Thr to Pitch/c/b
T |0x01F3|Threshold
T |0x01F4|Angle
T |0x01F6|Failsafe Angles/c/b
T |0x01F8|Safe Mode
T |0x01F9|SAFE Select
T |0x01FC|Panic F-Mode
T |0x01FD|FailSafe Flight Mode -- Safe Flight Mode
T |0x0201|Throttle
T |0x0204|Hover
T |0x0208|Decay
T |0x0209|Save to Backup
T |0x020A|Restore from Backup
T |0x020D|First Time SAFE Setup
--
-- First time safe setup Page 3 :
T |0x020E|AS3X gains must be tuned
T |0x020F|and active in SAFE Flight Modes
T |0x0210|to help reduce wobble.
T |0x0211| -- Blank
T |0x0212| -- Blank
T |0x0213| -- Blank
--
-- AS3X orientation Setting menu (Level)
T |0x021A|Set the model level,
T |0x021B|and press Continue.
T |0x021C| -- Blank
T |0x021D| -- Blank
--
-- AS3X orientation Setting menu (Nose down)
T |0x021F|Set the model on its nose,
T |0x0220|and press Continue. If the
T |0x0221|orientation on the next
T |0x0222|screen is wrong go back
T |0x0223|and try again.
--
T |0x0224|Continue
T |0x0226|Angle Limits/c/b
T |0x0227|Other settings
T |0x0229|Set Orientation Manually
--
-- Factory Default Warning
T |0x022B|WARNING!
T |0x022C|This will reset the
T |0x022D|configuration to factory
T |0x022E|defaults. This does not
T |0x022F|affect the backup config.
T |0x0230| -- Blank
--
-- Backup Warning
T |0x0231|This will overwrite the
T |0x0232|backup memory with your
T |0x0233|current configuartion.
T |0x0234| -- Blank
T |0x0235| -- Blank
--
-- Restore from Backup Warning
T |0x0236|This will overwrite the
T |0x0237|current config with
T |0x0238|that which is in
T |0x0239|the backup memory.
T |0x023A| -- blank line
--
-- Utilities Copy flight modes
T |0x023D|Copy F-Mode Settings
T |0x023E|Source F-Mode
T |0x023F|Target F-Mode
--
T |0x0240|Utilities
--
-- Gain Capture Page
T |0x024C|Gains will be captured on
T |0x024D|Captured gains will be
T |0x024E|Gains on
T |0x024F|were captured and changed
T |0x0250|from Adjustable to Fixed
--
-- Utilities, Copy flight mode (Copy Confirmation, oveerriding FM)
T |0x0251|Are you sure you want to ovewrite the "Target"
T |0x0252|with the "Source" ?
T |0x0253| -- Blank
--
T |0x0254|Postive = Up, Negative = Down
--
-- First time safe setup Page 1 (maybe ask to select Flight Mode cannel)
T |0x0255|Before setting up SAFE
T |0x0256|a Flight Mode channel
T |0x0257|most be configured.
--
-- First time safe setup Page 2 (something related for flight mode)
T |0x025A|Select the desired flight mode
T |0x025B|switch position to adjust settings
T |0x025C|for each flight mode
T |0x025D| -- Blank
T |0x025E| -- Blank
--
-- Utilities, Copy flight mode (Confirm)
T |0x0259|YES
T |0x0260|WARNING: "Target"
T |0x0261|F-Mode will be overwritten
T |0x0262|by "Source"
--
T |0x0263|Fixed/Adjustable Gains/c/b
T |0x0266|Heading Gain/c/b
T |0x0267|Positive = Nose Up/Roll Right
T |0x0268|Negative = Nose Down/Roll Left
T |0x0269|SAFE - Thr to Pitch
T |0x026A|Use CAUTION for Yaw gain!/b
--
T |0x0300|No compatible DSM RX...
T |0x0301|Waiting for RX to Restart
--
FM|0x8000|Flight Mode/c/b
--
RX|0x0001|AR636
RX|0x0014|SPM4651T
RX|0x0015|AR637T
RX|0x0016|AR637TA
RX|0x0018|FC6250HX
RX|0x0019|AR630
RX|0x001A|AR8360T
RX|0x001B|AR8020T
RX|0x001C|AR10360T
RX|0x001E|AR631

View File

@@ -4,7 +4,7 @@ Rewrite/Enhancements by: Francisco Arzu
Thanks to all the people volunteered to test it.
# Introduction (v0.53)
# Introduction (v0.54)
This script library enhances the original DSM Forward Programming tool. DSM Forward Programming is needed to setup many of the new Spektrum Receivers with Gyro AS3X/SAFE features. For the Gyro (/Safe) to correct the plane in flight, it needs to move the right surfaces therefore the RX needs to know the configuration of the plane (Wing Type, Tail Type, Mixers, Servo Assignments, Servo Reverse). That info tells the RX where the aileron(s) are (one or two), where the elevator(s) are (one or two), V-Tail, Delta Wing, etc.
@@ -13,15 +13,31 @@ Since EdgeTx/OpenTx doesnt have an equivalent setup that is stored in the rad
During `"Gyro Settings->initial setup"`, the RX asks the TX for model information behind the scenes. After setup, `"Gyro Settings->System Tools-> Relearn Servo Settings"` requests the TX configuration and stores it in the RX.
# Deployment
Make sure to manually create `/MODELS/DSMDATA` . The script will complain at startup.
Make sure to manually create `/MODELS/DSMDATA` . The script will complain at startup if it does not exist. Here the script saves the Spektrun settings for each of your models.
/SCRIPTS/TOOLS/DsmFwdPrg_05_BW.lua -- black/white text only radios
/SCRIPTS/TOOLS/DsmFwdPrg_05_Color.lua -- Color and touch radios
/SCRIPTS/TOOLS/DSMLIB/ -- (ALL CAPITALS) Libraries ane extra files
/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua -- DSM Protocol Message and Menu engine
/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgSIMLib.lua -- Simulation of AR631, FC6250HX
/SCRIPTS/TOOLS/DSMLIB/SetupLib.lua -- Model Setup Screens
/SCRIPTS/TOOLS/DSMLIB/img --Images for RX orientations
Uncompress the Zip file (ZIP version) into your local computer.
In another window, open your TX SDCard and go to /SCRIPTS/TOOLS.
When upgrading from a previous version of this tool, delete your /SCRIPTS/TOOLS/DSMLIB before copying the new one (if you customized your images, inside "DSMLIB/img" do a backup first)
Copy the entire DSMLIB folder.
Copy the main script you want to use (Color or B&W).
Your TX SDCard should looks like this:
/SCRIPTS/TOOLS
DSM FwdPrg_05_BW.lua -- black/white text only
DSM FwdPrg_05_Color.lua -- Color and touch radios
DSM FwdPrg_05_MIN.lua -- `NEW!` Minimalistic version for radios with LOW memory (cannot setup new planes)
/SCRIPTS/TOOLS/DSMLIB/ -- (ALL CAPITALS) Libraries ane extra files
DsmFwPrgLib.lua -- DSM Protocol Message and Menu engine
DsmFwPrgSIMLib.lua -- Simulation of AR631, FC6250HX (For GUI development)
SetupLib.lua -- Model Setup Screens
msg_fwdp_en.txt -- `NEW!` Messages for forward programing externalized. To support other langs
/SCRIPTS/TOOLS/DSMLIB/img -- Images for RX orientations
Other Directories
@@ -32,35 +48,37 @@ When upgrading from a previous version of this tool, delete your /SCRIPTS/TOOLS/
# Common Questions
1. `RX not accepting channels higher than Ch6 for Flight-mode o Gains:`
V0.53 improve this.. you can select any channel now. Additionally, if you already mapped the Switch to the channel, togling once the switch will select the channel on the menu field.
<s>V0.52 and prior: The RX corrects your channel to ch5 or ch6. This means that the RX is not
detecting the upper channels from the TX. You need to exercise (move the switch) so that the RX detects it. Put the Channel Field on edit (changing) mode, change it to Ch7 (or any other), flip the switch for Ch7 3 times, now confirm the edit. The RX now will not reject it. All Spektrum RX are 20 channels internally, even if it only has 6 external Ch/Ports to connect servos. </s>
V0.53 and newer: The RX is listening to channel changes for this options. Configure the Switch to the channel, togling once the switch will select the channel on the menu field.
2. `Why Ch1 says Ch1 (TX:Ch3/Thr)?`:
Radios with Multi-Module are usually configured to work the standard AETR convention. Spektrum uses TAER. The multi-module does the conversion when transmitting the signals. So `Spektrum Ch1 (Throttle)` really comes from the `TX Ch3`. We show both information (+name from the TX output). If your multi-module/radio is setup as TAER, the script will not do the re-arrangement.
3. `If i change the model name, the original model settings are lost.` This is correct, the model name is used to generate the file name (inside /MODEL/DSMDATA) who stores the model configuration. Currently EdgeTx and OpenTX has differt features where i could get either the Model Name or the YAML file where the EdgeTX model configuration is stored.. to keep the code compatible, the model name is used.
4. `Reversing a channel in my TX do not reverse the AS3X/SAFE reaction.` Correct, the chanel stick direction and the Gyro direction are two separate things.
4. `Reversing a channel in my TX do not reverse the AS3X/SAFE reaction.` Correct, the channel stick direction and the Gyro direction are two separate things.
4.1: First, you have setup your model so that the sticks and switches moves the surfaces in the right direction.
4.2: Go to the script, `Model Setup` and setup your wing type, tail type, and select the channel assigment for each surface. Leave the servo settings the same as the values in the TX to start.
4.3: AR63X family: Go to `Forward programming->Gyro Setting->Initial Setup` (New/factory reset), or `Forward programming->Gyro Setting->System Setup->Relearn Servo Settings` (not new). This will load your urrent Gyro servo settings into the plane's RX.
4.3: AR63X family: Go to `Forward programming->Gyro Setting->Initial Setup` (New/factory reset), or `Forward programming->Gyro Setting->System Setup->Relearn Servo Settings` (not new RX). This will load your current Gyro servo settings into the plane's RX.
4.4: Verify that the AS3X and SAFE reacts in the proper direction. You can use the Flight mode confugured as "Safe Mode: Auto-Level" to see if it moves the surfaces in the right direction.
4.5: If a surface don't move in the right direction, go to the `Model Setup->Gyro Channel Reverse` to reverse the Gyro on the channels needed, and do again the `Forward programming->Gyro Setting->System Setup->Relearn Servo Settings` to tranfer the new settings to the RX.
4.6: Specktrum TX always passes the TX servo reverse as the Gyro Reverse, but on many OpenTX/EdgeTX radios, the Rud/Ail are usually reversed by default compared to Specktrum. So far i don't think that i can use this as a rule, that is why the `Gyro Channel Reverse` page exist.
---
---
# Changes and fixes
V0.54:
1. Fix a problem in the Attitude Trim page (`Gyro Settings->System Setup->SAFE/Panic Setup->Attitude Trim`). It was not saving the values after exiting the menu. This is to change what SAFE considers "Level" flying.
2. Wings 2-Ail 2-Flaps had a bug on the 2nd flap.
3. New Minimalistic script (`DsmFwdPrg_05_MIN.lua`): For radios with very low memory (FrSky QX7, RM Zorro, others). It can only change existing settings, but does not have the Plane Setup menus to setup a completly new plane. In some radios, the very first time it runs (compile + run), it might give you a `not enouth memory` error.. try to run it again.
4. External menu message file (DSMLIB/msg_en.txt and msg_MIN_es.txt). Intial work to do localization and different languages.
V0.53:
1. Improved channel selection (Flight mode, Panic Channel, Gains Channel). Now during editing a channel, you can select any channel (>Ch4). Also, of you toggle the switch/channel it will populate the screen.
2. Support for smaller screens (128x64) in B&W. The problem with this older radios is memory. In some, it does not have enouth memory to load the additional DSMLIB libraries.
@@ -73,17 +91,15 @@ V0.52:
4. Write Log of the conversation between RX/TX. To be used for debugging a problem is reported.
5. Provide a simulation of RX to do GUI development in Companion, and understand patterns of how the data is organized.
# Tested RXs
# Tested Hardware
- AR631/AR637xx
- FC6250HX (Blade 230S V2 Helicopter)
- AR636 (Blade 230S V1 Heli firmware 4.40)
Please report if you have tested it with other receivers to allow us to update the documentation. Code should work up to 10 channels for the main surfaces (Ail/Ele/etc). All Spektrum RX are internally 20 channels, so you can use Ch7 for Flight Mode even if your RX is only 6 channels (See common Questions)
- Radiomaster TX16S (All versions)
- FrSky QX7, Radimaster Boxter (Minimalistic version)
# Flight mode/Gain channels
Fixed in version 0.53. no longer a tick to select it.
<s>I ran into a case where trying to set Aux2 or Aux3 for flight mode, but the RX was correcting it to Aux1.. the RX only was allowing Gear or Aux1 (AR631/AR637).
This is because the RX doesnt know that we are using more than 6 channels. To make the RX aware that there are other channels, while editing the channel, you have to toggle the switch to exercise the channel (3 times), and now the RX will recognize it.</s>
Please report if you have tested it with other receivers to allow us to update the documentation. Code should work up to 10 channels for the main surfaces (Ail/Ele/etc). All Spektrum RX are internally 20 channels, so you can use Ch7 for Flight Mode even if your RX is only 6 channels (See common Questions)
# Messages Displayed in the GUI
@@ -91,6 +107,8 @@ This is because the RX doesnt know that we are using more than 6 channels. T
If in a screen you get text that looks like `Unknown_XX` (ex: Unknown_D3), that message has not been setup in the script in english. If you can determine what the proper message is, you can send us a message to be added to the library.
The `XX` represents a Hex Number (0..9,A..F) message ID.
### Version 0.53 and older:
If you want to fix it in your local copy, all messages are towards the end in the file `SCRIPT\TOOS\DSMLIB\DsmFwPrgLib.lua`. Messages for Headers are stored in `Text` and messages for Options are stored in `List_Text`. Lua scripts are text files, and can be edited with Notepad or equivalent.
Portion of DsmFwPrgLib.lua:
@@ -121,6 +139,12 @@ For example, if you get `Unknown_9D` in the GUI and your now that it should say
Text[0x009F] = "Save & Reset RX" -- TODO: Find the proper Spektrum text
### Version 0.54 and newer:
The menu messages are stored in DSMLIB/msg_fwdp_en.txt (For english). Just add the message there. MIN_msg_fwdp_en.txt has shorter messages overrides for screens who are smaller (for minimalistic 128x64 version). The reference to the message file is at the file `/DSMLIB/DsmFwPrgLib.lua` if you want to change to use another language.
T |0x0097|Factory Reset
LT|0x00B0|Self-Level/Angle Dem
LT|0x00B1|Envelope
# LOG File
@@ -143,30 +167,9 @@ Example Log:
5.970 MENU_LINES: RESPONSE MenuLine: L[#3 T=M VId=0x1022 Text="System Setup"[0x86] MId=0x1010 ]
6.020 MENU_LINES: SEND DSM_getNextLine(MenuId=0x1010,LastLine=3
Example of the Unknown_0x05 Lines correctly processed (receiving lines 0..5):
0.130 MENU_TITLE: SEND DSM_getMainMenu()
0.230 MENU_TITLE: RESPONSE Menu: M[Id=0x1000 P=0x0 N=0x0 B=0x0 Text="Main Menu"[0x4B]]
0.280 MENU_LINES: SEND DSM_getFirstMenuLine(MenuId=0x1000)
0.400 MENU_LINES: RESPONSE MenuUknownLine_0x05: LineNum=0 DATA=RX: 09 05 00 01 00 00 00 07 00 00 00 00 00 00 00 00
0.460 MENU_UNKNOWN_LINES: CALL DSM_getNextUknownLine_0x05(LastLine=0)
0.550 MENU_UNKNOWN_LINES: RESPONSE MenuUknownLine_0x05: LineNum=1 DATA=RX: 09 05 01 01 00 00 00 07 00 00 00 00 00 00 00 00
0.600 MENU_UNKNOWN_LINES: CALL DSM_getNextUknownLine_0x05(LastLine=1)
0.700 MENU_UNKNOWN_LINES: RESPONSE MenuUknownLine_0x05: LineNum=2 DATA=RX: 09 05 02 01 00 00 00 07 00 00 00 00 00 00 00 00
0.760 MENU_UNKNOWN_LINES: CALL DSM_getNextUknownLine_0x05(LastLine=2)
# Validation of data by the RX
<s>When you change a value in the GUI, the RX validates that the value is valid.
For example, I ran into a case where trying to set Aux2 or Aux3 for flight mode, but the RX was correcting it back to Aux1.. the RX only was allowing Gear or Aux1 (AR631/AR637).. in this case, toggle the Switch while editing it on the screen.
If you go to the logs, you can see that the RX was correcting the value:
20.520 VALUE_CHANGE_END: SEND DSM_updateMenuValue(ValueId=0x1000,val=7) Extra: Text="FM Channel" Value=7|"Aux2"
20.570 VALUE_CHANGE_END: SEND DSM_validateMenuValue(ValueId=0x1000) Extra: Text="FM Channel" Value=7|"Aux2"
20.680 VALUE_CHANGE_END: RESPONSE MenuValue: UPDATED: L[#0 T=L_m1 VId=0x1000 Text="FM Channel"[0x78] Val=6|"Aux1" NL=(0->32,0,S=53) [53->85,53] MId=0x7CA6 ]
</s>
The RX validates the data. if you change to an invalid channel or do a invalid number range, the RX will change it at the end of editing the field.
---
# Version 0.53
@@ -202,15 +205,17 @@ If you go to the logs, you can see that the RX was correcting the value:
### Some settings that can change (top of Lua file):
SIMULATION_ON = false -- FALSE: use real communication to DSM RX (DEFAULT), TRUE: use a simulated version of RX
SIMULATION_ON = false -- FALSE: hide similation menu (DEFAULT), TRUE: show RX simulation menu
DEBUG_ON = 1 -- 0=NO DEBUG, 1=HIGH LEVEL 2=LOW LEVEL (Debug logged into the /LOGS/dsm_log.txt)
DEBUG_ON_LCD = false -- Interactive Information on LCD of Menu data from RX
USE_SPECKTRUM_COLORS = true -- true: Use spectrum colors, false: use theme colors (default on OpenTX, OpenTX handle colors different)
### Known Problems:
1. **Incorrect List Value Options:** Some Menu List line (`LINE_TYPE.LIST_MENU1` or `L_m1` in logs), the range (min/max) of valid values seems to be incorrect, but cannot see in the data how to fix it.
Some of the valid values are not even sequential, very spread apart. There has to be a list of valid options somewhere. Currently fixed some by overriding the valid values in the script code (config for each field).
1. **Incorrect List Value Options:** Some Menu List line (`LINE_TYPE.LIST_MENU1` or `L_m1` in logs), the range (min/max) of valid values seems to be incorrect, but the RX corrects the values.
in the MINimalistic version, the RX is doing all the range validation, and will show invalid options temporarilly. In an Spektrum radio, it happens so fast, that you don't notice it, but in LUA scripts who are slower, you can see it in the screen.
In the COLOR version, The code has hardcoded the valid ranges to avoid this problem.
2. Glider/Heli/Drone wing types not ready.