start stop
[201903hackathon.git] / bt_connect_bobbycar.sh
index 74d97a9..a4782d9 100755 (executable)
@@ -1,7 +1,11 @@
 #!/bin/zsh
 local BOBBYCAR=30:AE:A4:15:24:72
+local RFDEV=/dev/rfcomm1
+sudo bluetoothctl <<< "disconnect $BOBBYCAR"
+sleep 5
 sudo bluetoothctl <<< "connect $BOBBYCAR"
+sudo bluetoothctl <<< "trust $BOBBYCAR"
+sleep 8
+sudo rfcomm bind $RFDEV $BOBBYCAR  1
 sleep 3
-sudo rfcomm bind /dev/rfcomm1 $BOBBYCAR  1
-sleep 3
-./cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance > /dev/rfcomm1
\ No newline at end of file
+./cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance > $RFDEV