Mobile network won't start

When I get out, the phone doesn’t connect. Why?

While I’m connected on Wi-Fi, the gsm looks like ready:

[ale@alesmart ~]$ sudo nmcli dev show cdc-wdm0
GENERAL.DEVICE:                         cdc-wdm0
GENERAL.TYPE:                           gsm
GENERAL.HWADDR:                         (unknown)
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     TIM - Maxxi Alice/Internet
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/2
IP4.ADDRESS[1]:                         10.58.62.150/30
IP4.GATEWAY:                            10.58.62.149
IP4.ROUTE[1]:                           dst = 10.58.62.148/30, nh = 0.0.0.0, mt = 700
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.58.62.149, mt = 700
IP4.DNS[1]:                             217.200.201.67
IP4.DNS[2]:                             217.200.201.66
IP6.GATEWAY:                            --

It has no MAC address. Does it need one? Anyway, it doesn’t work:

[ale@alesmart ~]$ sudo traceroute -g 10.58.62.149 10.58.62.1
traceroute to 10.58.62.1 (10.58.62.1), 30 hops max, 72 byte packets
 1  * * *
 2  * * *
 3  * * *
...
29  * * *
30  * * *

Did you activate an APN in the Cellular settings?

That is not done by default at this point.

Yes, I did. I found advice for my provider at apnsettings.org and apn.how. The connection name changed, presumably after some data exchange when the connection started, but the APN is one of the two I typed.

I guess the modem should need some more configuration, for I don’t recall typing the pin anywhere. Isn’t it used?

[ale@alesmart ~]$ sudo nmcli connection show --active 'TIM - Maxxi Alice/Internet'
connection.id:                          TIM - Maxxi Alice/Internet
...
gsm.auto-config:                        no
gsm.number:                             --
gsm.username:                           --
gsm.password:                           <hidden>
gsm.password-flags:                     4 (not required)
gsm.apn:                                "ibox.tim.it"
gsm.network-id:                         --
gsm.pin:                                <hidden>
gsm.pin-flags:                          0 (none)
gsm.home-only:                          no
gsm.device-id:                          c08a5b86590ae8b8c8f92a36828ab114856a69fb
gsm.sim-id:                             --
gsm.sim-operator-id:                    --
gsm.mtu:                                auto
...

Now this is strange. The TelCo charges me for Internet navigation. So I collected a debug log, trying to see what happens. It is ~1,180Kb for ~18 minutes last night, during which the pinephone was left untouched.

ModemManager initializes the modem, creates a Bearer (what is that?) in about a minute. Then, it starts asking for signal strength and packet statistics every 30sec. Although it logs connection monitoring is unsupported by the device, it also receives other status data which it didn’t ask for.

The Tx and Rx byte counts slowly grow, but I don’t see what is being transmitted and received.

Extracting eg25-manager lines is discomforting:

Jan 26 01:02:24 alesmart eg25-manager[3120]: Modem is up for 120 seconds and fully ready
Jan 26 01:02:24 alesmart eg25-manager[3120]: dropping systemd sleep block inhibitor
Jan 26 01:10:33 alesmart eg25-manager[3120]: Response: [+QGPSURC: "xtradataexpire",0,"2023/01/25,14:00:00"]
Jan 26 01:10:33 alesmart eg25-manager[3120]: Rescheduling upload since modem isn't online yet, in 30s
Jan 26 01:18:35 alesmart eg25-manager[3120]: ModemManager object `/org/freedesktop/ModemManager1/Modem/38' removed
Jan 26 01:18:35 alesmart eg25-manager[3120]: Lost modem, resetting...

At 01:10:33 the modem had been connected for a while, but it reschedules something since modem isn’t online yet — and did nothing after 30s. Removing the modem was logged after the following by ModemManager:

Jan 26 01:18:35 alesmart ModemManager[3243]: <debug> [ttyUSB0/qcdm] unexpected port hangup!
Jan 26 01:18:35 alesmart ModemManager[3243]: <debug> [ttyUSB0/qcdm] forced to close port
Jan 26 01:18:35 alesmart ModemManager[3243]: <debug> [ttyUSB0/qcdm] device open count is 0 (close)
Jan 26 01:18:35 alesmart ModemManager[3243]: <debug> [ttyUSB0/qcdm] closing serial port...
Jan 26 01:18:35 alesmart ModemManager[3243]: <debug> [ttyUSB0/qcdm] serial port closed
Jan 26 01:18:35 alesmart kernel: usb 2-1: USB disconnect, device number 45

After all lines are closed and reset, initialization restarts.

When I look at it, the gsm network is always disconnected (UNKNOWN):

[ale@alesmart ~]$ ip addr show wwan0
9: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/none 
    inet 10.58.68.176/27 brd 10.58.68.191 scope global noprefixroute wwan0
       valid_lft forever preferred_lft forever

Does the modem come back up after eg25-manager resets it? Can you make phone calls or SMS with it? (If your provider has some free service number(s), e.g., to check prepaid balance or similar, you can try calling that so you can test phone calls without getting charged.)

(I am trying to figure out whether it is just mobile data that is broken for you or the modem altogether.)