“Works With Simplex” Program Announcement
April 8, 2024Guide to Choosing the Right Cellular IoT Data SIM Provider for Fleet and Asset Tracking
April 23, 2024Useful AT commands to troubleshoot IoT connectivity and eSIM functionality.
As we are working with eSIMs and eUICCs we are testing them with multiple different Modules and Modems. Sometimes the best way to know what’s actually happening with the device is to get to grass roots of communication. As an example once we have executed remotely an eSIM swap using the EIM we want to see which ICCID is actually active there. We can grab a terminal connection to the Modem (minicom -D /dev/ttyUSB3) and then issue command AT+CCID?
Without further here are some useful commands we use daily.
General Commands that get commonly used
AT+CPIN?
- Description: Checks the PIN status of the SIM card.
- Use: Determines if the SIM card is ready or needs a PIN/PUK to unlock.
AT+CSQ
- Description: Returns the signal quality report.
- Use: Helps in determining the strength of the cellular signal, which is crucial for diagnosing connection issues.
AT+CREG?
- Description: Network registration status.
- Use: Checks whether the modem is registered on the network, searching for a network, or registration is denied.
AT+COPS?
- Description: Operator selection.
- Use: Displays the currently selected mobile operator. Can be set to choose a specific network manually or automatically.
- AT+COPS=? Check networks available
AT+CPOL
- Description: Set parameters for preferred network selection, sometimes used in conjunction with AT+CPLS.
- Use: AT+CPOL=0,2,”310260″,2 (Selects the network with MCC 310, MNC 260 in GSM mode)
AT+CPLS?
- Description: Read the list of preferred PLMNs from the SIM card’s EF_PLMNsel file.
AT+CGDCONT
- Description: Define PDP context.
- Use: Configures the Packet Data Protocol settings, including APN. Essential for establishing data connections.
- AT+CGDCONT=1,”IP”,”simplex.iot” set the APN to simplex.iot
ATD
- Description: Dial command.
- Use: Used to dial a number, typically used for voice or data calls (like
ATD*99***1#
to start a data call).
ATH
- Description: Hang up call.
- Use: Ends an ongoing call or data session.
AT+CMGF
- Description: Select SMS message format.
- Use: Configures the modem to send SMS in text or PDU (protocol description unit) mode.
AT+CMGS
- Description: Send SMS message.
- Use: Sends an SMS message in text mode or PDU mode, depending on the configuration set by AT+CMGF.
AT+CLAC
- Description: List all available AT commands.
- Use: Very useful for discovering all supported AT commands on a particular modem, especially when documentation is lacking.
AT+CMEE
- Description: Enable verbose error reporting.
- Use: Sets the modem to provide more detailed error reports, aiding in troubleshooting.
AT+CGATT?
- Description: GPRS attachment status.
- Use: Checks if the modem is attached to the GPRS service, which is essential for data services.
AT+CGSN
- Description: Request product serial number identification (IMEI).
- Use: Retrieves the modem’s IMEI number, useful for identification and regulatory purposes.
AT+CCID
- Description: Read SIM card ID.
- Use: Retrieves the ICCID of the SIM card, which is its unique identifier.
AT+EID
- Description: Read eUICC ID
AT+GMI
- Description: Request manufacturer identification.
- Use: Gets the manufacturer’s name of the modem.
- Variations
- ATI OEM module version
- AT+CGMI OEM specific ID
- AT+CGMM OEM specific model ID
- AT+GMM OEM specific model ID
AT+CGACT?
- Description: check the Data attachment status
- Use: check the Data/GPRS context state, or activate/deactivate PDP context
AT+CFUN?
- Description: check the modem status
- Use: check the SIM PIN status enabled/disabled, how many entries left
AT+CGREG?
- Description: Check Data Network registration status.
- Use: Checks whether the modem is registered on the network, searching for a network, or registration is denied.
Establish Cellular Connectivity using AT commands
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'ERROR'
TIMEOUT 30
"" "AT"
OK "AT+CFUN=1"
OK "AT+CGDCONT=1,\"IP\",\"simplex.iot\""
OK "ATD*99#"
CONNECT
Modem Functionality commands CFUN:
AT+CFUN=<fun>,<rst>
<fun> 0 Turns off RF
<fun> 1 Full functionality
<fun> Disable both transmit and receive.
<rst> 1 reset the modem after setting the functionality.
Example:
AT+CFUN=1,1 would set the modem to full functionality and then reset it (soft reset)
Advanced Commands:
AT+CRSM=214,28539,0,0,12,"FFFFFFFFFFFFFFFFFFFFFFFF"
- Description: Write Fs on the FPLMN file
- Use: If your modem has written an MNO to the FPLMN file it will not recommend to it. In some fringe cases resetting or clearing the FPLMN file will help the model to re-register to the MNO network.
AT+CRSM=242,28539
- Description: Erase the FPLMN file
- Use: Same use case as previously but different approach to erase the file instead of overwriting with Fs. Modem has to support this command.
Comments / Feedback? Are we missing some cool command here? Let us know here!