vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.91k stars 709 forks source link

SIM7000G : unexpected "### Unexpected module reset!" #608

Closed chris4git closed 2 years ago

chris4git commented 2 years ago

Hi, after calling modem.waitForNetwork(180000L) the library displays

[32743] ### Unexpected module reset!
[32743] ### TinyGSM Version: 0.11.4
[32743] ### TinyGSM Compiled Module:  TinyGsmClientSIM7000

and then continues.

Trying to understand, I look at the source file TinyGsmClientSIM7000.h (line 487+) and can't see why init() is called after receiving "SMS Ready" :

   } else if (data.endsWith(GF(GSM_NL "SMS Ready" GSM_NL))) {
          data = "";
          DBG("### Unexpected module reset!");
          init();
        }

Shouldn't init() be outside of these parenthesizes ?

An explanation ?

SRGDamia1 commented 2 years ago

Are you still having this issue?

The SIM7000 spits out that SMS Ready message when it boots up. If you're seeing it in your debug logs, it's probably because your modem is resetting itself somewhere in your waiting period. If the library sees the reboot, it re-runs the init. If I remember correctly from my testing this was mostly needed because when the modem reset unexpectedly it often would boot back up with command echo turned on which would screw up later communication in the library.

chris4git commented 2 years ago

hi,

not really an issue as waitForNetwork returns ok and the execution continues...

SRGDamia1 commented 2 years ago

Ok, if it's not an issue, please close this.

bykof commented 1 year ago

Hi folks, I would like to discuss this topic again. I read the manual for SIM7080/7090 series and the only information about "SMS ready" was the part about Phone functionality. If a module reconnects or successfully connects to a provider it sends:

AT+CFUN=?
+CFUN: (0-1,4-7),(0-1)

OK
AT+CFUN?

+CFUN: 1
OK

AT+CFUN=1,1
OK 

RDY
+CFUN: 1

+CPIN: READY 

SMS Ready

You see, that after a successful registration it spams SMS ready, therefore this is not a signal to initialize the device again with: https://github.com/vshymanskyy/TinyGSM/blob/47793e0ad98c2c0e959715ead9db5c8f07351da5/src/TinyGsmClientSIM7080.h#L683

Can anyone explain me, which documentation explains that "SMS ready" is the signal to reinit the module?