Closed edge7 closed 3 years ago
I solved with: ("AT+COPS=1,2,\"22210\"") where 22210 is the concatenation of the operator MCC and MNC to which one wants to connect.
Would you please provide more information on this?
Where/when do you call this? Is there a way to also include information about the band?
E.g. MCC=302, MNC=610, band=5
Would you please share a code snippet?
I use it to get it connected. Full example: ` bool connectToGPRS(){
modem.setNetworkMode(38);
delay(100);
modem.setPreferredMode(2);
SerialAT.println("AT+COPS=1,2,\"22210\""); //Get connection type and band
delay(5500);
if (SerialAT.available()) {
Serial.println("Response");
String r = SerialAT.readString();
Serial.println(r);
} else{
Serial.println("No response");
}
bool toReturn = false; for( char i=0; i < 5; i++){ if (!modem.waitForNetwork()) { SerialMon.println(" failed to Wait For Netowrk");
delay(10000);
continue;
}
SerialMon.println(" success to connect to Netowrk");
if (modem.isNetworkConnected()) { SerialMon.println("Network connected");
} else continue;
bool res=true;
do { res = modem.setNetworkMode(38); Serial.println(res); delay(500); } while (!res); Serial.println("OK LTE"); do { res = modem.setPreferredMode(2); Serial.println(res); delay(500); } while (!res); Serial.println("OK NBIOT"); SerialMon.print(("Connecting to ")); SerialMon.print(apn); if (!modem.gprsConnect(apn, gprsUser, gprsPass)) { SerialMon.println(" fail to connect to APN"); delay(10000); continue; }
SerialMon.println(" success to connect to APN");
if (modem.isGprsConnected()) { SerialMon.println("GPRS connected"); toReturn= true;
break;} else{ Serial.println("Not connected"); } } String ccid = modem.getSimCCID(); Serial.println("CCID: " + ccid);
String imei = modem.getIMEI(); Serial.println("IMEI: " + imei);
String cop = modem.getOperator(); Serial.println("Operator: " + cop);
IPAddress local = modem.localIP(); Serial.println("Local IP: " + String(local));
int csq = modem.getSignalQuality(); Serial.println("Signal quality: " + String(csq));
SerialAT.println("AT+CPSI?"); //Get connection type and band delay(500); if (SerialAT.available()) { String r = SerialAT.readString(); Serial.println(r); }
return toReturn; } `
[ ] I have read the Troubleshooting section of the ReadMe
What type of issues is this?
Question or request for help
What are you working with?
Modem: SIM7000G Main processor board: ESP32 TinyGSM version: 0.11.4
Scenario, steps to reproduce
Hi, am using a sim that has a virtual network, so it relies on some physical operators. Do you know how can I try to force the registration with a particular one? (Vodafone).