Qmi cellular trying to connect to incorrect network?

I have set up a qmi celular card in my router I can run minicom and it has interfaces in dev but i cant get it to connect to the internet.

I suspect it is trying to attatch to the incorect network but I dont know how to select the correct network.
I wish to connect to the spark network but it seems to indicate vodafone is "Currently_Serving"

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
        "registration": "searching",
        "plmn_mcc": 530,
        "plmn_mnc": 1,
        "plmn_description": "",
        "roaming": true 

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
        "type": "lte",
        "rssi": -75,
        "rsrq": -10,
        "rsrp": -107,
        "snr": 46
}
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --network-scan
{
        "network_info": [
                {
                        "mcc": 530,
                        "mnc": 1,
                        "description": "voda NZ",
                        "status": [
                                "available",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                },
                {
                        "mcc": 530,
                        "mnc": 5,
                        "description": "Spark NZ",
                        "status": [
                                "available",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                },
                {
                        "mcc": 530,
                        "mnc": 24,
                        "description": "2degrees",
                        "status": [
                                "available",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                },
                {
                        "mcc": 530,
                        "mnc": 1,
                        "description": "voda NZ",
                        "status": [
                                "current_serving",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                },
                {
                        "mcc": 530,
                        "mnc": 24,
                        "description": "2degrees",
                        "status": [
                                "available",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                },
                {
                        "mcc": 530,
                        "mnc": 5,
                        "description": "Spark NZ",
                        "status": [
                                "available",
                                "roaming",
                                "not_forbidden",
                                "not_preferred"
                        ]
                }
        ],
        "radio_access_technology": [
                {
                        "mcc": 530,
                        "mnc": 1,
                        "radio": "umts"
                },
                {
                        "mcc": 530,
                        "mnc": 5,
                        "radio": "lte"
                },
                {
                        "mcc": 530,
                        "mnc": 24,
                        "radio": "lte"
                },
                {
                        "mcc": 530,
                        "mnc": 1,
                        "radio": "lte"
                },
                {
                        "mcc": 530,
                        "mnc": 24,
                        "radio": "umts"
                },
                {
                        "mcc": 530,
                        "mnc": 5,
                        "radio": "umts"
                }
        ]
}

Please refer to plmn option description here: https://openwrt.org/docs/guide-user/network/wan/wwan/ltedongle#qmi_protocol_configuration

1 Like

Ok so it looks like this option is not available from luci and I have to edit a config file ?

The guide does not mention the standard or formatting for the network config file

I'm guessing here but if i add in the below

option plmn '530005'

so I will end up with something like this:

config interface 'skinny'
	option proto 'qmi'
	option device '/dev/cdc-wdm0'
	option delegate '0'
	option apn 'skinnybroadband'
	option auth 'none'
	option pdptype 'ipv4'
	option delay '20'
	option auto '0'
	option plmn '530005'

so i'm guessing there is no auto select network feature like any of the shelf 4g modem?

option plmn '530005' looks correct
'ipv4' is not a valid value for option pdptype
There is no option auto '0' according to the docs.

You can also play with --set-plmn and --get-plmn options of uqmi, please refer to the link I provided.

I have not touched any of the settings they were generated by the luci interface when I set up the connection.
I'm guessing the UCI system parses the options to UQMI using an Init script but iI could not find this script in init.d.

If it is the case the wiki might need to be updated with the actual UCI config parameters and syntax rather than the UQMI command line paramaters or I need to issue a bug report ?

It does not list any thing here about a QMI init script so I'm guessing this is a bug ?
[OpenWrt Wiki] The UCI system

I have created a bug here:

luci-proto-qmi parsing comands to UCI bugs/ missing documentation? · Issue #5283 · openwrt/luci (github.com)

Ticking the option Bring up on boot sets the option auto=0