Skip to content

Commit a130863

Browse files
committed
updated bt scripts #3
1 parent 48ce444 commit a130863

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

scripts/bt-expect.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set timeout 120
44

55
set prompt "#"
66

7-
spawn sudo bluetoothctl -a
7+
spawn sudo bluetoothctl
88
expect -re $prompt
99
send "power on\r"
1010
sleep 1
@@ -33,27 +33,18 @@ expect -re $prompt
3333
send "pairable on\r"
3434
sleep 1
3535

36-
expect -re "[NEW] Device\w(.+)\w"
37-
set address $expect_out(1,string)
38-
3936
expect -re "Enter PIN code: "
37+
sleep 3
4038
send "3434\r"
4139

4240
expect -re "Connected: yes"
43-
expect -re $prompt
44-
send "trust $address\r"
45-
sleep 2
46-
47-
expect -re "trust succeeded"
48-
sleep 1
49-
41+
sleep 10
5042
expect -re $prompt
5143
send "discoverable off\r"
5244
sleep 1
5345

5446
expect -re $prompt
5547
send "pairable off\r"
56-
sleep 1
5748

5849
send "quit\r"
5950
expect eof

scripts/bt-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ echo "Open ${bold}bluetooth settings${normal} on your phone to search for and ${
3030
echo "If you have already paired it on your phone, please unpair it first, then pair again"
3131
echo
3232

33-
/usr/bin/expect -f /home/pi/omnipy/bt-expect.sh
33+
/usr/bin/expect -f /home/pi/omnipy/scripts/bt-expect.sh
3434

3535
sudo hciconfig hci0 sspmode 1
3636

0 commit comments

Comments
 (0)