Howto: Mobile data on pmOS + Phosh with APN requiring user/pass
#1
Star 
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/n...onnections
https://docs.ubuntu.com/core/en/stacks/n...onnections
https://www.freedesktop.org/software/Mod...cli.8.html
  Reply
#2
I hear that ofono would be needed for phonecalls (which my SIM can't do), so YMMV...
  Reply
#3
(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.
  Reply
#4
(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!
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Mobile Carriers in the United States aren 20 1,595 03-21-2020, 06:20 PM
Last Post: bcnaz

Forum Jump:


Users browsing this thread: 1 Guest(s)