Open antt0481 opened 4 years ago
String Arsp, Grsp; //ATI, AT+CSQ, AT+CIMI
HardwareSerial gsm(1); TinyGsm modem(gsm); TinyGsmClient client(modem); PubSubClient mqtt(client);
void setup() { Serial.begin(112500); delay(500); gsm.begin(112500, SERIAL_8N1, 16, 17); delay(1000);
Serial.println("Modem: " + modem.getModemInfo()); Serial.println("SimCCID: " + modem.getSimCCID()); Serial.println("IMEI: " + modem.getIMEI()); Serial.println("IMSI: " + modem.getIMSI());
if (!modem.waitForNetwork()) { Serial.println(F("fail waitForNetwork")); //while (true) ; }
if ( GSM_PIN && modem.getSimStatus() != 3 ) { modem.simUnlock(GSM_PIN); }
while (!modem.gprsConnect("m3-world", "mms", "mms")) { Serial.println("fail gprsConnect"); delay(2000); }
gsm.println("AT+CGDCONT=?"); delay(100);
}
My result: fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect
Working on Sim800L - 2G- but when change to Sim5300E - 3G - but fail connect. Do someone know why and how to fix?
Can you post the log dumping the AT commands?
#ifdef DUMP_AT_COMMANDS #include <StreamDebugger.h> StreamDebugger debugger(SerialAT, SerialMon); TinyGsm modem(debugger); #else TinyGsm modem(SerialAT); #endif
define TINY_GSM_MODEM_SIM5300
define GSM_PIN ""
include
include
String Arsp, Grsp; //ATI, AT+CSQ, AT+CIMI
HardwareSerial gsm(1); TinyGsm modem(gsm); TinyGsmClient client(modem); PubSubClient mqtt(client);
void setup() { Serial.begin(112500); delay(500); gsm.begin(112500, SERIAL_8N1, 16, 17); delay(1000);
Serial.println("Modem: " + modem.getModemInfo()); Serial.println("SimCCID: " + modem.getSimCCID()); Serial.println("IMEI: " + modem.getIMEI()); Serial.println("IMSI: " + modem.getIMSI());
if (!modem.waitForNetwork()) { Serial.println(F("fail waitForNetwork")); //while (true) ; }
if ( GSM_PIN && modem.getSimStatus() != 3 ) { modem.simUnlock(GSM_PIN); }
while (!modem.gprsConnect("m3-world", "mms", "mms")) { Serial.println("fail gprsConnect"); delay(2000); }
gsm.println("AT+CGDCONT=?"); delay(100);
}
My result: fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect fail gprsConnect
Working on Sim800L - 2G- but when change to Sim5300E - 3G - but fail connect. Do someone know why and how to fix?