Skip to content

Commit

Permalink
Merge pull request #15 from lgbrownjr/development
Browse files Browse the repository at this point in the history
Updates 06/07/2021
  • Loading branch information
lgbrownjr authored Jun 7, 2021
2 parents 2bad33e + 1fcc352 commit 69e5bd5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Reboot your Pi when the upgrade is complete.
* Select *Network at boot*, then select *No* to Disable *Waiting for network on boot*.
* From the main menu, under *localization Options* verify, or set:
* Setup locals.
* 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.
* 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.
* Select *Ok*, then tab to and select *Ok".
* Select the local you selected in the previous screen, then tab to and select *Ok".
* Set timezone on the pi.
Expand Down Expand Up @@ -260,4 +260,4 @@ Features I want to add to this project:
---

## Known issues:
- [ ] 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.
- [ ] 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.
3 changes: 2 additions & 1 deletion screen_bat_mon
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ if [ -e /tmp/bat ]; then
grep -Eo [0-9]+ /tmp/bat
else
printf "Null"
fi
fi
exit 0
5 changes: 5 additions & 0 deletions screen_get_baud
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/bash
# I saved this as 'screen_backtick_battery'
# 2021-06-02: get the rfcomm0 serial interface baud rate for a backtick command in the ser2bt_bridge screen config.
stty < /dev/rfcomm0 | grep speed | cut -d ";" -f 1 | grep -o "[0-9]\+"
exit 0
22 changes: 14 additions & 8 deletions ser2bt_bridge
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,33 @@ printf "\n${nor}Checking to make sure we are connected to at least one serial de

#Check for USB ports:
z=${max_ports}
printf " ${nor}Checking to see what ${cyn}${usb_port}${nor}'s are available:\n"
printf " ${nor}Checking to see what ${cyn}${usb_port}${nor}'s are available:"
for (( a=0; a<=${max_ports}-1; a++ )); do
port="${usb_port}${a}"
if [[ ! -e ${port} ]]; then
let z--
else
printf " ${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
printf " \n${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
wire_port+=(${port})
fi
done
printf " ${drk_grn}Done\n"

#Check for ACM ports:
z=${max_ports}
printf " ${nor}Checking to see what ${cyn}${acm_port}${nor}'s are available:\n"
printf " ${nor}Checking to see what ${cyn}${acm_port}${nor}'s are available:"
for (( a=0; a<=${max_ports}-1; a++ )); do
port="${acm_port}${a}"
if [[ ! -e ${port} ]]; then
let z--
else
printf " ${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
printf " \n${cyn}${port}${nor} is ${drk_grn}available${nor}...\n"
wire_port+=(${port})
fi
done
resize > /dev/null 2>&1
printf "\n"
printf " ${drk_grn}Done\n"

#Create screen sessions based on the USB and ACM Ports found from above:
count=0
wire_count=1
for serial_port in ${wire_port[@]}; do
Expand All @@ -94,8 +96,12 @@ for serial_port in ${wire_port[@]}; do
let count++
let wire_count++
done

session_count=$(screen -r | grep Detached | cut -d "." -f 2 | cut -f 1 | wc -w)

#resize the terminal for better vewing
resize > /dev/null 2>&1

#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:
if [[ ${session_count} > 1 ]]; then
screen -r | grep Detached | cut -d "." -f 2 | cut -f 1
printf "\nUse ${yel}screen -r${mag} switch_name${nor} (listed above).\n"
Expand All @@ -114,4 +120,4 @@ wait
exit_status=0
exit_status_reason="Successful completion."
exit_script ${exit_status} ${exit_status_reason}
exit ${exit_status}
exit ${exit_status}
7 changes: 5 additions & 2 deletions ser2bt_bridge.screenrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ bind I login on
bind O login off
bind } history

#Extra functionality -obtain information for the status bars:
backtick 1 30 90 screen_bat_mon
backtick 2 120 300 screen_get_baud

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
Expand Down Expand Up @@ -85,7 +88,7 @@ hardstatus on
#
#hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

hardstatus alwaysfirstline
#hardstatus alwaysfirstline

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP
Expand Down Expand Up @@ -127,5 +130,5 @@ bindkey "^[[6~" eval 'copy' 'stuff ^F' # PgDown | Enter copy/scrollback mode and
# SCREEN LAYOUT
# ------------------------------------------------------------------------------
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}]"
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}]"
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}]"
#idle 300 exec termsaver starwars
2 changes: 1 addition & 1 deletion upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ disable_svc=("keyboard-setup.service" "dphys-swapfile.service" "triggerhappy.ser
"apt-daily-upgrade.service" "apt-daily-upgrade.timer" "rpi-eeprom-update.service" \
"ser2net.service")
base_package_install_list=("screen" "git" "minicom" "tio" "rfkill" "dnsutils" "xterm" "telnet" "telnetd" "ser2net" "spi-tools")
base_bin_files=(ser2bt_bridge screen_bat_mon)
base_bin_files=(ser2bt_bridge screen_bat_mon screen_get_baud)
#enhanc_bin_files=(ser2bt_status init_scr shutdown_scr)
wavesh_bin_files=(ser2bt_status init_scr shutdown_scr)
full_bin_files=( "${base_bin_files[@]}")
Expand Down

0 comments on commit 69e5bd5

Please sign in to comment.