From 147c65f77685034a8bdce758a6eed2862a46edd8 Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Fri, 11 Oct 2019 23:05:57 +0300 Subject: [PATCH 1/3] BASE HAT information added to the README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4a6c1f..a92ee99 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Sixfab offers Shields/HATs for Raspberry Pi which provides cellular Internet con * [Raspberry Pi Tracker HAT ](https://sixfab.com/product/raspberry-pi-gprs-gps-tracker-hat/) +* [Raspberry Pi 3G/4G<E Base HAT](https://sixfab.com/product/raspberry-pi-base-hat-3g-4g-lte-minipcie-cards/) + 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. Without further ado let us jump into the installation process: @@ -36,9 +38,8 @@ It will ask several questions, just answer them accordingly to complete the inst `Please choose your Sixfab Shield/HAT` You will be offered to choose among the mentioned four shields/HAT. Then it will fetch required scripts for you. -`Do you have updated kernel` -It asks if your kernel is up-to-date. If no[n] it updates the kernel else it skips the update. Then it installs ppp.  +Then it installs ppp.  `What is your carrier APN?` From 3f7782e949465c8ba3a3c3efb2223e7d7b9443e2 Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Fri, 11 Oct 2019 23:06:29 +0300 Subject: [PATCH 2/3] BASE HAT reconnect script added --- ppp_installer/reconnect_basehat | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ppp_installer/reconnect_basehat diff --git a/ppp_installer/reconnect_basehat b/ppp_installer/reconnect_basehat new file mode 100644 index 0000000..e870673 --- /dev/null +++ b/ppp_installer/reconnect_basehat @@ -0,0 +1,21 @@ +#!/bin/sh +# /usr/src/reconnect +# for Base HAT + +gpio -g mode 26 out #HAT_POWER_OFF +gpio -g mode 19 out #W_DISABLE + +gpio -g write 26 0 +gpio -g write 19 0 + +while true; do + + 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 + + sleep 10 +done From ad9f62aaf02cee8e69f1278844aa9a4db145d0c1 Mon Sep 17 00:00:00 2001 From: saeedjohar Date: Sun, 13 Oct 2019 22:14:14 +0300 Subject: [PATCH 3/3] 3G,4G/LTE BASE HAT installation added --- ppp_installer/install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ppp_installer/install.sh b/ppp_installer/install.sh index a172bd2..4ae67e0 100755 --- a/ppp_installer/install.sh +++ b/ppp_installer/install.sh @@ -11,6 +11,8 @@ 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}" +echo "${YELLOW}6: 3G/4G Base HAT${SET}" + read shield_hat case $shield_hat in @@ -18,7 +20,8 @@ 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}";; + 5) echo "${YELLOW}You chose Tracker HAT${SET}";; + 6) echo "${YELLOW}You chose 3G/4G Base HAT${SET}";; *) echo "${RED}Wrong Selection, exiting${SET}"; exit 1; esac @@ -167,12 +170,15 @@ do wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_tracker -O reconnect.sh + elif [ $shield_hat -eq 6 ]; then + + wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_basehat -O reconnect.sh + fi mv reconnect.sh /usr/src/ mv reconnect.service /etc/systemd/system/ - systemctl daemon-reload systemctl enable reconnect.service