You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eliminate separate BR/EDR and BR/EDR+LE scans because they return the same results in testing. Just go with the default "auto" which is what is set when no transport is explicitly set.
Copy file name to clipboardExpand all lines: www/util/blu-control.sh
+8-57Lines changed: 8 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,15 @@
14
14
# - show and kill active connections - "online"
15
15
# - kill active connections before scanning
16
16
# - TODO: How to avoid double source connection??
17
+
# Rev 2.0 24-Nov-2025
18
+
# - Update for moOde 10 Trixie
17
19
#
18
20
# This script is designed to work with bluez and bluez-alsa
19
21
# It performs bluetooth controller initialization and provides management of bluetooth sources
20
22
# All related data files will reside under /var/lib/bluetooth
21
23
#
22
24
23
-
REV=1.6
25
+
REV=2.0
24
26
25
27
# Check for sudo
26
28
[[ $EUID-ne 0 ]] && { echo"Use sudo to run the script";exit 1 ; } ;
@@ -50,40 +52,9 @@ echo "**"
50
52
echo"** Controller initialized"
51
53
}
52
54
53
-
# Scan for only BR/EDR devices
54
-
SCAN_BREDR() {
55
-
echo"** Scanning for only BR/EDR devices (${SCAN_DURATION} seconds)"
56
-
echo"**"
57
-
expect <(cat <<EOF
58
-
log_user 0
59
-
set timeout -1
60
-
match_max 100000
61
-
spawn bluetoothctl
62
-
expect "*> "
63
-
send "menu scan\r"
64
-
expect "*> "
65
-
send "clear\r"
66
-
expect "*> "
67
-
send "transport bredr\r"
68
-
expect "*> "
69
-
send "back\r"
70
-
expect "*> "
71
-
send "scan on\r"
72
-
expect "Discovery started\r"
73
-
expect "*> "
74
-
sleep $SCAN_DURATION
75
-
send "scan off\r"
76
-
expect "Discovery stopped\r"
77
-
expect "*> "
78
-
send "quit\r"
79
-
expect eof
80
-
EOF
81
-
)
82
-
}
83
-
84
-
# Scan for both BR/EDR and LE devices
85
-
SCAN_DUAL() {
86
-
echo"** Scanning for BR/EDR and LE devices (${SCAN_DURATION} seconds)"
55
+
# Scan for devices
56
+
SCAN() {
57
+
echo"** Scanning for devices (${SCAN_DURATION} seconds)"
87
58
echo"**"
88
59
expect <(cat <<EOF
89
60
log_user 0
@@ -258,8 +229,7 @@ HELP_TERM() {
258
229
echo"** Usage: blu-control.sh [OPTION]"
259
230
echo"**"
260
231
echo"** -i Initialize/reset controller"
261
-
echo"** -s Scan (BR/EDR only) and trust devices"
262
-
echo"** -S Scan (LE and BR/EDR) and trust devices"
232
+
echo"** -s Scan for and trust devices"
263
233
echo"** -p List paired devices"
264
234
echo"** -c List connected devices"
265
235
echo"** -l List trusted devices"
@@ -272,16 +242,6 @@ HELP_TERM() {
272
242
echo"** -h Help"
273
243
}
274
244
275
-
# Format help for html presentation
276
-
HELP_HTML() {
277
-
echo"1) Put your device in discovery mode and wait until it discovers Moode Bluetooth. You may have to turn Bluetooth off/on on your device to accomplish this."
278
-
echo
279
-
echo -e "2) To send audio from your device to moOde:<br>First turn on the Pairing agent in Audio Config and then initiate the connection on your device. Your device should automatically pair and connect. You can verify that your device has been successfully paired and connected by submitting \"LIST paired\" or \"LIST connected\" commands."
280
-
echo
281
-
echo -e "3) To send audio from moOde to your device:<br>First submit a SCAN command and verify that your device appears in the scan results. The SCAN may have to be run multiple times. Next select the device in the dropdown list, PAIR it then select \"MPD audio output->Bluetooth\" from the dropdown then CONNECT."
282
-
echo"<br>Note: Bluetooth has a range of around 30 feet (10 meters) but range will vary depending on obstacles (metal, wall, etc.), device signal strength and quality, and level of electromagnetic interferrence."
0 commit comments