The network scan command AT+COPS=? can take a minute or more to complete. The modem will be unresponsive until it gives the “OK” response to show that the command has completed.
You can lock the modem to a single operator using the +COPS command, providing the MCC and MNC for that operator.
That can be either a hard lock or a soft lock, where the soft lock allows the modem to negotiate a different operator if the chosen one isn’t available.
For 4G/LTE, MCC= 123 and MNC = 456:
Hard lock: AT+COPS=1,2,"123456",7
Soft lock: AT+COPS=4,2,"123456",7
If locking to 3G/WCDMA/UMTS rather than 4G/LTE, replace the trailing 7 with 2.
If you want to limit the operators to a set and exclude some which are otherwise available at your location, you should be able to add the unwanted ones to the SIM’s forbidden PLMNs list. Details on request.
@snowgum I am also having issues with ‘AT+COPS=?’ failing after successful registration/connection/activation with a returned ‘CME ERROR: 3’ even though other network cmds like ‘AT+COPS?’, ‘AT+QNWINFO’, ‘AT+CREG?’, ‘AT+CEREG?’, ‘AT+CGREG?’, ‘AT+QENG=“servingcell”’, ‘AT+CGATT?’, etc. all return responses that show a successful network connection and activated PDP session. I’ve tried to use qmicli -d <path to device> --nas-network-scan and that eventually fails with an abort message.