From cf00e2f34752bd23fc3abbe6e4f05d391dc62d1d Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 9 Feb 2021 13:55:17 +0000 Subject: [PATCH] Update install_fw_nanohs.sh If this runs on a Nano Pi board running on Pi-Star, reset some gpio pins to put the modem in the correct state. Only affects this single Modem (as far as I know) --- scripts/install_fw_nanohs.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/install_fw_nanohs.sh b/scripts/install_fw_nanohs.sh index b61b8a9..a8b72f7 100755 --- a/scripts/install_fw_nanohs.sh +++ b/scripts/install_fw_nanohs.sh @@ -16,6 +16,17 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# If we run this on a NanoPi board set the GPIO pins +if [ -f /etc/pistar-release ]; then + hardware=$(grep -i hardware /etc/pistar-release | awk -F "= " '{print $2}') + if [[ ${hardware} == "NanoPi" ]]; then + echo 3 > /sys/class/gpio/export + echo out > /sys/class/gpio/gpio3/direction + echo 1 > /sys/class/gpio/gpio3/value + echo 3 > /sys/class/gpio/unexport + fi +fi + # Configure latest version FW_VERSION="v1.5.2"