xnux.eu - site map - news

Modem on PinePhone

Enabling and disabling power to the modem

(My kernel is a bit special, since compared to pine64-org kernel, it doesn't enable modem power automatically, so beware.)

To enable modem run this script once (not made to be run repeatedly):

#!/bin/sh

GPIO=/sys/class/gpio
PIN=/sys/class/gpio/gpio
PB3_PWRKEY=35
PL7_PWR=359
PC4_RESET=68
PH8_DISABLE=232
PH7_WAKEUP=231

modprobe usb_serial_simple 
modprobe usbserial
modprobe option
modprobe qcaux
modprobe cdc-acm
modprobe qcserial

echo $PL7_PWR > $GPIO/export
echo $PC4_RESET > $GPIO/export
echo $PH7_WAKEUP > $GPIO/export
echo $PH8_DISABLE > $GPIO/export
echo $PB3_PWRKEY > $GPIO/export

echo out > $PIN$PH8_DISABLE/direction
echo out > $PIN$PH7_WAKEUP/direction
echo out > $PIN$PC4_RESET/direction
echo out > $PIN$PL7_PWR/direction
echo out > $PIN$PB3_PWRKEY/direction

echo 0 > $PIN$PH8_DISABLE/value
echo 0 > $PIN$PH7_WAKEUP/value
echo 0 > $PIN$PC4_RESET/value

echo 1 > $PIN$PL7_PWR/value
sleep 0.1
echo 1 > $PIN$PB3_PWRKEY/value
sleep 0.2
echo 0 > $PIN$PB3_PWRKEY/value

To disable modem (only after it was enabled :))

#!/bin/sh

GPIO=/sys/class/gpio
PIN=/sys/class/gpio/gpio
PB3_PWRKEY=35
PL7_PWR=359
PC4_RESET=68
PH8_DISABLE=232
PH7_WAKEUP=231

echo 1 > $PIN$PB3_PWRKEY/value
sleep 0.8
echo 0 > $PIN$PB3_PWRKEY/value

echo waiting for shutdown
sleep 30

echo 0 > $PIN$PL7_PWR/value

Connecting to the modem

You can connect to the modem once it's powered up via:

screen /dev/ttyUSB2 115200

Disconnect by CTRL+a k.

Setting up the modem for voice calling

Once per a lifetime you have to run AT+QDAI=1,0,0,2,0,1,1,1 and reboot the modem. That will configure audio on the modem side correctly and store the configuration persistently inside the modem.

To setup audio for call use my call audio setup program.

You need to run the program after the call starts twice. Once with your desired audio setup without -2 option and once with -2 option.

To answer a call type ATA, to make a call ATDsomenumber;, to hangup ATH.

That's it. ;)