02-23-2020, 10:14 PM
(This post was last modified: 02-27-2020, 06:13 PM by pajux.
Edit Reason: reference material
)
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
Step 2
Disable ofono, enable modemmanager at startup
As root:
Step 3
Wait 10-20 seconds and check the status of your modem with:
If all is good, you can also see the 4G and modem icons in the status bar.
Step 4
Create a "bearer"
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
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
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