Add config option to disable TX backpack #2054
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a Lua config option to disable the TX Backpack on hardware where the backpack's enable pin is wired to the main MCU. Disabling the Backpack saves ~80mA @ 3.3V.
Details
We all love our backpacks and VTX admin, but what if we didn't? The backpack always has its wifi block running and therefore pulls quite a bit of power. On the OG Zorro hardware, it consumes 0.36W (13% total handset power), and on the Boxer it is a little less, at 0.28W (14% total handset power). For weirdos who are like "idgaf about backpak", I offer an option to just turn it off entirely in software.
The option is under
> Backpack
in the Lua and is justBackpack: Off/On
(default On). Setting it to Off will change the display of all Backpack sub-options to "Disabled" (although their configured values are retained). The user is prevented from changing the values of any of the suboptions as long as the backpack is disabled.This is available on anything that has a
GPIO_PIN_BACKPACK_EN
, which are:Config changes
This uses an unused bit in the main config struct, which is defaulted to 0 already so the option is backpackDisabled (instead of the logical backpackEnabled). On ESP32, because the config loader checks for the presence of the item, there's no need to increment the config version. If the value isn't there, it will just stay the default of backpackDisabled = 0. Dumber platforms that use the struct get 0 default as well due to the entire struct being set to 0 to start.
FAQ
Why didn't you make it "On a switch" so the backpack can be disabled when armed or just turned on to change VTX channels? Wouldn't that be super useful?
It would be! Unfortunately, our Lua script has already exceeded the tipping point for using too much RAM and frequently OOM crashes on some handsets. Adding a select with all the switch names and positions in it is a massive RAM hog. Even adding this makes me a bit nervous. We can revisit this when the Lua is rewritten at some point.
What about devices without a BACKPACK_EN pin, maybe a software solution?
Yes, that would be a good idea too. At some point a more formal CRSF-based backpack protocol should be realized, which would allow setting the mode of the backpack: Wifi Telemetry Mode (telem mirror over wifi AP from the backpack, VTX (current mode), Disabled (ESP deep sleep). The complexity of creating such a system touches a lot of code in both this and the backpack project. The Disabled mode would also be somewhat janky because once it is in deep sleep, it can't receive the serial command to take it out of that mode. The user is stuck rebooting if they want to change it from Disabled to anything else.