Wireless Modem internet on PinePhone
The kernel needs to be configured with
CONFIG_USB_NET_QMI_WWAN
and qmi_wwan
module needs to
be loaded first.
To enable data connection you can use
qmicli
tool from libqmi
package.
Enable modem power
echo 1 > /sys/class/modem-power/modem-power/device/powered
Configure APN
Connect to the modem once it's powered up via:
screen /dev/ttyUSB2 115200
Run the command to configure APN (may vary by operator):
AT+CGDCONT=1,"IP","internet"
Disconnect by
CTRL+a k
.
Start the network
qmicli -d /dev/cdc-wdm0 --wds-start-network=apn=internet --client-no-release-cid
Configure IP addresses:
qmicli -d /dev/cdc-wdm0 --wds-get-current-settings
[/dev/cdc-wdm0] Current settings retrieved: IP Family: IPv4 IPv4 address: 10.130.248.26 IPv4 subnet mask: 255.255.255.252 IPv4 gateway address: 10.130.248.25 IPv4 primary DNS: 93.153.117.49 IPv4 secondary DNS: 93.153.117.17 MTU: 1500 Domains: none
ip a add 10.130.248.26/255.255.255.252 dev wwan0 ip r add default via 10.130.248.25
And if you want the mobile operator's DNS servers, add them to resolv.conf.