Skip to content

BT-Tether update#346

Open
fmatray wants to merge 62 commits intojayofelony:noaifrom
fmatray:noai
Open

BT-Tether update#346
fmatray wants to merge 62 commits intojayofelony:noaifrom
fmatray:noai

Conversation

@fmatray
Copy link
Contributor

@fmatray fmatray commented Feb 22, 2025

BT-tether rework to handle correctly the bluetooth connection

Description

  • Handle Kernel BT drivers bug, some bluetooth service issues and different edge cases
  • 2 threads: Bt-tether(Plugin) and BTManager(Thread) => No more blocking during ui-update
  • Add options:
    • autoconnect => configure the connection/device as autoconnect
    • internet => configure the phone as a gateway
  • Improve UI and Web display

Motivation and Context

It mainly resolve several BT connections issues

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

Only tested with raspberry zero 2W and IPhone, during a week with several options on/off (autoconnect, dns, internet).
I forced the BT on and off to see is the connection follow on the pwnagotchi.
I waited for the kernel issue to trigger and watch if the plugin was able to reload everything correctly.

Not tested:

  • Android: But there is no new specific IOS/Android item
  • Bananapi: Don't know if the kernel issue happen

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. -> only default.toml. pwnagotchi.org should be updated too.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

fmatray and others added 25 commits February 18, 2025 20:07
- split plugins configuration and connection configuration
- check BT config during on_config_checged()
- check connection before trying to up it
- move on_ui_update() with new functions
- Add device/connextion status
- Remove unecessary BT messages/status
- add sleep
- BTteher only handle reading the config, starting BTManager et ui calls
- BTManager is a separate Thread handeling:
  - Network configuration
  - Kernel watchdog: reloads kernel modules
  - Connection up, if needed
  - Disconnection on exit
- refactor webhook()
- restart bluetooth during config to remove edge cases
@AWWShuck
Copy link

have tested this and found that when the BT stack does crash this brings it back almost instantly now.. Great update! Testing with an iphone and a BT GPS serial device and a tcp GPS connection to phone. previous version would lose BT connection and stack entirely ever 30 min or so

@fmatray
Copy link
Contributor Author

fmatray commented Mar 9, 2025

  • watchdogs improvements : Kernel (detection is improved), bluetoothd (mainly detects timeouts) and phone (including ping testing)
  • Multitethering: Keeps on up and falls back on lost.
  • New web UI with config and status
  • hooks: bluetooth_up() and bluetooth_down()
  • Logs are more explicit

@nasiralamreeki
Copy link

This is excellent work perhaps one of the best contributions I've seen to Pwnagotchi so far. This is the quality work we need for this project.

@kontrakote
Copy link

Great work indeed!
I confirm it's working flawless with android 14 phone.
Also "current phone" message is mildly annoying. There's no usecase when this information needed almost every second.

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.

4 participants