PINE64

Full Version: Modem Shutdown/Startup Scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Have you cut a hole in the back cover of your pinephone and regularly switch off your cellular modem with the dip switch to keep the 3 letters from being creepy? If so, you will need these scripts so you can turn off/on the modem without having to restart your phone.

Turning modem off:

Install "minicom"

Code:
sudo apk install minicom


Create file "modem_shutdown" with the following text:

Code:
sudo minicom -S shut_down -D /dev/ttyUSB2

Create file "shut_down" with the following text:

Code:
send AT+QPOWD=1

now make both executable (Probably don't need to make "shut_down" executable)
I also added read/write so I can edit them as needed later.

Code:
sudo chmod 700 modem_shutdown
sudo chmod 700 shut_down

Install gnome-terminal (So you can click "Run in terminal" in the filemanager "Nemo")

Code:
sudo apk install gnome-terminal

now click on "modem_shutdown" in your home or whatever directory you put these files. Be sure to click "open in terminal" and supply your user password. You should see a minicom screen pop up and it will eventually say "Cannot open /dev/ttyUSB2!". Close out the minicom instance. You can now switch off the modem with the dip switch.

Turning modem on:

Create file "modem_startup" with the following text:

Code:
sudo rc-service eg25-manager restart

make it executable

Code:
sudo chmod 700 modem_startup

Flip the dip switch back on and click on "modem_startup" and "Run in terminal" like the shutdown script.