One of the issues I was facing in EM12-G RIL integration with Android 10 NXP iMX8M was that telephony.db had no APN entries.
To fix this, I put the apns-conf.xml file in /data/misc/ and /data/data/misc/.
Eventually I noticed a “…” on the “Settings > Mobile network > Three > APN > this cannot be configured by the user” screen.
Clicking it revealed one menu entry titled: “Reset to default”.
Clicking that caused some flickering, and then I had a list of “Three” APNs. I selected the top one, “three.co.uk”.
Now I have a non-working wwan0 which has an IP, but whose state is UNKNOWN.
What can I do to fix this?
03-05 02:53:55.696 D/use-Rlog/RLOG-RIL ATC( 3426): really time out
**03-05 02:53:55.696 D/use-Rlog/RLOG-RIL NDIS( 3426): QmiThreadSendQMITimeout pthread_cond_timeout_np=110, errno: 99 (Cannot assign requested address)**
03-05 02:53:56.230 D/use-Rlog/RLOG-RIL NDIS( 3426): Get clientWDS = 19
03-05 02:53:56.294 D/use-Rlog/RLOG-RIL NDIS( 3426): Get clientWDS = 20
03-05 02:53:56.358 D/use-Rlog/RLOG-RIL NDIS( 3426): Get clientWDA = 1
03-05 02:53:56.420 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_wds_bind_mux_data_port_and_set_ip_family
03-05 02:53:56.420 D/use-Rlog/RLOG-RIL NDIS( 3426): curCallID=0, curIpFamily=4
03-05 02:53:56.484 D/use-Rlog/RLOG-RIL NDIS( 3426): curCallID=0, curIpFamily=6
03-05 02:53:56.613 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_init exit
03-05 02:53:56.613 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_wds_start_data_call curCallID=0, curIpFamily=4
03-05 02:53:56.678 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_wds_start_data_call WdsConnectionIPv4Handle: 0x23303700
03-05 02:53:56.678 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_wds_get_runtime_settings curCallID=0, curIpFamily=4
03-05 02:53:56.741 D/use-Rlog/RLOG-RIL NDIS( 3426): qmidev_data_call_state_change IPv4ConnectionStatus[0]: CONNECTED
03-05 02:53:56.805 D/use-Rlog/RLOG-RIL SETUP_DATA_CA( 3426): ql_set_data_call_info pdp=1, ifname=wwan0, iptype=4, ipaddr=10.95.207.21
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL SETUP_DATA_CA( 3426): wwan0 IPv4 Address: 10.95.207.21
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL SETUP_DATA_CA( 3426): wwan0 IPv6 Address: 0:0:fe80::3499:50ff
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL SETUP_DATA_CA( 3426): wwan0 IP Address: 10.95.207.21
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL SETUP_DATA_CA( 3426): get_local_ip: 10.95.207.21, cost 3 sec
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL RILC( 3426): onRequest: GSM_SET_BROADCAST_SMS_CONFIG datalen=8
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL RILC( 3426): onRequest: OPERATOR
03-05 02:53:56.807 D/use-Rlog/RLOG-RIL ATC( 3426): AT> AT+COPS=3,0;+COPS?;+COPS=3,1;+COPS?;+COPS=3,2;+COPS?
03-05 02:53:56.809 D/RILJ ( 3936): [0080]< SETUP_DATA_CALL DataCallResponse: { cause=0 retry=-1 cid=1 linkStatus=1 protocolType=0 **i** **fname=wwan0 addresses=[10.95.207.21/30] dnses=[/172.31.139.16, /172.30.139.16] gateways=[/10.95.207.22]** pcscf=[] mtu=1358} [SUB0]
03-05 02:53:56.809 W/ClientWakelockAccountant: ( 3936): Looking for Request<27,80> in []
03-05 02:53:56.810 D/DataServiceCallback( 3936): onSetupDataCallComplete
03-05 02:53:56.810 D/DSM-C ( 3936): onSetupDataCallComplete. resultCode = 0, response = DataCallResponse: { cause=0 retry=-1 cid=1 linkStatus=1 protocolType=0 **ifname=wwan0 addresses=[10.95.207.21/30] dnses=[/172.31.139.16, /172.30.139.16] gateways=[/10.95.207.22]** pcscf=[] mtu=1358}
wwan0 is UNKNOWN rather than UP, but it has the address:
smarc_mx8mq:/ # ip a | grep wwan0 -A5
9: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1358 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 36:99:50:80:ec:8c brd ff:ff:ff:ff:ff:ff
inet 10.95.207.21/30 brd 10.95.207.23 scope global wwan0
valid_lft forever preferred_lft forever
inet6 fe80::3499:50ff:fe80:ec8c/64 scope link
valid_lft forever preferred_lft forever
03-05 02:53:56.810 D/RILJ ( 3936): [0081]< RIL_REQUEST_GSM_SET_BROADCAST_CONFIG error 6 [SUB0]
03-05 02:53:56.810 D/RilRequest( 3936): [0081]< RIL_REQUEST_GSM_SET_BROADCAST_CONFIG error: com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED ret=
03-05 02:53:56.810 W/ClientWakelockAccountant: ( 3936): Looking for Request<90,81> in []
03-05 02:53:56.810 D/DC-C-1 ( 3936): DcActivatingState: msg={what=EVENT_SETUP_DATA_CONNECTION_DONE when=0 obj={mTag=2 mApnContext={mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} mProfileId=-1 mRat=14 mOnCompletedMsg={what=0x42000 when=-1m12s233ms obj=Pair{{mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} 1} target=Handler (com.android.internal.telephony.dataconnection.DcTracker) {66237cd} replyTo=null} mRequestType=NORMAL mSubId=3} target=Handler (com.android.internal.util.StateMachine$SmHandler) {16783c9} replyTo=null}
03-05 02:53:56.810 D/DC-C-1 ( 3936): onSetupConnectionCompleted: resultCode=0, response=DataCallResponse: { cause=0 retry=-1 cid=1 linkStatus=1 protocolType=0 ifname=wwan0 addresses=[10.95.207.21/30] dnses=[/172.31.139.16, /172.30.139.16] gateways=[/10.95.207.22] pcscf=[] mtu=1358}
03-05 02:53:56.811 D/DC-C-1 ( 3936): onSetupConnectionCompleted received successful DataCallResponse
03-05 02:53:56.811 D/DC-C-1 ( 3936): addr/pl=/10.95.207.21/30
03-05 02:53:56.811 D/DC-C-1 ( 3936): MTU set by call response to: 1358
03-05 02:53:56.811 D/DC-C-1 ( 3936): updateLinkProperty old LP={LinkAddresses: [ ] DnsAddresses: [ ] Domains: null MTU: 0 Routes: [ ]}
03-05 02:53:56.812 D/DC-C-1 ( 3936): updateLinkProperty new LP={InterfaceName: wwan0 LinkAddresses: [ 10.95.207.21/30 ] DnsAddresses: [ /172.31.139.16,/172.30.139.16 ] Domains: null MTU: 1358 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576 Routes: **[ 0.0.0.0/0 -> 10.95.207.22 wwan0 ]** }
The route above is not present.
smarc_mx8mq:/ # ip route show
10.95.207.20/30 dev wwan0 proto kernel scope link src 10.95.207.21
We can add it:
smarc_mx8mq:/ # ip route add default via 10.95.207.22 dev wwan0
smarc_mx8mq:/ # ip route show
default via 10.95.207.22 dev wwan0
10.95.207.20/30 dev wwan0 proto kernel scope link src 10.95.207.21
but the far side doesn’t ping:
smarc_mx8mq:/ # ping 10.95.207.22
PING 10.95.207.22 (10.95.207.22) 56(84) bytes of data.
From 10.95.207.21: icmp_seq=1 Destination Host Unreachable
From 10.95.207.21: icmp_seq=2 Destination Host Unreachable
From 10.95.207.21: icmp_seq=3 Destination Host Unreachable
^C
--- 10.95.207.22 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3071ms
pipe 4
(Also, 1.1.1.1 and the DNS servers 172.31.139.16 and 172.30.139.16 do not ping.)
Forcing wwan0 UP doesn’t do anything:
smarc_mx8mq:/ # ip link set wwan0 up
smarc_mx8mq:/ # ip a | grep wwan0 -A5
9: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1358 qdisc pfifo_fast state **UNKNOWN** group default qlen 1000
link/ether 36:99:50:80:ec:8c brd ff:ff:ff:ff:ff:ff
inet 10.95.207.21/30 brd 10.95.207.23 scope global wwan0
valid_lft forever preferred_lft forever
inet6 fe80::3499:50ff:fe80:ec8c/64 scope link
valid_lft forever preferred_lft forever
03-05 02:53:56.812 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +COPS: 0,0,"3",7
03-05 02:53:56.813 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +COPS: 0,1,"3",7
03-05 02:53:56.813 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +COPS: 0,2,"23420",7
03-05 02:53:56.813 D/use-Rlog/RLOG-RIL ATC( 3426): AT< OK
03-05 02:53:56.814 D/use-Rlog/RLOG-RIL RILC( 3426): onRequest: QUERY_NETWORK_SELECTION_MODE
03-05 02:53:56.814 D/use-Rlog/RLOG-RIL ATC( 3426): AT> AT+COPS?
03-05 02:53:56.814 D/DC-C-1 ( 3936): DcActivatingState onSetupConnectionCompleted result=SUCCESS SetupResult.mFailCause=0 dc={DC-C-1: State=DcActivatingState mApnSetting=[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1 RefCount=1 mCid=1 mCreateTime=-1 mLastastFailTime=-1 mLastFailCause=0 mTag=2 mLinkProperties={InterfaceName: wwan0 LinkAddresses: [ 10.95.207.21/30 ] DnsAddresses: [ /172.31.139.16,/172.30.139.16 ] Domains: null MTU: 1358 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576 Routes: [ 0.0.0.0/0 -> 10.95.207.22 wwan0 ]} linkCapabilities=[ Transports: CELLULAR Capabilities: MMS&SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED LinkUpBandwidth>=51200Kbps LinkDnBandwidth>=102400Kbps Specifier: <3>] mRestrictedNetworkOverride=false mApnContexts={{mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true}={mTag=2 mApnContext={mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} mProfileId=-1 mRat=14 mOnCompletedMsg={what=0x42000 when=-1m12s237ms obj=Pair{{mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} 1} target=Handler (com.android.internal.telephony.dataconnection.DcTracker) {66237cd} replyTo=null} mRequestType=NORMAL mSubId=3}}}
03-05 02:53:56.814 D/RILJ ( 3936): [0082]< OPERATOR {3, 3, 23420} [SUB0]
03-05 02:53:56.816 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +COPS: 0,2,"23420",7
03-05 02:53:56.816 D/use-Rlog/RLOG-RIL ATC( 3426): AT< OK
03-05 02:53:56.816 D/use-Rlog/RLOG-RIL RILC( 3426): onRequest: DATA_REGISTRATION_STATE
03-05 02:53:56.816 D/use-Rlog/RLOG-RIL ATC( 3426): AT> AT+CGREG?
03-05 02:53:56.816 D/DC-C-1 ( 3936): DcActiveState: enter dc={DC-C-1: State=DcActiveState mApnSetting=[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1 RefCount=1 mCid=1 mCreateTime=-1 mLastastFailTime=-1 mLastFailCause=0 mTag=2 mLinkProperties={InterfaceName: wwan0 LinkAddresses: [ 10.95.207.21/30 ] DnsAddresses: [ /172.31.139.16,/172.30.139.16 ] Domains: null MTU: 1358 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576 Routes: [ 0.0.0.0/0 -> 10.95.207.22 wwan0 ]} linkCapabilities=[ Transports: CELLULAR Capabilities: MMS&SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED LinkUpBandwidth>=51200Kbps LinkDnBandwidth>=102400Kbps Specifier: <3>] mRestrictedNetworkOverride=false mApnContexts={{mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true}={mTag=2 mApnContext={mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} mProfileId=-1 mRat=14 mOnCompletedMsg={what=0x42000 when=-1m12s239ms obj=Pair{{mApnType=default mState=CONNECTING mWaitingApns={[[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1]} mApnSetting={[ApnSettingV7] 3, 304, 23420, three.co.uk, , http://mms.um.three.co.uk:10021/mmsc, mms.three.co.uk, 8799, null, 0, mms | supl | hipri | default, IP, IP, true, 0, false, 0, 0, 0, 0, null, , false, 0, 0, -1, -1} mReason=dataEnabled mDataEnabled=true mDependencyMet=true} 1} target=Handler (com.android.internal.telephony.dataconnection.DcTracker) {66237cd} replyTo=null} mRequestType=NORMAL mSubId=3}}}
03-05 02:53:56.817 D/RILJ ( 3936): [0086]> RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG with 2 configs : [SUB0]
03-05 02:53:56.817 D/RILJ ( 3936): {.serviceCategory = 4096, .language = 1, .selected = true} [SUB0]
03-05 02:53:56.817 D/RILJ ( 3936): {.serviceCategory = 4097, .language = 1, .selected = true} [SUB0]
**03-05 02:53:56.817 D/DCT-C ( 3936): onDataSetupComplete: success apn=three.co.uk**
Finally, it says “success” despite not creating a working wwan0.
Every twenty seconds the following log entries appear:
03-05 06:29:03.621 I/chatty ( 3936): uid=1001(radio) Binder:3936_2 identical 7 lines
03-05 06:29:04.624 D/SubscriptionController( 3936): [getActiveSubscriptionInfo]+ subId=3 subInfo={id=3, iccId=8944200200147035369 simSlotIndex=0 carrierId=1505 displayName=Three Mobile carrierName=3 nameSource=1 iconTint=-16746133 mNumber=null dataRoaming=0 iconBitmap=android.graphics.Bitmap@32cbe88 mcc 234 mnc 20mCountryIso=gb isEmbedded false accessRules null cardString=8944200200147035369 cardId=-1 isOpportunistic false mGroupUUID=null mIsGroupDisabled=false profileClass=-1 ehplmns = null hplmns = null subscriptionType=0 mGroupOwner=null}
03-05 06:29:04.821 D/use-Rlog/RLOG-RIL ATC( 3426): AT> AT+CSQ
03-05 06:29:04.830 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +CSQ: 18,99
03-05 06:29:04.830 D/use-Rlog/RLOG-RIL ATC( 3426): AT< OK
03-05 06:29:04.830 D/use-Rlog/RLOG-RIL ATC( 3426): AT> AT+CGREG?
03-05 06:29:04.832 D/use-Rlog/RLOG-RIL ATC( 3426): AT< +CGREG: 2,1,"093C","01B4800",7
03-05 06:29:04.832 D/use-Rlog/RLOG-RIL ATC( 3426): AT< OK
03-05 06:29:08.648 D/SubscriptionController( 3936): [getActiveSubscriptionInfo]+ subId=3 subInfo={id=3, iccId=8944200200147035369 simSlotIndex=0 carrierId=1505 **displayName=Three Mobile carrierName=3** nameSource=1 iconTint=-16746133 mNumber=null dataRoaming=0 iconBitmap=android.graphics.Bitmap@32cbe88 **mcc 234 mnc 20** mCountryIso=gb isEmbedded false accessRules null cardString=8944200200147035369 cardId=-1 isOpportunistic false mGroupUUID=null mIsGroupDisabled=false profileClass=-1 ehplmns = null hplmns = null subscriptionType=0 mGroupOwner=null}
though sometimes it’s just the AT commands and responses.