Skip to content

Commit 69e5bd5

Browse files
authored
Merge pull request #15 from lgbrownjr/development
Updates 06/07/2021
2 parents 2bad33e + 1fcc352 commit 69e5bd5

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Reboot your Pi when the upgrade is complete.
109109
* Select *Network at boot*, then select *No* to Disable *Waiting for network on boot*.
110110
* From the main menu, under *localization Options* verify, or set:
111111
* Setup locals.
112-
* De-select the default selection of *en_GB.UTF-8 UTF-8* (if you are'nt from Great Briton), and select your contrie's local.
112+
* De-select the default selection of *en_GB.UTF-8 UTF-8* (if you are'nt from Great Britain), and select your contrie's local.
113113
* Select *Ok*, then tab to and select *Ok".
114114
* Select the local you selected in the previous screen, then tab to and select *Ok".
115115
* Set timezone on the pi.
@@ -260,4 +260,4 @@ Features I want to add to this project:
260260
---
261261

262262
## Known issues:
263-
- [ ] For some reason, while connected via bluetooth, one cannot update the OS, or githib repositories. A workaround, is to open a `screen` session in the bridge, then perform any update taskes. Another workaround would be to ssh into it instead of using bluetoothe.
263+
- [ ] For some reason, while connected via bluetooth, one cannot update the OS, or githib repositories. A workaround, is to open a `screen` session in the bridge, then perform any update taskes. Another workaround would be to ssh into it instead of using bluetooth.

screen_bat_mon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ if [ -e /tmp/bat ]; then
66
grep -Eo [0-9]+ /tmp/bat
77
else
88
printf "Null"
9-
fi
9+
fi
10+
exit 0

screen_get_baud

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/bash
2+
# I saved this as 'screen_backtick_battery'
3+
# 2021-06-02: get the rfcomm0 serial interface baud rate for a backtick command in the ser2bt_bridge screen config.
4+
stty < /dev/rfcomm0 | grep speed | cut -d ";" -f 1 | grep -o "[0-9]\+"
5+
exit 0

ser2bt_bridge

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,33 @@ printf "\n${nor}Checking to make sure we are connected to at least one serial de
6161

6262
#Check for USB ports:
6363
z=${max_ports}
64-
printf " ${nor}Checking to see what ${cyn}${usb_port}${nor}'s are available:\n"
64+
printf " ${nor}Checking to see what ${cyn}${usb_port}${nor}'s are available:"
6565
for (( a=0; a<=${max_ports}-1; a++ )); do
6666
port="${usb_port}${a}"
6767
if [[ ! -e ${port} ]]; then
6868
let z--
6969
else
70-
printf " ${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
70+
printf " \n${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
7171
wire_port+=(${port})
7272
fi
7373
done
74+
printf " ${drk_grn}Done\n"
7475

7576
#Check for ACM ports:
7677
z=${max_ports}
77-
printf " ${nor}Checking to see what ${cyn}${acm_port}${nor}'s are available:\n"
78+
printf " ${nor}Checking to see what ${cyn}${acm_port}${nor}'s are available:"
7879
for (( a=0; a<=${max_ports}-1; a++ )); do
7980
port="${acm_port}${a}"
8081
if [[ ! -e ${port} ]]; then
8182
let z--
8283
else
83-
printf " ${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
84+
printf " \n${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
8485
wire_port+=(${port})
8586
fi
8687
done
87-
resize > /dev/null 2>&1
88-
printf "\n"
88+
printf " ${drk_grn}Done\n"
89+
90+
#Create screen sessions based on the USB and ACM Ports found from above:
8991
count=0
9092
wire_count=1
9193
for serial_port in ${wire_port[@]}; do
@@ -94,8 +96,12 @@ for serial_port in ${wire_port[@]}; do
9496
let count++
9597
let wire_count++
9698
done
97-
9899
session_count=$(screen -r | grep Detached | cut -d "." -f 2 | cut -f 1 | wc -w)
100+
101+
#resize the terminal for better vewing
102+
resize > /dev/null 2>&1
103+
104+
#Determine what to do on exit - if we are connected to more than one serial device, connected to 1 serial device, or none at all:
99105
if [[ ${session_count} > 1 ]]; then
100106
screen -r | grep Detached | cut -d "." -f 2 | cut -f 1
101107
printf "\nUse ${yel}screen -r${mag} switch_name${nor} (listed above).\n"
@@ -114,4 +120,4 @@ wait
114120
exit_status=0
115121
exit_status_reason="Successful completion."
116122
exit_script ${exit_status} ${exit_status_reason}
117-
exit ${exit_status}
123+
exit ${exit_status}

ser2bt_bridge.screenrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ bind I login on
5252
bind O login off
5353
bind } history
5454

55+
#Extra functionality -obtain information for the status bars:
5556
backtick 1 30 90 screen_bat_mon
57+
backtick 2 120 300 screen_get_baud
58+
5659
# An example of a "screen scraper" which will launch urlview on the current
5760
# screen window
5861
#
@@ -85,7 +88,7 @@ hardstatus on
8588
#
8689
#hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
8790

88-
hardstatus alwaysfirstline
91+
#hardstatus alwaysfirstline
8992

9093
# set these terminals up to be 'optimal' instead of vt100
9194
termcapinfo xterm*|linux*|rxvt*|Eterm* OP
@@ -127,5 +130,5 @@ bindkey "^[[6~" eval 'copy' 'stuff ^F' # PgDown | Enter copy/scrollback mode and
127130
# SCREEN LAYOUT
128131
# ------------------------------------------------------------------------------
129132
hardstatus alwaysfirstline "%{= kb}[%{= kr}$USER%{+ kw}@%{+ ky}%H%{+ kb}][%=%{= kK}(%{+ km}%n %{+ kg}%t%{+ kK})%=%{+ kb}][%{+ ky}%m%{+ kw}/%{-}%d%{+ kw}/%{-}%Y %{+ kc}%c%{+ kb}]"
130-
caption always "%{+ Bk}[%{+ Wk}Press: %{+ Yk}<CTRL>%{-} +%{+ Yk} a%{-}, then%{+ Yk} \%{-} to exit, or%{+ Yk} d%{-} to suspend session.%{+ Bk}][%=][%{+ Wk}Battery: %{+ Gk}%1`%:%{+ Wk}%%%{+ Bk}]"
133+
caption always "%{+ Bk}[%{+ Wk}Baud Rate: %{+ Gk}%2`%:%{+ Bk}][%=][%{+ Wk}Press: %{+ Yk}<CTRL>%{-} +%{+ Yk} a%{-}, then%{+ Yk} \%{-} to %{+ Mk}exit%{-}, or%{+ Yk} d%{-} to %{+ Mk}suspend%{-} session.%{+ Bk}][%=][%{+ Wk}Battery: %{+ Gk}%1`%:%{+ Wk}%%%{+ Bk}]"
131134
#idle 300 exec termsaver starwars

upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ disable_svc=("keyboard-setup.service" "dphys-swapfile.service" "triggerhappy.ser
3939
"apt-daily-upgrade.service" "apt-daily-upgrade.timer" "rpi-eeprom-update.service" \
4040
"ser2net.service")
4141
base_package_install_list=("screen" "git" "minicom" "tio" "rfkill" "dnsutils" "xterm" "telnet" "telnetd" "ser2net" "spi-tools")
42-
base_bin_files=(ser2bt_bridge screen_bat_mon)
42+
base_bin_files=(ser2bt_bridge screen_bat_mon screen_get_baud)
4343
#enhanc_bin_files=(ser2bt_status init_scr shutdown_scr)
4444
wavesh_bin_files=(ser2bt_status init_scr shutdown_scr)
4545
full_bin_files=( "${base_bin_files[@]}")

0 commit comments

Comments
 (0)