mirror of
https://github.com/clockworkpi/uConsole.git
synced 2025-12-12 18:18:50 +01:00
60 lines
653 B
Bash
Executable File
60 lines
653 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function tip {
|
|
|
|
echo "use mmcli -L to see 4G modem or not"
|
|
}
|
|
|
|
function enable4g {
|
|
|
|
echo "Power on 4G module on uConsole cm4"
|
|
|
|
sudo gpio mode 24 out
|
|
sudo gpio write 24 1
|
|
|
|
sudo gpio mode 15 out
|
|
sudo gpio write 15 1
|
|
|
|
sleep 5
|
|
sudo gpio write 15 0
|
|
|
|
echo "waiting..."
|
|
sleep 13
|
|
echo "done"
|
|
|
|
}
|
|
|
|
function disable4g {
|
|
echo "Power off 4G module"
|
|
|
|
sudo gpio mode 24 out
|
|
sudo gpio write 24 0
|
|
|
|
sudo gpio write 24 1
|
|
sleep 3
|
|
sudo gpio write 24 0
|
|
|
|
sleep 20
|
|
|
|
echo "Done"
|
|
|
|
}
|
|
if [ "$#" -ne 1 ] ; then
|
|
echo "$0: enable/disable"
|
|
exit 3
|
|
fi
|
|
|
|
|
|
if [ $1 == "enable" ]; then
|
|
|
|
enable4g;
|
|
tip;
|
|
|
|
fi
|
|
|
|
|
|
if [ $1 == "disable" ]; then
|
|
disable4g
|
|
tip;
|
|
fi
|