> 5.6 | AT+CPWD Change Password

> AT+CPWD allows to define a new password for a password protected <facility> lock function. Each password is a string of digits, the length of which varies with the associated <facility>. The test command returns a list of pairs which represent the available facilities and the maximum length of the associated password. See AT commands AT+CLCK and AT^SLCK for more information on the various lock features.
> Specifically the command can be used to

> • | change PIN1 or PIN2,

> • | change the password supplied from your provider for the "call barring" supplementary service,

> • | set individual phone security passwords,

> • | enter the unblocking key (Master Phone Code) to restore a disabled "PS" password.

> To delete a password use the following syntax: at+cpwd=<facility>,<old password>
> Syntax

> Test Command AT+CPWD=?
> Response(s)
> +CPWD:list of supported (<facility>, <password length>)
> OK

> Write Command AT+CPWD=<facility>, <old password>[, <new password>]
> Response(s)
> New password has been registered for the facility lock function.
> OK
> If parameter <old password> was not correct:
> +CME ERROR 16 (+CME ERROR: incorrect password)
> If the password for the selected <facility> has been invalidated due to too many failed attempts:
> +CME ERROR ...
> If error is related to ME functionality:
> +CME ERROR

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

> Parameter Description

> <facility>(str)

> Phone security locks set by client or factory:
> Primarily intended for the client to take safety precautions, passwords "SC" (SIM PIN) and "P2" (SIM PIN2) are usually predefined, but can be configured individually. The password for lock facility "PS" may also be factory set.
> “SC“
> SIM PIN. SIM requests password upon ME power-up and when this lock command is issued.
> If incorrectly entered three times, the SIM PUK is required to perform authentication. Input of the SIM PUK password is possible only with AT command AT+CPIN or ATD. For further details please refer to Section 5.1.1, What to do if PIN or password authentication fails?.
> <password length>: 4 to 8 digits.
> “PS“
> Phone locked to SIM card. ME requests password when other than current SIM card is inserted.
> "PS" lock is frequently referred to as "phone lock", or "device lock". Accordingly, the password may be called "phone code" or "device code". The "PS" password is not associated with the PUK of the SIM card. It must be defined before the first use of <facility> "PS" with AT+CLCK.
> <password length>: 4 digits.
> If incorrectly entered three times, the Master Phone Code is required to lift the lock. This Unblocking procedure is performed with AT+CPWD using the following parameters: <facility>="PS", <old password>= Master Phone Code (to be obtained from the module manufacturer), and <new password>= the new phone code ("PS" password for lock facility), if desired.
> Mind that successful PIN authentication is a prerequisite for use of AT command AT+CPWD. If Pin authentication has not been completed, input of the Master Phone code password is possible only with AT command AT+CPIN or ATD. For further detail please refer to Section 5.1.1, What to do if PIN or password authentication fails?.
> Once the Master Phone Code has been acctepted, the mobile is operational, and the "PS" lock is no longer active. If needed it must be set once again with AT+CLCK.
> “P2“
> SIM PIN 2, e.g. required for authentication with facility lock "FD" (cf. AT+CLCK).
> If incorrectly entered three times, the SIM PUK 2 is required to perform authentication. Input of the SIM PUK 2 password is possible only with AT command AT+CPIN2 or ATD. For further detail please refer to Section 5.1.1, What to do if PIN or password authentication fails?.
> <password length>: 4 to 8 digits.
> Factory defined SIM locks:
> Typical examples of factory set SIM locks are prepaid phones or network locks, used to restrict the operation of a mobile to a specific provider or operator. The client should be aware that each of these lock types can only be unlocked if the associated password is available. For example, a mobile can be locked to accept only SIM cards from the respective provider, or even one single SIM card. Once a different SIM card is inserted the ME will prompt the client to enter a specific code. This is not the PUK of the SIM card, but usually an 8-digit code which needs to be requested from the provider.
> The locks can only be set by the manufacturer and need to be agreed upon between the parties concerned, e.g. provider, operator, distributor etc. on the one side and the manufacturer on the other side. For details contact your local dealer or Siemens AG.
> “PF“
> Lock Phone to the very First SIM card
> “PN“
> Network Personalisation
> “PU“
> Network subset Personalisation
> “PP“
> Service Provider Personalisation
> “PC“
> Corporate Personalisation
> Supplementary Service Call Barring:
> Supplementary Service "Call Barring" allows to specify conditions under which calls will be disallowed by the network.
> The availability of the Supplementary Services varies with the network. To benefit from call barring the client will need to subscribe them, though a limited number of call barring types may be included in the basic tariff package.
> <password length>: The Network Password needs to be supplied from the network provider or network operator. Usually there is one 4 digit password which applies to all call barring options. For details contact your provider.
> “AO“
> BAOC (Bar All Outgoing Calls)
> “OI“
> BOIC (Bar Outgoing International Calls)
> “OX“
> BOIC-exHC (Bar Outgoing International Calls except to Home Country)
> “AI“
> BAIC (Bar All Incoming Calls)
> “IR“
> BIC-Roam (Bar Incoming Calls when Roaming outside the home country)
> “AB“
> All Barring services
> “AG“
> All outGoing barring services
> “AC“
> All inComing barring services

> <password length>(num)

> 4...8
> Length of password. The range of permitted length for a password depends on the associated <facility>. It is available from the test command response, or in the description of parameter <facility>.

> <old password>(str)

> Password specified for the facility.
> Parameter <old password> can be ignored if no old password was allocated to the facility.
> Take into account that a password may have already been set by factory, or that the service is subject to a password issued by the provider. See notes above or contact provider.

> <new password>(str)

> New password. Mandatory, if <old password> was an unblocking key (such as the Master Phone Code).
> Notes

> • | When changing PIN2 (<facility>="P2") it is recommended to check the new state of PIN2 by using the AT+CPIN2 command.

> • | In the airplane mode the write command version for the network related <facility> (AO, OI, OX, AI, IR, AB, AG and AC) is not supported. For remaining facilities the command is fully functional then.

> Examples

> EXAMPLE 1 | To change PIN2

> AT+CPWD="P2","0000","8888" | (where "0000" = old PIN2 and "8888" = new PIN2)
> OK | PIN2 Password has been changed to "8888"

> EXAMPLE 2 | To set password used to enable or disable barring of all outgoing calls:

> AT+CPWD="AO","0000","3333" | Requests the network to change the password for supplementary service "call barring".
> OK | Usually this request will affect all barring services, even though the request is issued for Supplementary Service BAOC ("Barring of all outgoing calls") only. Refer to the respective network provider for detail.

> EXAMPLE 3 | Handling of the "PS" lock password

> AT+CMEE=2 | Enable text output of CME Error information
> AT+CPWD="PS","1111","2222" | (where "1111" = old password and "2222" = new password)
> OK | Password for facility "PS" is now "2222"
> AT+CPWD="PS","1111","2222" | Repeat command to provoke error "incorrect password"
> +CME ERROR: incorrect password | ("1111" is no longer the correct password)

> EXAMPLE 4 | To specify a new "PS" lock password, after the old password was disabled (e.g. after three failed attempts to change the "PS" password): use the master phone code. CAUTION: THIS TEST SHOULD BE PERFORMED ONLY IF THE CORRECT MASTER PHONE CODE FOR THE INDIVIDUAL ME USED IS DEFINITELY AVAILABLE! Otherwise the module used will be rendered useless until the correct master phone code is entered!:

> AT+CPWD="PS","12345678","1111" | where 12345678 is the Master Phone Code and 1111 is the new password. You may also use <new password> to restore the former disabled password.
> OK

> Alternatively, without giving a new password:

> AT+CPWD="PS","12345678" | (where 12345678 is the Master Phone Code). Deactivates the present phone lock.
> OK