Skip to content

getVersion

getVersion()

Return OpenTX version

Parameters

None.

Returns

Name Type Description
- string OpenTX version (ie "2.1.5")
opentx_version_ie_2 string OpenTX version (ie "2.1.5")
radio_type_x12s_x10_x9e_x9d_x9d_or_x7 string radio type: x12s, x10, x9e, x9d+, x9d or x7.
major_version_ie_2_if_version_2 integer major version (ie 2 if version 2.1.5)
minor_version_ie_1_if_version_2 integer minor version (ie 1 if version 2.1.5)
revision_number_ie_5_if_version_2 integer revision number (ie 5 if version 2.1.5)
os_name_i string OS name (i.e. EdgeTX or nil if OpenTX)

Availability

  • Since: 2.0.0
  • Radio support: all

Source

radio/src/lua/api_general.cpp

Extended Description

runtime.get-version keeps one docs page even if the preferred callable name changes over time. The generated API truth shows the current symbol, while older names remain documented here as compatibility guidance.

Examples

This example shows the multi-value form used in modern EdgeTX releases such as 2.4.0:

local function run(event)
  local ver, radio, maj, minor, rev, osname = getVersion()
  print("version: "..ver)
  if radio then print("radio: "..radio) end
  if maj then print("maj: "..maj) end
  if minor then print("minor: "..minor) end
  if rev then print("rev: "..rev) end
  if osname then print("osname: "..osname) end
  return 1
end

return { run=run }

Output of the above script in simulator:

version: 2.4.0
radio: tx16s-simu
maj: 2
minor: 4
rev: 0
osname: EdgeTX

Compatibility Notes

Keep the preferred callable name in generated API metadata and use this page for return-shape clarification and examples.