From cbbde5ce23bceb3862248e00d1d4380984eb4292 Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Wed, 9 Oct 2019 13:53:28 +0300 Subject: [PATCH 1/3] tracker description added --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee35746..c4a6c1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Sixfab_PPP_Installer Repository of Sixfab PPP Installer Tool -Sixfab offers Shields for Raspberry Pi which provides cellular Internet connection anywhere with the availability of mobile network coverage. These shields are: +Sixfab offers Shields/HATs for Raspberry Pi which provides cellular Internet connection anywhere with the availability of mobile network coverage. These shields are: * [Raspberry Pi GSM/GPRS Shield](https://www.sixfab.com/product/gsmgprs-shield/) @@ -9,8 +9,9 @@ Sixfab offers Shields for Raspberry Pi which provides cellular Internet connecti * [Raspberry Pi Cellular IoT Application Shield](https://www.sixfab.com/product/raspberry-pi-cellular-iot-application-hat/) -* [Raspberry Pi Cellular IoT HAT ](https://sixfab.com/product/raspberry-pi-lte-m-nb-iot-egprs-cellular-hat/) +* [Raspberry Pi Cellular IoT HAT ](https://sixfab.com/product/raspberry-pi-lte-m-nb-iot-egprs-cellular-hat/) +* [Raspberry Pi Tracker HAT ](https://sixfab.com/product/raspberry-pi-gprs-gps-tracker-hat/) Each of these shield can be connected to Internet via PPP(Point to Point Protocol). For this tutorial we have written an script to install and perform required steps. @@ -50,12 +51,14 @@ Then it asks if your carrier needs username and password. `Enter username` If yes then it will ask for user name. +`Enter password` +Then it will ask for password. Once you type the username asks for password. -`Enter your PORT name` +`What is your device communication PORT? (ttyS0/ttyUSB3/etc.` -In this step you will enter your PORT. For 3G, 4G/LTE Base Shield it will be ttyUSB3. +In this step you will enter your PORT. e.g For 3G, 4G/LTE Base Shield it will be ttyUSB3. `Do you want to activate auto connect/reconnect service at R.Pi boot up?` From b9eafdc3f6f9109949f8c035e91d1b4494730adc Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Wed, 9 Oct 2019 13:55:04 +0300 Subject: [PATCH 2/3] installer modified for Tracker HAT --- ppp_installer/install.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/ppp_installer/install.sh b/ppp_installer/install.sh index 9dfa308..a172bd2 100755 --- a/ppp_installer/install.sh +++ b/ppp_installer/install.sh @@ -10,6 +10,7 @@ echo "${YELLOW}1: GSM/GPRS Shield${SET}" echo "${YELLOW}2: 3G, 4G/LTE Base Shield${SET}" echo "${YELLOW}3: Cellular IoT App Shield${SET}" echo "${YELLOW}4: Cellular IoT HAT${SET}" +echo "${YELLOW}5: Tracker HAT${SET}" read shield_hat case $shield_hat in @@ -17,6 +18,7 @@ case $shield_hat in 2) echo "${YELLOW}You chose Base Shield${SET}";; 3) echo "${YELLOW}You chose CellularIoT Shield${SET}";; 4) echo "${YELLOW}You chose CellularIoT HAT${SET}";; + 5) echo "${YELLOW}You chose Tracker HAT${SET}";; *) echo "${RED}Wrong Selection, exiting${SET}"; exit 1; esac @@ -59,7 +61,7 @@ if [ $? -ne 0 ]; then echo "${RED}Download failed${SET}" exit 1; fi - +:' while [ 1 ] do echo "${YELLOW}Do you have updated kernel? [Y/n] ${SET}" @@ -74,7 +76,7 @@ do *) echo "${RED}Wrong Selection, Select among Y or n${SET}";; esac done - +' echo "${YELLOW}ppp install${SET}" apt-get install ppp @@ -143,23 +145,28 @@ do case $auto_reconnect in [Yy]* ) echo "${YELLOW}Downloading setup file${SET}" - wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_service -O reconnect.service + wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_service -O reconnect.service - if [ $shield_hat -eq 1 ]; then + if [ $shield_hat -eq 1 ]; then wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_gprsshield -O reconnect.sh - elif [ $shield_hat -eq 2 ]; then + elif [ $shield_hat -eq 2 ]; then wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_baseshield -O reconnect.sh - elif [ $shield_hat -eq 3 ]; then + elif [ $shield_hat -eq 3 ]; then wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_cellulariot_app -O reconnect.sh - elif [ $shield_hat -eq 4 ]; then + elif [ $shield_hat -eq 4 ]; then wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_cellulariot -O reconnect.sh + + elif [ $shield_hat -eq 5 ]; then + + wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_tracker -O reconnect.sh + fi mv reconnect.sh /usr/src/ From 7758c58028bf2d7cdf7e0678e86972a5cf152fd8 Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Wed, 9 Oct 2019 13:55:31 +0300 Subject: [PATCH 3/3] reconnect script added for Tracker HAT --- ppp_installer/reconnect_tracker | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ppp_installer/reconnect_tracker diff --git a/ppp_installer/reconnect_tracker b/ppp_installer/reconnect_tracker new file mode 100644 index 0000000..faee971 --- /dev/null +++ b/ppp_installer/reconnect_tracker @@ -0,0 +1,30 @@ +#!/bin/sh + +gpio -g mode 23 in #status +gpio -g mode 24 out #powerkey +gpio -g mode 17 out #disable +# enabling the power of the HAT +gpio -g write 17 1 +sleep 1 +gpio -g write 17 0 + +while true; do + + if [ $(gpio -g read 23) = "0" ]; then + echo "Power up" + + gpio -g write 24 1 + sleep 2 + gpio -g write 24 0 + sleep 2 + else + ping -q -I ppp0 -c 1 8.8.8.8 -s 0 >/dev/null + + if [ $? -ne 0 ]; then + echo "Connection down, reconnecting..." + sudo pon + fi + fi + + sleep 10 +done