Skip to content

lua-howto: document the Antenna Group receiver setting - #555

Draft
MUSTARDTIGERFPV wants to merge 1 commit into
ExpressLRS:masterfrom
MUSTARDTIGERFPV:lua-antenna-group
Draft

lua-howto: document the Antenna Group receiver setting#555
MUSTARDTIGERFPV wants to merge 1 commit into
ExpressLRS:masterfrom
MUSTARDTIGERFPV:lua-antenna-group

Conversation

@MUSTARDTIGERFPV

Copy link
Copy Markdown
Member

Ant. Group was added in 4.1 and has no documentation on the site. It sits directly next to Antenna Mode in the receiver settings and the two are easy to confuse, so the new section is placed after Antenna Mode and states the difference explicitly.

Verified behavior

Documented Source
Options are exactly External and Builtin luaAntennaGroup in RXParameters.cpp, option string "External;Builtin"
Only appears on receivers with the pin defined registration is wrapped in if (GPIO_PIN_ANT_GROUP != UNDEF_PIN)
Takes effect immediately, no reboot digitalWrite(GPIO_PIN_ANT_GROUP, config.GetAntennaGroup()) is inside updateDiversity() in rx_main.cpp, which runs continuously rather than only at boot
Stored with the model, survives a power cycle RxConfig::SetAntennaGroup sets EVENT_CONFIG_MODEL_CHANGED
New in 4.1 introduced by the antenna group Lua option and pin definition commits; git tag --contains returns only 4.1.0 and 4.1.0-RC1

Naming note for reviewers

There is an inconsistency in the firmware that I did not carry into the docs. The Lua parameter offers External;Builtin, but the Hardware Layout schema describes the same pin as selecting "internal/external antenna port(s)". The page uses the Lua labels, since those are what the user actually sees in the script and the Web UI. Worth aligning upstream at some point.

I did not state a default. The field is a 1 bit config value and is not explicitly initialised in SetDefaults, so while it is almost certainly External, that follows from struct zeroing rather than from anything explicit, and it did not seem worth asserting.

Ant. Group was added in 4.1 and has no documentation. It sits next to
Antenna Mode in the receiver settings, and the two are easy to confuse,
so the new section states the difference.

Facts are from RXParameters.cpp and rx_main.cpp:

- The options are exactly External and Builtin.
- The parameter is only registered when GPIO_PIN_ANT_GROUP is defined,
  so it does not appear on most receivers.
- The pin is written in updateDiversity(), which runs continuously, so
  a change applies at once with no reboot.
- SetAntennaGroup raises EVENT_CONFIG_MODEL_CHANGED, so the value is
  stored with the model and survives a power cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant