• Javascript
  • Python
  • Go

How to Retrieve SIM Number (ICCID) of a Modem via AT Commands

When using a modem, it is important to know the SIM number, also known as the Integrated Circuit Card Identifier (ICCID). This unique number...

When using a modem, it is important to know the SIM number, also known as the Integrated Circuit Card Identifier (ICCID). This unique number is assigned to every SIM card and is used to identify the device on a cellular network. Retrieving the SIM number of a modem can be useful for troubleshooting network issues, activating a new SIM card, or simply keeping track of your device's information. In this article, we will guide you through the process of retrieving the SIM number of a modem using AT commands.

Step 1: Connect to the Modem

The first step is to connect to the modem via a terminal program. This can be done using a serial or USB cable. Once connected, you will need to enter the AT command mode. This can be done by sending the command "AT" followed by a carriage return (CR) or line feed (LF) character.

Step 2: Check for SIM Presence

Before retrieving the SIM number, it is important to ensure that the SIM card is present in the modem. To do this, send the command "AT+CPIN?" This command will return the SIM status, which should be "READY" if the SIM is present and functioning properly. If the status is "SIM PIN" or "SIM PUK," it means that the SIM card is locked and you will need to enter the correct PIN or PUK code to unlock it.

Step 3: Retrieve the SIM Number

To retrieve the SIM number, send the command "AT+CCID" This command will return the SIM number in a hexadecimal format. The SIM number is typically 19 digits long and may include both numbers and letters. It is important to note that not all modems support this command, so if you do not receive a response, it means that your modem does not have this feature.

Step 4: Convert the Hexadecimal Number

The SIM number returned by the "AT+CCID" command may be in a hexadecimal format, which may be difficult to read and use. To convert it to a more readable format, you can use an online hexadecimal to decimal converter or a calculator with a hexadecimal function. Once converted, you will have the 19-digit SIM number in a decimal format.

Step 5: Save the SIM Number

It is recommended to save the SIM number in a secure location for future reference. You can also write it down on a piece of paper or save it in a digital file for easy access. This will come in handy if you ever need to activate a new SIM card or troubleshoot network issues.

Conclusion

Retrieving the SIM number of a modem is a simple process that can be done using AT commands. By following the steps outlined in this article, you can easily retrieve the SIM number and keep track of your device's information. Remember to always check for the presence of the SIM card before attempting to retrieve the SIM number, and to save the number for future use. Knowing the SIM number of your modem can be helpful in various situations and can save you time and effort in the long run.

Related Articles

Reading Serial Ports in Java

Serial ports are a vital component in computer communication, allowing data to be transmitted between devices at high speeds. In Java, readi...

Linux Virtual Serial Port

Linux Virtual Serial Port: A Guide to Setting Up and Using In the world of computer programming and networking, serial ports have long been ...

Creating a Serial Port in VB.net

Creating a Serial Port in VB.net In today's world of technology, communication plays a vital role in connecting devices and transferring dat...