Add support for dynamic route metric switching in bt-tether plugin#407
Open
PapiJalopy wants to merge 4 commits intojayofelony:noaifrom
Open
Add support for dynamic route metric switching in bt-tether plugin#407PapiJalopy wants to merge 4 commits intojayofelony:noaifrom
PapiJalopy wants to merge 4 commits intojayofelony:noaifrom
Conversation
Adds a new option to the bt-tether.py plugin that allows users to dynamically set the route metric for the Bluetooth connection using a prefer-bluetooth option in config.toml. Added a prefer-bluetooth config option (defaults to false) If prefer-bluetooth = true, Bluetooth is given a lower route metric to take priority over USB. Maintains the original behavior if the setting is not enabled This allows choosing the preferred tethering interface without needing to manually edit metric priorities. Allows users to SSH over USB while tethered via Bluetooth. Tested and working with both Bluetooth and USB interfaces active, system correctly prioritizes the selected route. Signed-off-by: Jalopy <169272449+PapiJalopy@users.noreply.github.com>
Add new config option for bt-tether Signed-off-by: Jalopy <169272449+PapiJalopy@users.noreply.github.com>
- Add prefer-bluetooth option selection in wizard - Corrected formatting of [main.plugins.bt-tether] block in config.toml by removing extra "/n". TOML will think that it is the end of the section, so anything after it without a new header is treated as top-level. Signed-off-by: Jalopy <169272449+PapiJalopy@users.noreply.github.com>
version and typo Signed-off-by: Jalopy <169272449+PapiJalopy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds a new option to the bt-tether.py plugin that allows users to dynamically set the route metric for the Bluetooth connection using a prefer-bluetooth option in config.toml.
Added a prefer-bluetooth config option (defaults to false)
If prefer-bluetooth = true, Bluetooth is given a lower route metric to take priority over USB. Maintains the original behavior if the setting is not enabled. This allows choosing the preferred tethering interface without needing to manually edit metric priorities.
Allows users to SSH over USB while tethered via Bluetooth.
Added prefer-bluetooth selection to wizard
Fixed [main.plugins.bt-tether] formatting in cli.py, removed extra new line (\n) between the [main.plugins.bt-tether] header and its config options. TOML will think that it is the end of the section, so anything after it without a new header is treated as top-level.
Tested and working with both Bluetooth and USB interfaces active, system correctly prioritizes the selected route.
Motivation and Context
This change gives users more control in how their Pwnagotchi connects to the internet. Before this change, Bluetooth tethering always received a higher route metric, making USB the preferred interface when tethered by both Bluetooth and USB. Now a config.toml option lets you switch priorities without manual editing.
Addresses #405
How Has This Been Tested?
Enabled and disabled prefer-bluetooth in config.toml
Verified that the the correct metric is applied to the Bluetooth interface with "ip route; cat /etc/resolv.conf; ping -c 2 8.8.8.8; ping -c 2 google.com"
Made sure default behavior is not affected when the option is not enabled.
Double checked routing, DNS resolution, and SSH access over USB while Bluetooth tether is being used.
Tested cli.py script (modified the old cli.py with old TOML parser and format so I could test on my device, but changes are basically the same other than the key name format)
Tested on Raspberry Pi Zero 2W running latest release 2.9.5.3
Types of changes
Checklist:
git commit -s