diff --git a/changelog b/changelog
index 447dc20..893ecc9 100644
--- a/changelog
+++ b/changelog
@@ -1,6 +1,9 @@
-release=2.10.0
+release=2.11.0
Changelog
+2.11.0 add support for mobilinkd TNC 4
+ add auto start modem
+ fix false failure when starting vara modems
2.10.0 add VARA to getardoplist script
add VARA to getardoplist-cron script
add Pat Autoconnect VARA script
diff --git a/manage-pat b/manage-pat
index cb0b7b2..12dfb5c 100755
--- a/manage-pat
+++ b/manage-pat
@@ -4,7 +4,22 @@ export MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png
source $MYPATH/manage-pat-functions
MAIN=$MYPATH/patmenu
+CUR=$(cat $MYPATH/.autostart.conf | awk -F "/" '{print $NF}' | sed 's/"//')
+if [ -z "$CUR" ]; then
+CUR=None
+else
+ #set pretty name for display
+ if [ $CUR = 'start-vara-hf' ]; then
+ CUR=VARA-HF
+ elif [ $CUR = 'start-vara-fm' ]; then
+ CUR=VARA-FM
+ elif [ $CUR = 'start-pat-ardop' ]; then
+ CUR=ARDOP
+ elif [ $CUR = 'start-pat2m' ]; then
+ CUR=Packet
+ fi
+fi
yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
@@ -16,6 +31,7 @@ yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-
--field="Set ARDOP PTT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; SETPTT"' \
--field="Set Listen Mode":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; LISTEN"' \
--field="Add P2P Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; PEER"' \
+--field="Auto Start Modem - $CUR":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; AUTOMODEM"' \
--field="Delete Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; DELETEALIAS"' \
--field="Backup Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; BKUPCONFIG"' \
--field="Restore Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; RESTORECONFIG"' \
@@ -26,6 +42,4 @@ BUT=$?
if [ $BUT = 1 ]; then
$MAIN &
exit
-fi
-
-echo $?
\ No newline at end of file
+fi
\ No newline at end of file
diff --git a/manage-pat-functions b/manage-pat-functions
index 126fefe..7fdadeb 100644
--- a/manage-pat-functions
+++ b/manage-pat-functions
@@ -598,6 +598,119 @@ $MAIN
fi
}
-
+AUTOMODEM(){
+CONF=$HOME/patmenu2/.autostart.conf
+HTTP_ADDR=$(grep http_addr $HOME/.config/pat/config.json | sed 's/.*": "//;s/:.*//')
+
+#pat server check
+if [ "$HTTP_ADDR" = '127.0.0.1' ]; then
+yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
+--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
+--text="The Pat mailbox server is currently set to only accept connections from the Pi itself. \
+Typically if using the auto modem start feature, you will be accessing the Pat mailbox from \
+another device. Would you like to configure the system to accept connections over the network?" \
+--button="Keep Current Settings":1 \
+--button="Allow Network Connections":2
+BUT=$?
+ if [ $BUT = 2 ]; then
+ cp $HOME/.config/pat/config.json $HOME/.config/pat/config.json.bkup
+ sed -i 's/127.0.0.1/0.0.0.0/' $HOME/.config/pat/config.json
+ sudo systemctl restart pat@`whoami`
+ fi
+fi
+
+source $CONF
+
+#Figure out which modem (if any) is set to auto start already and give it a pretty name.
+CUR=$(echo $AUTO_CMD | awk -F "/" '{print $NF}')
+if [ -z $CUR ]; then
+echo
+else
+ if [ $CUR = 'start-vara-hf' ]; then
+ CUR=VARA-HF
+ elif [ $CUR = 'start-vara-fm' ]; then
+ CUR=VARA-FM
+ elif [ $CUR = 'start-pat-ardop' ]; then
+ CUR=ARDOP
+ elif [ $CUR = 'start-pat2m' ]; then
+ CUR=Packet
+ fi
+fi
+
+#check to see if we already have a autostart in place. Give user
+#a chance to delete before adding a new one. Can only have one
+#modem starting at a time.
+if [ -f $CONF ]; then
+yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
+--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
+--text="Existing Auto Start Found - $CUR\rYou must delete the existing auto start before creating a new one. \
+Only one modem at a time can be set to auto start at boot." \
+--button="Delete Current":1 \
+--button="Keep Current":2
+BUT=$?
+ if [ $BUT = 1 ]; then
+ crontab -l > /run/user/$UID/tempcron.txt
+ rm $CONF
+ sed -i '/patmenu2\/start/d' /run/user/$UID/tempcron.txt
+ crontab /run/user/$UID/tempcron.txt
+ elif [ $BUT = 2 ]; then
+ $MAIN &
+ exit
+ elif [ $BUT = 252 ]; then
+ exit
+ fi
+fi
+
+AUTO=$(yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
+--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
+--text="Auto Modem Start by KM4ACK" \
+--field="Auto Start Modem on Boot":CB "NONE|VARA|VARA-FM|ARDOP|Packet")
+BUT=$?
+
+AUTO=$(echo $AUTO | awk -F "|" '{print $1}')
+
+#give user chance to exit/cancel
+if [ $BUT = 252 ]; then
+exit
+elif [ $BUT = 1 ]; then
+$MAIN &
+exit
+fi
+
+#set command per user selection
+if [ "$AUTO" = 'VARA' ]; then
+echo "VARA Selected"
+AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-hf"
+elif [ "$AUTO" = 'VARA-FM' ]; then
+echo "VARA FM Selected"
+AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-fm"
+elif [ "$AUTO" = 'ARDOP' ]; then
+echo "ARDOP Selected"
+AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat-ardop"
+elif [ "$AUTO" = 'Packet' ]; then
+echo "Packet Selected"
+AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat2m"
+elif [ "$AUTO" = 'NONE' ]; then
+$MAIN &
+exit
+fi
+
+#send the command to the conf file
+echo "AUTO_CMD=\"$AUTO_CMD\"" > $CONF
+
+#add auto start to current cron job
+crontab -l > /run/user/$UID/tempcron.txt
+echo "@reboot $AUTO_CMD" >> /run/user/$UID/tempcron.txt
+crontab /run/user/$UID/tempcron.txt
+
+#give user feedback
+yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
+--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
+--text="$AUTO will auto start at boot\r\rIMPORTANT NOTE!\rThe sound card MUST be plugged in \
+before booting the Pi or the auto start feature will FAIL." \
+--button=gtk-ok
+$MAIN &
+exit
+}
diff --git a/mobilink b/mobilink
index a1c5629..a68c600 100755
--- a/mobilink
+++ b/mobilink
@@ -2,7 +2,7 @@
#script to connect mobilinkd TNC for ax25
#20200602
-#20220304 last edit KM4ACK
+#20230304 last edit KM4ACK
################################################################
# #
# # # # # # # ##### # # #
@@ -78,23 +78,25 @@ hcitool scan > $TMPFILE
#Decide if its a TNC 2 or 3
TNC2=$(grep -i TNC2 $TMPFILE)
TNC3=$(grep -i TNC3 $TMPFILE)
-if [ -z "$TNC2" ]
-then
-MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
-TNC=3
-elif [ -z "$TNC3" ]
-then
+TNC4=$(grep -i TNC4 $TMPFILE)
+if [ -n "$TNC2" ]; then
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
TNC=2
+elif [ -n "$TNC3" ]; then
+MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
+TNC=3
+elif [ -n "$TNC4" ]; then
+MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
+TNC=4
fi
#set correct connection commmand
-if [ $TNC = "2" ]
-then
+if [ $TNC = "2" ]; then
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
-elif [ $TNC = "3" ]
-then
+elif [ $TNC = "3" ]; then
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC 6"
+elif [ $TNC = "4" ]; then
+CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
fi
#See if device was found and connect if found
diff --git a/start-vara-fm b/start-vara-fm
index 72e7606..54c4ed6 100755
--- a/start-vara-fm
+++ b/start-vara-fm
@@ -32,7 +32,7 @@ FLRIG=$(echo $RIG | grep "\-m 4")
fi
#Check if modem is already running
-MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm)
+MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
if [ ! -z "$MODEMCHECK" ]; then
yad --title="FAILED" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
@@ -111,7 +111,7 @@ echo "starting VARA-FM"
sleep 7 #give vara time to start
#verify vara has started
-PIDVARA=$(ps aux | grep -i box86 | grep -i varafm)
+PIDVARA=$(ps aux | grep -i wine | grep -i varafm)
if [ -z "$PIDVARA" ]
then
yad --title="FAILED" --width=400 --height=100 \
diff --git a/start-vara-hf b/start-vara-hf
index cff0566..d659cbd 100755
--- a/start-vara-hf
+++ b/start-vara-hf
@@ -33,7 +33,7 @@ FLRIG=$(echo $RIG | grep "\-m 4")
fi
#Check if modem is already running
-MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm)
+MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
if [ ! -z "$MODEMCHECK" ]; then
yad --title="FAILED" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
@@ -112,7 +112,7 @@ echo "starting VARA HF"
sleep 7 #give vara time to start
#verify vara has started
-PIDVARA=$(ps aux | grep -i box86 | grep VARA.exe)
+PIDVARA=$(ps aux | grep -i wine | grep VARA.exe)
if [ -z "$PIDVARA" ]
then
yad --title="FAILED" --width=400 --height=100 \