Regain control after +CME ERROR: 13


#1

Hi,

A strange thing happened here: I disconnected the SIM card for about a second and reconnected it. That gave me the first +CME ERROR: 13 below. (this indication came without previously excuted an AT command besides the AT+CPIN…)

After the error I got the indication that I lost the network, and that I guess is OK. But after a while it registered again on the home network - but commands using SIM related functions (e.g. at+cpin?, at+cimi, atd) still don’t work!! They will return the same error from now on…

How can I make all commands work again when I am in that state. Is AT+CFUN=1 the only way out? (This is not really my first choice…)

The Wavecom core software version is:
640d09gg.Q2406B 1273604 091103 18:26

at+cpin=1111

OK

+CREG: 2

+WIND: 7

+CREG: 1

+WIND: 4

+WIND: 10,"EN",0

+CME ERROR: 13

+WIND: 8

+CREG: 0
at+cpin?

+CME ERROR: 13
at+creg?

+CREG: 1,0

OK

+WIND: 7

+CREG: 1
at+creg?

+CREG: 1,1

OK
at+cpin?

+CME ERROR: 13
atd05032891372;

+CME ERROR: 13
ath

OK
at+csq

+CSQ: 15,0

OK
at+cimi

+CME ERROR: 13
at+cpof
at+cpof

+CME ERROR: 515

+CME ERROR: 13

+WIND: 8

+CREG: 0
at

OK
at+cpof

OK

Best Regards,
Jan


#2

Hi Jan,
The error “+CME ERROR: 13” indicates a SIM failure. However, I don’t think this should be the desired behavior. In case, you remove the SIM, the module should respond with a “+WIND: 0” indication (it should not lead to SIM failure).
I feel that there is some problem in the 640d version of core AT software which you are using. It might occur that when the SIM is removed, the SIM remove message is not sent immediately to the SIM read process (which initialise the SIM card by loading phonebook etc). Hence, the SIM read process might be trying to read from the SIM (which is actually not present as you have already removed the SIM) and hence gives “+CME ERROR: 13” indication as it could not get a timely response.
The same thing might be applied to SIM write process too.

However, I am not sure if this is the exact scenario which is happening in the module.

“How can I make all commands work again when I am in that state?”

I don’t think you will be able to recover the SIM related functionalities after you receive a +CME ERROR: 13 error. The only way is to restart the module (using AT+CFUN=1 command) as it will again reload all the SIM related stuff.

Best Regards,
Open AT Fan.


#3

Hi OpenAT Fan,

thank you for your answer! I think your suspicion is right and the explanation makes perfect sense. I would prefer a +WIND: 0 indication, but maybe the SIM was out for a too short period of time… Probably not such a good idea anyway to remove the SIM while the device is powered and operating, I guess there is a reason why you have to take out the battery in so many mobile phones before you can remove the card…

Resetting the module of course is quite involved, saving the application’s state and bring it back to that after reset…

Thanks again,
Jan


#4

Hello guys,

Jan, first out of curiosity:
Why do you remove the SIM for 1 second? :confused:
Shouldn’t it be fixed in operational place from start?

No, in general its no good idea to do this because the SIM could for example be interrrupted in the middle of a write process and the result could be corrupted data.

If you are using a SIM card holder with switch ON/OFF circuitry (all 8 connectors) the power the SIM will be controlled and the SIM card will always boot up properly when inserted. A removal of SIM could of course still cause corrupted SIM…

But as you say, if the battery has to be removed first, the problem is never really a problem.

/Snoooze


#5

Yes, it should! I was in doubt if the contact to the SIM card is reliable in a device so I tried to simulate a broken connetction - not very accurate of course, but it replicated the behaviour we have seen before…

Oh, we would never get a +WIND: 0 when the SIM is removed… Because SIM Present is not connetced. Bummer! I completely forgot that minor detail. :blush:

Thanks & Best Regards,
Jan