DWR-921 - How change GSM operator

Hi!
I have problem after install OpenWrt on D-Link DWR-921

My SIM Card - Mobile Viking - Poland operator using Play signal.
In my home this network is weak.

When i put SIM card in my phone and manual select network to Orange everyfing works fine.

How to force it in the router?

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-system-info
{
        "gsm": {
                "service_status": "none",
                "true_service_status": "none",
                "preferred_data_path": false
        },
        "wcdma": {
                "service_status": "none",
                "true_service_status": "none",
                "preferred_data_path": false
        },
        "lte": {
                "service_status": "available",
                "true_service_status": "available",
                "preferred_data_path": false,
                "domain": "cs-ps",
                "service": "cs-ps",
                "roaming_status": "off",
                "forbidden": false,
                "mcc": "260",
                "mnc": "06",
                "tracking_area_code": 31,
                "enodeb_id": 33052,
                "cell_id": 121,
                "voice_support": true,
                "ims_voice_support": true,
                "cell_access_status": "all calls",
                "registration_restriction": 0,
                "registration_domain": 0





root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --network-scan
{
"network_info": [
{
"mcc": 260,
"mnc": 6,
"description": "",
"status": [
"current_serving",
"home",
"not_forbidden",
"preferred"
]
},
{
"mcc": 260,
"mnc": 6,
"description": "Play",
"status": [
"available",
"home",
"not_forbidden",
"preferred"
]
},
{
"mcc": 260,
"mnc": 1,
"description": "PLUS",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 1,
"description": "PLUS",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 2,
"description": "TM PL",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 1,
"description": "PLUS",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 2,
"description": "TM PL",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 3,
"description": "Orange",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 3,
"description": "Orange",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
},
{
"mcc": 260,
"mnc": 3,
"description": "Orange",
"status": [
"available",
"roaming",
"not_forbidden",
"not_preferred"
]
}
],
"radio_access_technology": [
{
"mcc": 260,
"mnc": 6,
"radio": "lte"
},
{
"mcc": 260,
"mnc": 6,
"radio": "gsm"
},
{
"mcc": 260,
"mnc": 1,
"radio": "lte"
},
{
"mcc": 260,
"mnc": 1,
"radio": "umts"
},
{
"mcc": 260,
"mnc": 2,
"radio": "lte"
},
{
"mcc": 260,
"mnc": 1,
"radio": "gsm"
},
{
"mcc": 260,
"mnc": 2,
"radio": "gsm"
},
{
"mcc": 260,
"mnc": 3,
"radio": "lte"
},
{
"mcc": 260,
"mnc": 3,
"radio": "umts"
},
{
"mcc": 260,
"mnc": 3,
"radio": "gsm"
}
]

Please use search function.

i try:
uqmi -d /dev/cdc-wdm0 --set-plmn --mnc 3 --mcc 260 - for Orange Poland
uci commit network
reboot

Without changes...
Maybe it's about roaming option?
uqmi -d /dev/cdc-wdm0 --get-system-info ----> "roaming_status": "off"

I try:
uqmi -d /dev/cdc-wdm0 --set-network-roaming any

but it still does not work

Reboot will reset your changes. This change has nothing to do with uci.
Try setting mcc & mnc and then restart your connection.
Alternatively the change could be implemented within the connection script.
Edit: that is already implemented )

i try:
uqmi -d /dev/cdc-wdm0 --set-plmn --mcc 206 --mnc 3

ifdown wan
ifdown wwan

ifup wan
ifup wwan

Not working

Once again, use search!
You can specify MCC & MNC in the standard configuration file as shown in the wiki

Ok... I connect to the router via scp - WinSCP --> /etc/config/network

I add line option plmn '2603'


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd16:23b9:9e17::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config device
	option name 'eth0.1'
	option macaddr '80:26:89:30:70:74'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device
	option name 'eth0.2'
	option macaddr '80:26:89:30:70:73'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option device 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 6t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'

config interface 'wwan'
	option proto 'qmi'
	option device '/dev/cdc-wdm0'
	option plmn '2603'
	option apn 'internet'
	option autoconnect '1'
	option delay '5'

After reebot i start command: uqmi -d /dev/cdc-wdm0 --get-system-info
The value is changed!!

uqmi -d /dev/cdc-wdm0 --get-system-info
{
        "gsm": {
                "service_status": "none",
                "true_service_status": "none",
                "preferred_data_path": false
        },
        "wcdma": {
                "service_status": "none",
                "true_service_status": "none",
                "preferred_data_path": false
        },
        "lte": {
                "service_status": "available",
                "true_service_status": "available",
                "preferred_data_path": false,
                "domain": "cs-ps",
                "service": "cs-ps",
                "roaming_status": "off",
                "forbidden": false,
                "mcc": "260",
                "mnc": "03",
                "tracking_area_code": 57042,
                "enodeb_id": 170144,
                "cell_id": 25,
                "voice_support": true,
                "ims_voice_support": true,
                "cell_access_status": "all calls",
                "registration_restriction": 0,
                "registration_domain": 0

But i not have internet connection - after a few seconds value back to 06 for play but still no connection. I must restart wwan - QMI Cellular in luci menu - internet works but still on Play signal.

I try run: opkg update && opkg install luci-proto-qmi

Still nothing

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-plmn
{
"mode": "automatic"
}

how change this to manual?

by rereading the old replies ?

This is not inline with the documentation btw.

First three digits are the mcc (mobile country code) and the last three digits are the mnc (mobile network code), for example if plmn=338020, then the mcc is 338 and the mnc is 020

Hi
You can try my customized uqmi. I have implemented support for setting the PLMN. https://github.com/mrhaav/openwrt
What version of OpenWrt are you using?

Then run:

uci network.wwan.plmn=26003
uci commit network

Oranges PLMN = 26003, NMC with two digits.

Hi

  1. I download your customized uqmi. - ```
    wget https://github.com/mrhaav/openwrt/raw/master/22.03.2/uqmi_2022-11-29-0.10_mipsel_24kc.ipk
2. factory reset router --> copy your package via WinScp to the router.
3. Install --> ```
opkg install uqmi_2022-11-29-0.10_mipsel_24kc.ipk
```      ---> OK, no error.
4. [[OpenWrt Wiki] D-Link DWR-921](https://openwrt.org/toh/d-link/dwr-921) - 4G -alternative configuration.
5. uci set network.wwan=interface
uci set network.wwan.proto='qmi'
uci set network.wwan.device='/dev/cdc-wdm0'
uci set network.wwan.apn='internet'
uci set network.wwan.plmn=26003
uci commit network
uci set network.wwan.autoconnect='1'
uci set network.wwan.delay='5'
uci commit network
uci set firewall.@zone[1].network='wan wan6 wwan'
uci commit firewall
ifup wwan
reboot
6. www --> 192.168.1.1 --> interface --> info-must install package luci-proto-qmi
7. I run tethering from my phone --> connect to internet and run --> opkg update && opkg install luci-proto-qmi
reboot
8. www --> 192.168.1.1 --> interface --> QMI Cellular - error ---> EDIT --> PDP TYPE --> IPV4/IPV6  --> change to --> IPV4 --> restart --> OK internet works.
9. /etc/config/network
config interface 'wwan'
	option proto 'qmi'
	option device '/dev/cdc-wdm0'
	option apn 'internet'
	option plmn '26003'
	option autoconnect '1'
	option delay '5'
	option auth 'none'
	option default_profile '1'
	option pdptype 'ipv4'

config interface 'wwan2'
	option proto 'dhcp'

10. System LOG:
Tue May 30 12:26:08 2023 daemon.notice netifd: wwan (3208): PINcode disabled
Tue May 30 12:26:08 2023 daemon.notice netifd: wwan (3208): Data format set to raw-ip
Tue May 30 12:26:08 2023 daemon.notice netifd: wwan (3208): Default profile: 1
Tue May 30 12:26:09 2023 daemon.notice netifd: wwan (3208): PLMN set to mcc: 260 mnc: 03
Tue May 30 12:26:09 2023 daemon.notice netifd: wwan (3208):  registered on 26006
Tue May 30 12:26:11 2023 daemon.notice netifd: wwan (3208):  not_registered on 26003
Tue May 30 12:26:13 2023 daemon.notice netifd: wwan (3208):  registered on 26003
Tue May 30 12:26:13 2023 daemon.notice netifd: wwan (3208): Registered to MVikings(O) on LTE
Tue May 30 12:26:15 2023 daemon.notice netifd: wwan (3208): Connected with IPv4
Tue May 30 12:26:15 2023 daemon.notice netifd: wwan (3208): Setting up wwan0

Not working :frowning:

Didn´t you get any IPaddress?
Your System LOG looks OK.

When router is boot up - first 5/10 seconds command:
uqmi -d /dev/cdc-wdm0 --get-system-info
show:
"lte": {
"service_status": "available",
"true_service_status": "available",
"preferred_data_path": false,
"domain": "cs-ps",
"service": "cs-ps",
"roaming_status": "off",
"forbidden": false,
"mcc": "260",
"mnc": "03",
"tracking_area_code": 57042,
"enodeb_id": 170144,
"cell_id": 25,
"voice_support": true,
"ims_voice_support": true,
"cell_access_status": "all calls",
"registration_restriction": 0,
"registration_domain": 0

But i don't get ip adress - internet not working. After 10 seconds command
uqmi -d /dev/cdc-wdm0 --get-system-info
show:
"lte": {
"service_status": "available",
"true_service_status": "available",
"preferred_data_path": false,
"domain": "cs-ps",
"service": "cs-ps",
"roaming_status": "off",
"forbidden": false,
"mcc": "260",
"mnc": "06",
"tracking_area_code": 31,
"enodeb_id": 33052,
"cell_id": 121,
"voice_support": true,
"ims_voice_support": true,
"cell_access_status": "all calls",
"registration_restriction": 0,
"registration_domain": 0

MNC back from 03 to 06

command uqmi -d /dev/cdc-wdm0 --get-plmn
{
"mode": "manual",
"mcc": 260,
"mnc": 3,
"mnc_length": 2

Strange
Looks like your service provider is "pushing" you back to 26006.
Can you run AT-commands to the modem?
Can you print this cat /sys/kernel/debug/usb/devices

root@OpenWrt:~# cat /sys/kernel/debug/usb/devices

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev= 5.10
S: Manufacturer=Linux 5.10.176 ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=101c0000.ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2020 ProdID=2033 Rev= 2.28
S: Manufacturer=Mobile Connect
S: Product=Mobile Connect
S: SerialNumber=c3141f581ffb
C:* #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 1
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev= 5.10
S: Manufacturer=Linux 5.10.176 ohci_hcd
S: Product=Generic Platform OHCI controller
S: SerialNumber=101c1000.ohci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

You need to install picocom.
Then start a session to your modem picocom /dev/ttyUSB1
Type at and hit enter, and you will get OK if you have the correct tty device.

Print current operator:
at+cops?

Activate event reporting:
at+cereg=2
at+cgerep=2,1

Lock to Orange:
at+cops=1,2,"26003" and wait.

Please, paste all results.

OpenWrt 22.03.5, r20134-5f15225c1e

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.

root@OpenWrt:~# at+cereg=2
-ash: at+cereg=2: not found
root@OpenWrt:~# picocom /dev/ttyUSB1
picocom v3.1

port is : /dev/ttyUSB1
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no

Type [C-a] [C-h] to see available commands
Terminal ready
at+cereg=2
OK
at+cgerep=2,1
OK

+CGEV: ME DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH

+CGEV: NW DETACH
at+cops=1,2,"26003"
+CME ERROR: no network service

+CGEV: NW DETACH

+CEREG: 3

+CEREG: 1,"DF23","E","4234B0A",7
at+cops=1,2,"26003"
OK
at+cops=1,2,"26003"
OK

+CEREG: 1,"DF23","E","311160",7

+CEREG: 3

+CEREG: 1

+CEREG: 1,"14D","60","311160",7
at+cops=1,2,"26003"
+CME ERROR: no network service

+CGEV: NW DETACH

+CEREG: 3

+CEREG: 1,"DF23","6","4234B0A",7

+CEREG: 1,"DF23","6","4234B1E",7

It works!! Thank you all very much for your commitment, time and irreplaceable help!