> 5.1 | AT+CPIN PIN Authentication

> The AT+CPIN write command can be used to enter one of the passwords listed below. The read command can be used to check whether or not the ME is waiting for a password, or which type of password is required.
> This may be for example the SIM PIN1 to register to the GSM network, or the SIM PUK1 to replace a disabled SIM PIN1 with a new one, or the PH-SIM PIN if the client has taken precautions for preventing damage in the event of loss or theft etc. If requested by the ME AT+CPIN may also be used for the SIM PIN2 or SIM PUK2.
> If no PIN1 request is pending (for example if PIN1 authentication has been done and the same PIN1 is entered again) TC65 responds "+CME ERROR: operation not allowed"; no further action is required.
> Each time a password is entered with AT+CPIN the module starts reading data from the SIM. The duration of reading varies with the SIM card. This may cause a delay of several seconds before all commands which need access to SIM data are effective. See Section 23.1, Restricted access to SIM data after SIM PIN authentication for further detail.
> Syntax

> Test Command AT+CPIN=?
> Response(s)
> OK

> Read Command AT+CPIN?
> Response(s)
> +CPIN: <code>
> OK
> ERROR
> +CME ERROR: <err>

> Write Command AT+CPIN=<pin>[, <new pin>]
> Response(s)
> OK
> ERROR
> +CME ERROR: <err>

> Reference(s) |  | PIN |  | ASC0 | ASC1 | USB | MUX1 | MUX2 | MUX3 |  |  | Charge | Q | Last
> GSM 07.07 |  | - |  | + | + | + | + | + | + |  |  | - | + | -

> Parameter Description

> <pin>(str)

> Password (string type), usually SIM PIN1.
> If the requested password was a PUK, such as SIM PUK1 or PH-FSIM PUK or another password, then <pin> must be followed by <new pin>.

> <new pin>(text)

> If the requested code was a PUK: specify a new password or restore the former disabled password. See Section 5.1.1, What to do if PIN or password authentication fails? for more information about when you may need to enter the PUK.

> <code>(text)

> SIM PIN authentication
> READY
> PIN has already been entered. No further entry needed.
> SIM PIN
> ME is waiting for SIM PIN1.
> SIM PUK
> ME is waiting for SIM PUK1 if PIN1 was disabled after three failed attempts to enter PIN1.
> SIM PIN2
> ME is waiting for PIN2. This is only applicable when an attempt to access a PIN2 related feature was acknowledged with +CME ERROR: 17 ("SIM PIN2 required"), for example when the client attempts to edit the FD phonebook). In this case the read command AT+CPIN? also prompts for SIM PIN2. Normally, the AT+CPIN2 command is intended for SIM PIN2.
> SIM PUK2
> ME is waiting for PUK2 to unblock a disabled PIN2. As above, this is only necessary when the preceding command was acknowledged with +CME ERROR: 18 ("SIM PUK2 required") and only if the read command AT+CPIN? also prompts for SIM PUK2. Normally, the AT+CPIN2 command is intended for SIM PUK2.
> Phone security locks set by client or factory
> PH-SIM PIN
> ME is waiting for phone-to-SIM card password if "PS" lock is active and the client inserts other SIM card than the one used for the lock. ("PS" lock is also referred to as phone or antitheft lock).
> PH-SIM PUK
> ME is waiting for Master Phone Code, if the above "PS" lock password was incorrectly entered three times.
> PH-FSIM PIN
> ME is waiting for phone-to-very-first-SIM card. Necessary when "PF" lock was set. When powered up the first time, ME locks itself to the first SIM card put into the card holder. As a result, operation of the mobile is restricted to this one SIM card (unless the PH-FSIM PUK is used as described below).
> PH-FSIM PUK
> ME is waiting for phone-to-very-first-SIM card unblocking password to be given. Necessary when "PF" lock is active and other than first SIM card is inserted.
> PH-NET PUK
> ME is waiting for network personalisation unblocking password
> PH-NS PIN
> ME is waiting for network subset personalisation password
> PH-NS PUK
> ME is waiting for network subset unblocking password
> PH-SP PIN
> ME is waiting for service provider personalisation password
> PH-SP PUK
> ME is waiting for service provider personalisation unblocking password
> PH-C PIN
> ME is waiting for corporate personalisation password
> PH-C PUK
> ME is waiting for corprorate personalisation un-blocking password
> Notes

> • | Successful PIN authentication only confirms that the entered PIN was recognized and correct. The output of the result code OK does not necessarily imply that the mobile is registered to the desired network. Typical example: PIN was entered and accepted with OK, but the ME fails to register to the network. This may be due to missing network coverage, denied network access with currently used SIM card, no valid roaming agreement between home network and currently available operators etc. TC65 offers various options to verify the present status of network registration: For example, the AT+COPS command indicates the currently used network. With AT+CREG you can also check the current status and activate an unsolicited result code which appears whenever the status of the network registration changes (e.g. when the ME is powered up, or when the network cell changes).

> • | <pin> and <new pin> can also be entered in quotation marks (e.g. "1234").

> • | To check the number of remaining attempts to enter the passwords use the AT^SPIC command.

> • | See AT+CPWD and AT^SPWD for information on passwords.

> • | See AT+CLCK and AT^SLCK for information on lock types.