added lte technology selection for cellulariot hats

This commit is contained in:
Yasin Kaya 2019-04-12 16:18:14 +03:00
parent d4a349b3c7
commit c0118f37f8
2 changed files with 28 additions and 1 deletions

View File

@ -7,8 +7,8 @@ ABORT "NO ANSWER"
TIMEOUT 30 TIMEOUT 30
"" AT "" AT
OK ATE0 OK ATE0
#EXTRA
OK ATI;+CSUB;+CSQ;+COPS?;+CGREG?;&D2 OK ATI;+CSUB;+CSQ;+COPS?;+CGREG?;&D2
OK AT+CGDCONT=1,"IP","\T",,0,0 OK AT+CGDCONT=1,"IP","\T",,0,0
#EXTRA
OK ATD*99# OK ATD*99#
CONNECT CONNECT

View File

@ -18,6 +18,21 @@ case $answer in
*) echo "${YELLOW}You did not chose 1, 2 or 3${SET}"; exit 1; *) echo "${YELLOW}You did not chose 1, 2 or 3${SET}"; exit 1;
esac esac
if [ $answer -eq 3 ]; then
echo "${YELLOW}Please choose LTE Technology:${SET}"
echo "${YELLOW}1: GPRS/EDGE${SET}"
echo "${YELLOW}2: CATM1${SET}"
echo "${YELLOW}3: NB-IoT${SET}"
read answer4
case $answer4 in
1) echo "${YELLOW}You chose GPRS/EDGE${SET}";;
2) echo "${YELLOW}You chose CATM1${SET}";;
3) echo "${YELLOW}You chose NB-IoT${SET}";;
*) echo "${YELLOW}You did not chose 1, 2 or 3${SET}"; exit 1;
esac
fi
echo "${YELLOW}Downloading setup files${SET}" echo "${YELLOW}Downloading setup files${SET}"
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/chat-connect -O chat-connect wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/chat-connect -O chat-connect
@ -64,8 +79,20 @@ read carrierapn
echo "${YELLOW}What is your device communication PORT? (ttyS0/ttyUSB3/etc.)${SET}" echo "${YELLOW}What is your device communication PORT? (ttyS0/ttyUSB3/etc.)${SET}"
read devicename read devicename
if [ $answer4 -eq 1 ]; then
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",01,1\nOK AT+QCFG="nwscanmode",1,1\nOK AT+QCFG="iotopmode",2,1' EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",01,1\nOK AT+QCFG="nwscanmode",1,1\nOK AT+QCFG="iotopmode",2,1'
elif [ $answer4 -eq 2 ]; then
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",02,1\nOK AT+QCFG="nwscanmode",3,1\nOK AT+QCFG="iotopmode",0,1'
elif [ $answer4 -eq 3 ]; then
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",03,1\nOK AT+QCFG="nwscanmode",3,1\nOK AT+QCFG="iotopmode",1,1'
fi
mkdir -p /etc/chatscripts mkdir -p /etc/chatscripts
if [ $answer -eq 3 ]; then if [ $answer -eq 3 ]; then
sed -i "s/#EXTRA/$EXTRA/" chat-connect sed -i "s/#EXTRA/$EXTRA/" chat-connect