PINE64
Howto: Mobile data on pmOS + Phosh with APN requiring user/pass - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: General Discussion on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=127)
+--- Thread: Howto: Mobile data on pmOS + Phosh with APN requiring user/pass (/showthread.php?tid=9268)



Howto: Mobile data on pmOS + Phosh with APN requiring user/pass - pajux - 02-23-2020

Have been having trouble getting mobile data on any of the available distributions, and finally with the help of IRC, manpages, and a few guides, I managed to get mobile data on my operator, which requires setting up an APN with user and password.

So for me it wasn't a simple matter of using ofonoctl wan --connect --append-dns, or simply enabling ofonod, or anything of the sorts. I had to dig in deeper.

This has only been tested under pmOS + Phosh so far, because it uses NetworkManager and it's easy to install ModemManager without messing up the whole system (like I did once under Ubuntu Touch). YMMV on other distributions.

Step 1

Install pmOS your favorite way, and make sure to install modemmanager


Code:
apk add modemmanager


Step 2

Disable ofono, enable modemmanager at startup

As root:

Code:
rc-service ofono stop
rc-update del ofono
rc-update del ofono-auto-enable
rc-update add modemmanager
rc-service modemmanger start


Step 3

Wait 10-20 seconds and check the status of your modem with:


Code:
mmcli -L
mmcli -m 0


If all is good, you can also see the 4G and modem icons in the status bar.

Step 4

Create a "bearer"

Code:
mmcli -m 0 --create-bearer='apn=APN.NAME,user=USERNAME,password=PASSWORD,allowed-auth=chap,allow-roaming=no'


auth and roaming may vary on your provider.

Once you've done the above successfully, you should see a new device in network manager (previously it was alled ttyUSB2) : cdc-wdm0

This is the device name to use in the next step

Step 5

Now configure the connection with nmcli, I'm not sure if you need to specify tall the APN info all over again or not, I'll have to try without and update this guide:

nmcli c add type gsm ifname cdc-wdm0 con-name OPERATOR-NAME apn APN.NAME user USERNAME password PASSWORD

Step 6

Verify connectivity with all the usual commands


Code:
nmcli c   # check status of the connection named OPERATOR-NAME as above
nmcli d    #  check status of cdc-wdm0
ip addr   # check for wwan0


and so on.

References:
https://docs.ubuntu.com/core/en/stacks/network/modem-manager/docs/configuring-cellular-connections
https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-cellular-connections
https://www.freedesktop.org/software/ModemManager/man/1.0.0/mmcli.8.html


RE: Howto: Mobile data on pmOS + Phosh with APN requiring user/pass - pajux - 02-28-2020

I hear that ofono would be needed for phonecalls (which my SIM can't do), so YMMV...


RE: Howto: Mobile data on pmOS + Phosh with APN requiring user/pass - mozzwald - 02-28-2020

(02-28-2020, 09:06 PM)pajux Wrote: I hear that ofono would be needed for phonecalls (which my SIM can't do), so YMMV...

Nope, you don't need ofono for voice calls. ModemManager handles them just fine. You need something to handle routing the audio when calls are answered. The PureOS PinePhone image only has ModemManager installed and works with calls, sms and data.


RE: Howto: Mobile data on pmOS + Phosh with APN requiring user/pass - pajux - 02-29-2020

(02-28-2020, 09:36 PM)mozzwald Wrote:
(02-28-2020, 09:06 PM)pajux Wrote: I hear that ofono would be needed for phonecalls (which my SIM can't do), so YMMV...

Nope, you don't need ofono for voice calls. ModemManager handles them just fine. You need something to handle routing the audio when calls are answered. The PureOS PinePhone image only has ModemManager installed and works with calls, sms and data.

Good to know, awesome!