botletics / SIM7000-LTE-Shield

Botletics SIM7000 LTE CAT-M1/NB-IoT Shield for Arduino
https://www.botletics.com/products/sim7000-shield
GNU General Public License v3.0
481 stars 216 forks source link

CAOPEN Fails Respond Periodically #263

Open cp26 opened 3 years ago

cp26 commented 3 years ago

I have a timed function calling to connect every 10 minutes. Some times the connection happens just fine. Other times the modem seems to hang on CAOPEN. I have set the timeout to several minutes but no failure message ever comes through. When it fails I send the shutdown command to the modem and then it seems to receive a response to CAOPEN.

Any ideas on why/if the modem is not responding?

` timed function call to connect AT+IPR=9600

SMS Ready [11030] ### Unexpected module reset! [11030] ### TinyGSM Version: 0.11.4 [11048] ### TinyGSM Compiled Module: TinyGsmClientSIM7000SSL AT

DST: 1 [11132] ### Daylight savings time state updated.

*PSUTTZ: 21/09/14,02:43:56","-20",1 [11220] ### Network time and time zone updated. AT OK ATE0 ATE0 OK AT+CMEE=2

OK AT+GMM

SIMCOM_SIM7000A

OK [11389] ### Modem: SIMCOM SIM7000A AT+CLTS=1

RDY

OK AT+CBATCHK=1

OK AT+CPIN?

+CME ERROR: SIM busy AT+CPIN?

+CFUN: 1

+CPIN: READY

SMS Ready [12540] ### Unexpected module reset! [12540] ### TinyGSM Version: 0.11.4 [12567] ### TinyGSM Compiled Module: TinyGsmClientSIM7000SSL AT

+CPIN: READY

OK ATE0

OK AT+CMEE=2

�4 OK AT+GMM

SIMCOM_SIM7000A

OK [12747] ### Modem: SIMCOM SIM7000A AT+CLTS=1

OK AT+CBATCHK=1

OK AT+CPIN?

+CPIN: READY

OK Initializing modem... [13533] ### TinyGSM Version: 0.11.4 [13533] ### TinyGSM Compiled Module: TinyGsmClientSIM7000SSL AT

OK ATE0

OK AT+CMEE=2

OK AT+GMM

SIMCOM_SIM7000A

OK [13708] ### Modem: SIMCOM SIM7000A AT+CLTS=1

OK AT+CBATCHK=1

OK AT+CPIN?

+CPIN: READY

OK Waiting for network...AT+CEREG?

+CEREG: 0,2

OK AT+CGREG?

+CGREG: 0,2

OK AT+CEREG?

DST: 1 [14172] ### Daylight savings time state updated.

*PSUTTZ: 21/09/14,02:44:09","-20",1 [14204] ### Network time and time zone updated.

+CTZV: -20 [14270] ### Network time zone updated.

+CEREG: 0,1 success AT+CEREG?

+CEREG: 0,1

OK Network connected Connecting to myAPN AT+CNACT=0

+CME ERROR: operation not allowed AT+CGDCONT=1,"IP","lmyAPN"

OK AT+CGATT=1

OK AT+CNCFG=1,"myAPN"

ERROR AT+CNACT=1,"myAPN"

OK

+APP PDP: ACTIVE Connected to GPRS AT+CGATT?

+CGATT: 1

OK AT+CNACT?

+CNACT: 1,"10.100.0.9"

OK GPRS connected myAPN AT+CASTATE?

+CASTATE: 0,0 +CASTATE: 1,0

OK AT+CACLOSE=0

+CME ERROR: operation not allowed AT+CACID=0

OK AT+CSSLCFG="convert",2,"hivemq-server-cert.pem"

OK AT+CSSLCFG="convert",1,"client.pem","keyuncr.key","password"

OK AT+CASSLCFG=0,"cacert","hivemq-server-cert.pem"

OK AT+CASSLCFG=0,"clientcert","client.pem"

OK AT+CSSLCFG="sslversion",0,3

OK AT+CASSLCFG=0,ssl,1

OK AT+CSSLCFG="ctxindex",0

+CSSLCFG: 0,3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0,1,""

OK AT+CASSLCFG=0,protocol,0

OK AT+CSSLCFG="sni",0,"mybroker.com"

OK AT+CAOPEN=0,"mybroker.com",8884 MQTT failed, try again AT+IPR=9600 AT+CPOWD=1

FAILED try again AT+IPR=9600

+CAOPEN: 0,0 Finally getting a response from CAOPEN?

`

jaka87 commented 1 year ago

i have similar issue with SIM7070 where i can connect to GPRS and also see the connection in my network provider control panel but cant open connection to server

i get +CAOPEN: 0,1 error.

I went with the same temporary fix like you to shut down the module and restart it. For now it seems like to work fine this way but i'm still searching for better alternative