mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-12-25 10:41:36 +00:00
final test & bugfixes
This commit is contained in:
parent
0093511768
commit
95af3d1371
@ -3,14 +3,16 @@
|
|||||||
# Created on July 12, 2019 by Saeed Johar (saeedjohar)
|
# Created on July 12, 2019 by Saeed Johar (saeedjohar)
|
||||||
# Revised on November 19, 2020 by Yasin Kaya (selengalp)
|
# Revised on November 19, 2020 by Yasin Kaya (selengalp)
|
||||||
|
|
||||||
|
source src/functions.sh
|
||||||
|
|
||||||
SIXFAB_PATH="/opt/sixfab"
|
SIXFAB_PATH="/opt/sixfab"
|
||||||
PPP_PATH="/opt/sixfab/ppp_connection_manager"
|
PPP_PATH="/opt/sixfab/ppp_connection_manager"
|
||||||
|
|
||||||
|
# NEEDS TO BE CHANGED TO SIXFAB IF PULLED
|
||||||
REPO_PATH="https://raw.githubusercontent.com/bzt/Sixfab_PPP_Installer"
|
REPO_PATH="https://raw.githubusercontent.com/bzt/Sixfab_PPP_Installer"
|
||||||
BRANCH=master
|
BRANCH=master
|
||||||
SOURCE_PATH="$REPO_PATH/$BRANCH/src"
|
SOURCE_PATH="$REPO_PATH/$BRANCH/src"
|
||||||
SCRIPT_PATH="$REPO_PATH/$BRANCH/src/reconnect_scripts"
|
SCRIPT_PATH="$REPO_PATH/$BRANCH/src/reconnect_scripts"
|
||||||
RECONNECT_SCRIPT_NAME="ppp_reconnect.sh"
|
|
||||||
MANAGER_SCRIPT_NAME="jetson_ppp_connection_manager.sh"
|
MANAGER_SCRIPT_NAME="jetson_ppp_connection_manager.sh"
|
||||||
SERVICE_NAME="jetson_ppp_connection_manager.service"
|
SERVICE_NAME="jetson_ppp_connection_manager.service"
|
||||||
|
|
||||||
@ -139,10 +141,10 @@ fi
|
|||||||
|
|
||||||
while [ 1 ]
|
while [ 1 ]
|
||||||
do
|
do
|
||||||
colored_echo "Do you want to activate auto connect/reconnect service at R.Pi boot up? [Y/n]"
|
colored_echo "Do you want to activate auto connect service at boot up? [Y/n]"
|
||||||
read auto_reconnect
|
read auto_reconnect
|
||||||
|
|
||||||
colored_echo "You chose $auto_reconnect" ${GREEN}
|
colored_echo "You chose $auto_connect" ${GREEN}
|
||||||
|
|
||||||
case $auto_reconnect in
|
case $auto_reconnect in
|
||||||
[Yy]* ) colored_echo "Copying setup file..."
|
[Yy]* ) colored_echo "Copying setup file..."
|
||||||
@ -165,10 +167,12 @@ do
|
|||||||
# APN Configuration
|
# APN Configuration
|
||||||
sed -i "s/SIM_APN/$carrierapn/" jetson_configure_modem.sh
|
sed -i "s/SIM_APN/$carrierapn/" jetson_configure_modem.sh
|
||||||
|
|
||||||
|
# Devicename
|
||||||
|
sed -i "s/DEVICE/$devicename/" jetson_configure_modem.sh
|
||||||
|
|
||||||
mv functions.sh $PPP_PATH
|
mv functions.sh $PPP_PATH
|
||||||
mv configs.sh $PPP_PATH
|
mv configs.sh $PPP_PATH
|
||||||
mv jetson_configure_modem.sh $PPP_PATH
|
mv jetson_configure_modem.sh $PPP_PATH
|
||||||
mv $RECONNECT_SCRIPT_NAME $PPP_PATH
|
|
||||||
mv $MANAGER_SCRIPT_NAME $PPP_PATH
|
mv $MANAGER_SCRIPT_NAME $PPP_PATH
|
||||||
mv $SERVICE_NAME /etc/systemd/system/
|
mv $SERVICE_NAME /etc/systemd/system/
|
||||||
|
|
||||||
|
@ -5,17 +5,18 @@ source functions.sh
|
|||||||
# only for "2: 3G, 4G/LTE Base Shield"
|
# only for "2: 3G, 4G/LTE Base Shield"
|
||||||
|
|
||||||
# default arguments
|
# default arguments
|
||||||
APN=${SIM_APN:-super}
|
APN=SIM_APN
|
||||||
|
PORT=/dev/DEVICE
|
||||||
|
|
||||||
### Modem configuration for RMNET/PPP mode ##################################
|
### Modem configuration for RMNET/PPP mode ##################################
|
||||||
debug "Checking APN and Modem Modem..."
|
debug "Checking APN and Modem Modem..."
|
||||||
|
|
||||||
# APN Configuration
|
# APN Configuration
|
||||||
# -----------------
|
# -----------------
|
||||||
atcom "AT+CGDCONT?" | grep $APN > /dev/null
|
atcom -p $PORT "AT+CGDCONT?" | grep $APN > /dev/null
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
atcom "AT+CGDCONT=1,\"IPV4V6\",\"$APN\""
|
atcom -p $PORT "AT+CGDCONT=1,\"IPV4V6\",\"$APN\""
|
||||||
debug "APN is updated."
|
debug "APN is updated."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -37,38 +38,8 @@ if [[ $IS_QUECTEL -eq 0 ]]; then
|
|||||||
if [[ $MODEL_EC25E -eq 0 ]]; then
|
if [[ $MODEL_EC25E -eq 0 ]]; then
|
||||||
|
|
||||||
# EC25 or derives.
|
# EC25 or derives.
|
||||||
atcom "AT+QCFG=\"usbnet\"" | grep 0 > /dev/null
|
sudo pon
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
atcom "AT+QCFG=\"usbnet\",0"
|
|
||||||
debug "PPP mode is activated."
|
|
||||||
debug "Modem restarting..."
|
|
||||||
|
|
||||||
sleep 20
|
|
||||||
|
|
||||||
# Check modem is started
|
|
||||||
route -n | grep wwan0 >> /dev/null
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
# If modem don't reboot automatically, reset manually
|
|
||||||
atcom "AT+CFUN=1,1" # rebooting modem
|
|
||||||
sleep 20
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check modem is started!
|
|
||||||
for i in {1..120}; do
|
|
||||||
route -n | grep wwan0 >> /dev/null
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo
|
|
||||||
debug "Modem is restarted."
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
printf "*"
|
|
||||||
done
|
|
||||||
sleep 5 # wait until modem is ready
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unknown
|
# Unknown
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Jetson PPP Connection Manager
|
Description=Jetson PPP Connection Manager
|
||||||
After=network.target
|
# NEEDS TO BE CHANGED TO YOUR DEVICE
|
||||||
|
After=dev-sixfab03.device
|
||||||
|
# OR
|
||||||
|
# After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Type=simple
|
||||||
ExecStart=/bin/bash jetson_ppp_connection_manager.sh
|
ExecStart=/bin/bash jetson_ppp_connection_manager.sh
|
||||||
WorkingDirectory=/opt/sixfab/ppp_connection_manager
|
WorkingDirectory=/opt/sixfab/ppp_connection_manager
|
||||||
StandardOutput=inherit
|
StandardOutput=inherit
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
Restart=always
|
RemainAfterExit=true
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -10,11 +10,3 @@ for i in {1..4}; do
|
|||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $MODEM_CONFIG -eq 0 ]]; then
|
|
||||||
bash ppp_reconnect.sh
|
|
||||||
else
|
|
||||||
debug "Modem configuration is failed multiple times!"
|
|
||||||
debug "Checkout other troubleshooting steps on docs.sixfab.com."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user