mirror of
https://github.com/clockworkpi/uConsole.git
synced 2025-12-12 10:08:50 +01:00
Compare commits
3 Commits
b25fcc578a
...
36eeb67a1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36eeb67a1b | ||
|
|
d11028e98c | ||
|
|
8616e50c5d |
59
Code/scripts/uconsole-4g-cm4
Executable file
59
Code/scripts/uconsole-4g-cm4
Executable file
@ -0,0 +1,59 @@
|
||||
#!/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
|
||||
Loading…
x
Reference in New Issue
Block a user