Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
88b901a
- split BT, nmcli device, nmcli connexion tests
fmatray Feb 18, 2025
3462049
- Add BT connection check
fmatray Feb 18, 2025
81e21cd
Typo
fmatray Feb 18, 2025
112803b
- better BT connection tests
fmatray Feb 18, 2025
2d2552f
Check BT disconnected
fmatray Feb 18, 2025
27a656e
- Add Lock()
fmatray Feb 19, 2025
333459b
Merge branch 'noai' of https://github.com/fmatray/pwnagotchi into noai
fmatray Feb 19, 2025
fd7cd2c
- Split BTSTate into 3 -> BTState, DeviceState, ConnectionState
fmatray Feb 19, 2025
bcaff7f
- Fancy web page
fmatray Feb 19, 2025
c2c6e06
- check status during reconnect() before trying to up device and conn…
fmatray Feb 19, 2025
e423abc
Add fix_bluetooth.sh as a workaround for bluetooth issues
fmatray Feb 20, 2025
717a33b
Add timeout to handle bluetoothctl endless waiting if modules are alr…
fmatray Feb 20, 2025
f4b7e1d
Add check and fix for kernel modules
fmatray Feb 20, 2025
f575b49
Split bt-tether: bt-tether and template file
fmatray Feb 20, 2025
db12a27
- Split BTteher into BTteher and BTManager
fmatray Feb 21, 2025
e70a073
Debug internet = false
fmatray Feb 22, 2025
f7876d1
add comments
fmatray Feb 22, 2025
44b1f06
- Debug KERN_ERROR_PTTRN
fmatray Feb 22, 2025
6d4ddda
- on_config_changed(): code refactor
fmatray Feb 22, 2025
8fb6fc3
- Refator disconnect_bluetooth(), down_device() and down_connection()
fmatray Feb 22, 2025
8a72e7c
Handle a small bug if self._work_thread is None
fmatray Feb 25, 2025
be87af7
Merge branch 'jayofelony:noai' into noai
fmatray Feb 25, 2025
fa16568
- Remove unecessary request to google.com: it loads BT and USB network
fmatray Feb 25, 2025
4a2b3df
readability improvement
fmatray Feb 25, 2025
38e6857
remove a bug on_unload() in wpa-sec.py
fmatray Feb 25, 2025
dc01b29
- Remove hardcorded path
fmatray Feb 26, 2025
04b03bd
Merge branch 'jayofelony:noai' into noai
fmatray Feb 26, 2025
5eb56e9
Add interval option for OHCAPI
fmatray Feb 26, 2025
89d86fd
Merge branch 'noai' of https://github.com/fmatray/pwnagotchi into noai
fmatray Feb 26, 2025
14d94f7
- Add check to the IP option to handle empty strings
fmatray Feb 26, 2025
115dd55
Remove debuging message
fmatray Feb 27, 2025
1a3c9bb
improve default ip/gateway options
fmatray Feb 27, 2025
9a7b439
- Debug IP/gateway config
fmatray Mar 2, 2025
b3fff4e
change and errror log to info
fmatray Mar 2, 2025
99ffec9
- Simple refactor
fmatray Mar 4, 2025
0360c0e
- Add logs on *State.ERROR
fmatray Mar 4, 2025
027b6b4
Merge branch 'jayofelony:noai' into noai
fmatray Mar 5, 2025
4585d34
- Spit BTManager into BTPhone(phone related) and BTManager(kernel and…
fmatray Mar 6, 2025
0462729
- Code refactoring
fmatray Mar 6, 2025
3754545
- Update logs
fmatray Mar 6, 2025
1bfec3c
- Add bluetoothd watchdog
fmatray Mar 6, 2025
19f9228
- Add hooks : on_bluetooth_up() and on_bluetooth_down
fmatray Mar 6, 2025
70e9a1d
- Add multitethering
fmatray Mar 8, 2025
5c6d298
remove comments
fmatray Mar 8, 2025
1d942b9
Typo
fmatray Mar 8, 2025
69a4e57
Merge branch 'noai' into noai
fmatray Mar 8, 2025
4819890
less loggs in OHCAPI
fmatray Mar 8, 2025
338da48
Merge branch 'jayofelony:noai' into noai
fmatray Mar 8, 2025
3b7405b
Merge branch 'noai' of https://github.com/fmatray/pwnagotchi into noai
fmatray Mar 8, 2025
9140373
Update default options for bt-tether.py
fmatray Mar 8, 2025
05e5404
Merge branch 'jayofelony:noai' into noai
fmatray Mar 8, 2025
44a5c76
Simplify hooks
fmatray Mar 9, 2025
48096a2
Merge branch 'jayofelony:noai' into noai
fmatray Mar 9, 2025
be664a2
Code refactoring
fmatray Mar 10, 2025
672f8c9
Minor debuging if a phone is not correctly configured
fmatray Mar 13, 2025
211d80e
Version update + more logs
fmatray Mar 13, 2025
a1a400c
Debug
fmatray Mar 15, 2025
647aca2
Merge branch 'jayofelony:noai' into noai
fmatray Mar 15, 2025
8148294
- Avoid reloading kernel modules twice if an error occures during hci…
fmatray Mar 16, 2025
6cc6704
merge
fmatray Mar 16, 2025
8a5f6d9
Merge branch 'jayofelony:noai' into noai
fmatray Mar 23, 2025
72bac20
Merge branch 'jayofelony:noai' into noai
fmatray Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions pwnagotchi/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,23 @@ token = "" # Create a personal access token (classic) with scope set to public_r

[main.plugins.bt-tether]
enabled = false
phone-name = "" # name as shown on the phone i.e. "Pwnagotchi's Phone"
# default values applied to all phones
dns = "8.8.8.8 1.1.1.1" # optional, default (google): "8.8.8.8 1.1.1.1". Consider anonymous DNS like OpenNic :-)
autoconnect = true # optional, default true. if true, uses nmcli autoconnect else, up by itself
metric = 200 # optional, default: 200. Changes connection priority
internet = true # optional, default true. Use phone as a gateway to Internet or just control

phones = [{phone-name = "", mac = "", phone = "" }] # list of dict. You can overwrite a default value. Ex:"internet" = false
# Phone-name: name as shown on the phone i.e. "Pwnagotchi's Phone"
# mac: phone mac adress
# phone: android or ios
# ip: optional pwnagotchi ip, default : 192.168.44.2 if android or 172.20.10.2 if ios

# Kept for backwards compatibility
phone-name = ""
mac = ""
phone = "" # android or ios
ip = "" # optional, default : 192.168.44.2 if android or 172.20.10.2 if ios
dns = "8.8.8.8 1.1.1.1" # optional, default (google): "8.8.8.8 1.1.1.1". Consider using anonymous DNS like OpenNic :-)
phone = ""
ip = ""

[main.plugins.fix_services]
enabled = true
Expand Down
5 changes: 4 additions & 1 deletion pwnagotchi/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def __init__(self, plugin_name):

def __del__(self):
self.keep_going = False
self._worker_thread.join()
try:
self._worker_thread.join()
except AttributeError:
pass
if self.load_handler:
self.load_handler.join()

Expand Down
141 changes: 141 additions & 0 deletions pwnagotchi/plugins/default/bt-tether.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{% extends "base.html" %}
{% set active_page = "bt-tether" %}
{% block title %}
{{ title }}
{% endblock %}
{% block meta %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=0" />
{% endblock %}
{% block styles %}
{{ super() }}
<style>
h1.used {
color: green;
}

h1.notused {
color: orangered;
}
#searchText {
width: 100%;
}

table {
table-layout: auto;
width: 100%;
}

table,
th,
td {
border: 1px solid;
border-collapse: collapse;
}

th,
td {
padding: 15px;
text-align: center;
}

@media screen and (max-width:700px) {

table,
tr,
td {
padding: 0;
border: 1px solid;
}

table {
border: none;
}

tr:first-child,
thead,
th {
display: none;
border: none;
}

tr {
float: left;
width: 100%;
margin-bottom: 2em;
}

td {
float: left;
width: 100%;
padding: 1em;
}

td::before {
content: attr(data-label);
word-wrap: break-word;
color: white;
border-right: 2px solid;
width: 20%;
float: left;
padding: 1em;
font-weight: bold;
margin: -1em 1em -1em -1em;
}
}
</style>
{% endblock %}
{% block script %}
var searchInput = document.getElementById("searchText");
searchInput.onkeyup = function() {
var filter, table, tr, td, i, txtValue;
filter = searchInput.value.toUpperCase();
table = document.getElementById("tableOptions");
if (table) {
tr = table.getElementsByTagName("tr");

for (i = 0; i < tr.length; i++) {
td=tr[i].getElementsByTagName("td")[0];
if (td) {
txtValue=td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter)> -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
}
{% endblock %}

{% block content %}
<input type="text" id="searchText" placeholder="Search for ..." title="Type in a filter">
<table id="tableOptions">
<tr>
<th>Phone</th>
<th>States</th>
</tr>
{% for key in phones %}
<tr>
<td data-label="phone">
{% if key == current_phone %}
{% set header_class="used" %}
{% else %}
{% set header_class="notused" %}
{% endif %}
<h1 class="{{header_class}}">{{phones[key].phone_name}} ({{phones[key].phone}})</h1>
<strong>IP:&nbsp;</strong>{{phones[key].ip}}&nbsp;<strong>Gateway:&nbsp;</strong>{{phones[key].gateway}}<br>
<strong>DNS: </strong>{{phones[key].dns.replace(" ", ",&nbsp;")|safe}}<br>
<strong>MAC: </strong>{{phones[key].mac}}<br>
</td>
<td>
<strong>NetworkManager&nbsp;Connection: </strong>{{phones[key].connection_state.name}}{% if phones[key].up_date != None %}{% set up_date_ago=phones[key].up_date_ago %}&nbsp;({{up_date_ago[0]}}min&nbsp;{{up_date_ago[1]}}s){% endif %}<br>
<strong>NetworkManager&nbsp;Device: </strong>{{phones[key].device_state.name}}<br>
<strong>Bluetooth: </strong>{{phones[key].bluetooth_state.name}}<br>
</td>
</tr>
{% endfor %}
</table>
{% endblock %}
Loading