AT+CLCK=SC,2 command is supposed to let us know if the sim card is protected by a pin code. (at least this is what I understood…)
After a cold start: +CLCK: 1, meaning the card IS protected, as expected, because it is actually protected.
Then, command AT+CPIN+XXXX, (XXXX is the pin code) makes the sim card ready: AT+CPIN? command returns+CPIN: READY.
And of course, AT+CLCK=SC,2 still answers +CLCK:1, which is true.
After a hot start is performed (eg using at#reboot), the AT+CLCK=SC,2 command returns +CLCK:0.
Thank you in advance for your help,
Why not simply rely on using AT+CPIN?
Please tell firmware version.
Thank you for your reply. Firmware version is 10.00.004, module is GE865 Quad.
Our sim cards provider provides us with unprotected cards.
What I would like to achieve is to have a simple test at every startup:
if +CCLK=SC,2 returns CLCK: 0:
activate sim protection with AT+CLCK=SC,1,XXXX
if +CCLK=SC,2 returns CLCK: 1:
enter pin code using AT+CPIN=XXXX
I cannot use +CPIN instead of +CLCK because after a hot reboot, CPIN will answer “READY”, as if there was no pin protection, which would be false, and thus trying to setup the pin protection using +CLCK=SC,1,XXXX would return an error.
Of course I could ignore this error, and analyze it as the result of a hot reboot situation, but I wondered it there could be a better solution for this.
I would suggest to not use the AT#REBOOT in this case since it reboots just part of the software but for example not the SIM.
An HW reset with the RESET line or an AT#SHDN and ON/OFF to power cycle the module, it would be better.
Also the sequence AT#SIMDET=0, 5s pause, AT#SIMDET=1/2 should do the job since it deactivates and activates again the SIM,
#SIMDET will be ok!
Thank you very much Andrea and Cosmin.
I’m back with a new issue related to pin code protection.
As already said, the idea is to automatically protect sim cards at first module boot. (theses cards are delivered unprotected, with pin code set to 0000).
So the idea is:
1- check the sim card protection:
then, if the card is not protected (if answer is +CLCK=0):
2- Activate SC protection with current pin code:
3- Change pin code to the secret one:
Unfortunately, this last command makes the GE865 reboot.
Any idea of where am I wrong?
Have you tried with a more recent firmware like 10.0.005?
How can you say that GE865 reboots?
1- No I did not try a more recent firmware. Should iI?
2- I can say the module reboots because I have logs on my screen. I even tried to disable watch dog, with no result.
Is always better to use the latest firmware if possible, 10.00.005 being the latest production one.
Is still not clear how you conclude the reset occurs. Do you monitor a certain line, a certain settings?
I’m not sure to understand your question about how I know it reboots:
Say I run a python script, at the begin of this script there is a instruction to send a string like ‘Starting…’ to the serial port. This serial port is connected to a pc running a terminal program, so I can see this string, among others, on my screen.
I guess I’m not the only one to do this way???
Ah Python, you should mention this in the first place. Can you show the relevant part of the code maybe?
if "AT+CLCK=SC,2" replies "+CLCK=0":
#until here everything is ok…
#but the script never arrives here
(f3.mdm_send(a,b,c,d) sends "a" to MDM and waits "b" to be answered. Result is waited "d" times, everytime "c" 1/10s.)
Just verified again with the command sequence:
No reboot occurs, firmware version 10.00. 005.
Maybe is something in your code, BTW AT commands must be terminated only by r not rn.
I finaly rewrited this part and could make it work (with 10.00.004 firmware) , but I still did not understand the previous code behaviour…I’ve been working for some time with python on GE865 and never faced that before!
Thank you for r instead of rn.
(Beside this, I found code pin management a little bit touchy! )
Have a nice day, Cosmin, thank you again.
Hit enter to search or ESC to close
Knowledge Base & Download Zone