Skip to content

system.getVersion

since 1.1.0

Return Ethos version.

system.getVersion()

Parameters

None.

Returns

Table with elements:

  • board (string) board name, i.e. "X20S"
  • version (string) version
  • major (number) version major (i.e. 1 if version is "1.2.0-RC1")
  • minor (number) version minor (i.e. 2 if version is "1.2.0-RC1")
  • revision (number) version revision (i.e. 0 if version is "1.2.0-RC1")
  • suffix (string) version suffix (i.e. "RC1" if version is "1.2.0-RC1")
  • lcdWidth (number) LCD Width
  • lcdHeight (number) LCD Height
  • simulation (boolean)
  • serial (string)

Examples

local v = system.getVersion()
print(v.board, v.version, v.major, v.minor, v.revision, v.lcdWidth, v.lcdHeight, v.simulation)

-- feature gate: 1.6 or newer (26.x counts as newer)
local function atLeast(major, minor)
  return v.major > major or (v.major == major and v.minor >= minor)
end

-- behave differently in the simulator (e.g. fake telemetry)
if v.simulation then
  -- ...
end

Prefer feature checks (if system.getSources then) over version checks where possible: they also work on builds you didn't anticipate.

Used in

Real-world usage

Called 67 times across 9 open-source Ethos Lua projects. A few short excerpts:
env = system.getVersion()

src/rfsuite/lib/utils.lua:87

local res = system.getVersion()

src/dashx/app/modules/logs/logs_view.lua:47

local version = system.getVersion()

src/ofs3/widgets/dashboard/lib/utils.lua:464