From c0118f37f8bf107c57ff30ef8bce51c2c58cf349 Mon Sep 17 00:00:00 2001 From: Yasin Kaya Date: Fri, 12 Apr 2019 16:18:14 +0300 Subject: [PATCH] added lte technology selection for cellulariot hats --- ppp_installer/chat-connect | 2 +- ppp_installer/install.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ppp_installer/chat-connect b/ppp_installer/chat-connect index 12e205d..a805329 100644 --- a/ppp_installer/chat-connect +++ b/ppp_installer/chat-connect @@ -7,8 +7,8 @@ ABORT "NO ANSWER" TIMEOUT 30 "" AT OK ATE0 +#EXTRA OK ATI;+CSUB;+CSQ;+COPS?;+CGREG?;&D2 OK AT+CGDCONT=1,"IP","\T",,0,0 -#EXTRA OK ATD*99# CONNECT diff --git a/ppp_installer/install.sh b/ppp_installer/install.sh index a58cb96..5ba4f50 100644 --- a/ppp_installer/install.sh +++ b/ppp_installer/install.sh @@ -18,6 +18,21 @@ case $answer in *) echo "${YELLOW}You did not chose 1, 2 or 3${SET}"; exit 1; 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}" 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}" 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' +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 if [ $answer -eq 3 ]; then sed -i "s/#EXTRA/$EXTRA/" chat-connect