From 9c0c2fd817cf61d3fecfb6a3f3183c04398404fe Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Thu, 10 Aug 2023 07:52:10 +0300 Subject: [PATCH] - more changes from master repo --- connect_phone.sh | 27 +++++++++++++++++++++++++++ setup/setup_agent_gsm.sh | 16 ++++++++++------ start.sh | 2 -- stop.sh | 1 - stop_gsm_call.sh | 3 --- view_log.sh | 4 ++-- view_mobile_app_info.sh | 3 --- 7 files changed, 39 insertions(+), 17 deletions(-) create mode 100755 connect_phone.sh delete mode 100755 start.sh delete mode 100755 stop.sh delete mode 100755 stop_gsm_call.sh delete mode 100755 view_mobile_app_info.sh diff --git a/connect_phone.sh b/connect_phone.sh new file mode 100755 index 0000000..e0590bd --- /dev/null +++ b/connect_phone.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +MAC_ADDRESS="" +read -p "Please enter MAC BT address: " MAC_ADDRESS + +# Write the address into config file before +sed -i "s/MAC_ADDRESS/$MAC_ADDRESS/" config/config.yaml + + +bluetoothctl -- power on +bluetoothctl -- agent on +sleep 10 # Time to give BT to start + +bluetoothctl -- default-agent +bluetoothctl -- discoverable on +bluetoothctl -- pairable on + +# Try to pair now +bluetoothctl -- pair ${MAC_ADDRESS} +sleep 10 + +# Trust to device +bluetoothctl -- trust ${MAC_ADDRESS} + +# Connect to device +bluetoothctl -- connect ${MAC_ADDRESS} +sleep 5 diff --git a/setup/setup_agent_gsm.sh b/setup/setup_agent_gsm.sh index 3fceedd..215ec70 100755 --- a/setup/setup_agent_gsm.sh +++ b/setup/setup_agent_gsm.sh @@ -4,7 +4,7 @@ INSTALL_DIR=agent_gsm # Re -GIT_SOURCE=https://deploy:deploy@git.sevana.biz/agent_gsm_redist +GIT_SOURCE=https://git.sevana.biz/public/agent_gsm_redist # Install prerequisites sudo apt install git mc python3 sox vim @@ -19,9 +19,6 @@ git clone $GIT_SOURCE $INSTALL_DIR # Go to cloned directory cd $INSTALL_DIR -# Run bootstrap app -./pi_bootstrap_bt.sh - # Update config file BACKEND_URL="" PHONE_NAME="" @@ -50,5 +47,12 @@ ABSOLUTE_INSTALL_DIR=`realpath $INSTALL_DIR` sed -i "s/ABSOLUTE_INSTALL_DIR/$ABSOLUTE_INSTALL_DIR/" config/systemd/agent_gsm.service -echo Please run $INSTALL_DIR/run_node.sh to see if everything works ok. -echo After you can use $INSTALL_DIR/config/systemd/agent_gsm.service to enable this work with systemD. +echo "Now the remaining prerequisites will be installed and system will reboot." +echo "You can connect the phone via Bluetooth after the reboot." +echo "Use the connect_phone.sh to ease the connection process. This script will ask you about Bluetooth MAC address and make attempt to pair & connect the phone. " +echo "Please run $INSTALL_DIR/run_node.sh to see if everything works ok." +echo "After you can use $INSTALL_DIR/config/systemd/agent_gsm.service to enable this work with systemD." + +# Run bootstrap app +./pi_bootstrap_bt.sh + diff --git a/start.sh b/start.sh deleted file mode 100755 index d8f8565..0000000 --- a/start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start qualtest \ No newline at end of file diff --git a/stop.sh b/stop.sh deleted file mode 100755 index dcf0e0e..0000000 --- a/stop.sh +++ /dev/null @@ -1 +0,0 @@ -sudo systemctl stop qualtest \ No newline at end of file diff --git a/stop_gsm_call.sh b/stop_gsm_call.sh deleted file mode 100755 index 8a3b3e3..0000000 --- a/stop_gsm_call.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -adb shell input keyevent 6 \ No newline at end of file diff --git a/view_log.sh b/view_log.sh index 9a63581..1e24001 100755 --- a/view_log.sh +++ b/view_log.sh @@ -1,3 +1,3 @@ #!/bin/bash -# -journalctl -u qualtest -f + +journalctl -u agent_gsm -f diff --git a/view_mobile_app_info.sh b/view_mobile_app_info.sh deleted file mode 100755 index 98b1940..0000000 --- a/view_mobile_app_info.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -adb shell dumpsys package biz.sevana.qualtestgsm