Moler’s AT command module provides structured parsers for the AT command set defined in 3GPP TS 27.007. All commands inherit fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nokia/moler/llms.txt
Use this file to discover all available pages before exploring further.
GenericAtCommand (moler.cmd.at.genericat), which handles OK / ERROR / +CME ERROR / +CMS ERROR response detection automatically.
AT commands default to a prompt regex that matches
OK, NO CARRIER, ERROR, +CME ERROR:, and +CMS ERROR:. The operation parameter controls whether the command string ends with =? (test), ? (read), or nothing (execute).Full command list
| Class | Module | AT command sent |
|---|---|---|
At | moler.cmd.at.at | Bare AT |
Attach | moler.cmd.at.attach | AT+CGATT=1 |
CreatePduSession | moler.cmd.at.create_pdu_session | AT$QCRMCALL=1,1 |
Cu | moler.cmd.at.cu | cu (serial proxy) |
Detach | moler.cmd.at.detach | AT+CGATT=0 |
EnableEcho | moler.cmd.at.enable_echo | ATE1 |
ExitSerialProxy | moler.cmd.at.exit_serial_proxy | (escape sequence) |
GetApns | moler.cmd.at.get_apns | AT+CGDCONT? |
GetAttachState | moler.cmd.at.get_attach_state | AT+CGATT? |
GetCellId | moler.cmd.at.get_cell_id | AT+CREG? |
GetCellIdGprs | moler.cmd.at.get_cell_id_gprs | AT+CGREG? |
GetCellIdLte | moler.cmd.at.get_cell_id_lte | AT+CEREG? |
GetCellIdNr | moler.cmd.at.get_cell_id_nr | AT+C5GREG? |
GetFunctionalityLevel | moler.cmd.at.get_functionality_level | AT+CFUN? |
GetImei | moler.cmd.at.get_imei | AT+CGSN / AT+CGSN=1 |
GetImsi | moler.cmd.at.get_imsi | AT+CIMI |
GetIp | moler.cmd.at.get_ip | AT+CGPADDR |
GetManufacturerId | moler.cmd.at.get_manufacturer_id | AT+CGMI |
GetProductInfo | moler.cmd.at.get_product_info | ATI |
GetRevisionId | moler.cmd.at.get_revision_id | AT+CGMR |
GtCellLock | moler.cmd.at.gt_cell_lock | AT%NRCELLLOCK |
PlinkSerial | moler.cmd.at.plink_serial | plink (serial) |
QuectelLockNrEarfcn | moler.cmd.at.quectel_lock_nr_earfcn | AT+QNWLOCK |
QuectelNetworkPreferences | moler.cmd.at.quectel_network_preferences | AT+QNWPREFCFG |
ReleasePduSession | moler.cmd.at.release_pdu_session | AT$QCRMCALL=0,1 |
RunScript | moler.cmd.at.run_script | (script execution) |
SetApn | moler.cmd.at.set_apn | AT+CGDCONT=... |
SetCellId | moler.cmd.at.set_cell_id | AT+CREG=... |
SetCellIdGprs | moler.cmd.at.set_cell_id_gprs | AT+CGREG=... |
SetCellIdLte | moler.cmd.at.set_cell_id_lte | AT+CEREG=... |
SetCellIdNr | moler.cmd.at.set_cell_id_nr | AT+C5GREG=... |
SetFunctionalityLevel | moler.cmd.at.set_functionality_level | AT+CFUN=<n> |
SetMode | moler.cmd.at.set_mode | AT+CNMP=... |
GenericAtCommand | moler.cmd.at.genericat | (abstract base) |
Detailed reference
GenericAtCommand — moler.cmd.at.genericat
Base class for all AT commands.
Moler connection to the device (modem/UE serial port or proxy).
AT command mode:
"execute" (default), "read" (appends ?), or "test" (appends =?).Prompt pattern signalling end-of-command. Defaults to matching
OK, ERROR, +CME ERROR:, +CMS ERROR:, NO CARRIER.Characters used to split lines.
Runner used to execute the command.
GetImei — moler.cmd.at.get_imei
Retrieves the IMEI (International Mobile Equipment Identity) using AT+CGSN.
Moler connection to the device.
Serial number type:
"default" (AT+CGSN), "imei" (AT+CGSN=1), "imeisv", or "svn". Default "default".sn_type="default")
| Key | Type | Description |
|---|---|---|
imei | str | Raw IMEI string, e.g. "490154203237518" |
sn_type="imei")
| Key | Type | Description |
|---|---|---|
imei | str | Full IMEI string |
tac | str | Type Allocation Code (8 digits) |
snr | str | Serial number (6 digits) |
cd | str | Check digit (1 digit) |
GetImsi — moler.cmd.at.get_imsi
Retrieves the IMSI (International Mobile Subscriber Identity) using AT+CIMI.
Result:
| Key | Type | Description |
|---|---|---|
imsi | str | IMSI number, e.g. "49009123123123" |
Attach — moler.cmd.at.attach
Triggers PS domain attachment using AT+CGATT=1. Waits up to 180 seconds for OK.
Result: {} (empty dict, ret_required=False)
Detach — moler.cmd.at.detach
Detaches from the PS domain using AT+CGATT=0.
Result: {} (empty dict)
CreatePduSession — moler.cmd.at.create_pdu_session
Establishes a PDU session using AT$QCRMCALL=1,1 (Qualcomm RM-call interface).
Result: {} (empty dict, ret_required=False)
ReleasePduSession — moler.cmd.at.release_pdu_session
Releases a PDU session using AT$QCRMCALL=0,1.
GetCellIdLte — moler.cmd.at.get_cell_id_lte
Retrieves LTE cell registration status using AT+CEREG?. Parses the +CEREG: response including lac, ci (cell ID), AcT (access technology), and optional TAU/RAU timer fields.
Result keys (depending on network reporting level):
| Key | Type | Description |
|---|---|---|
n | str | Unsolicited result code presentation setting |
stat | str | Registration status |
lac | str | Location area code |
ci | str | Cell identity |
AcT | str | Access technology |
cause_type | str | Reject cause type (level 3) |
reject_cause | str | Reject cause value (level 3) |
GetFunctionalityLevel — moler.cmd.at.get_functionality_level
Reads the current modem functionality level using AT+CFUN?.
SetFunctionalityLevel — moler.cmd.at.set_functionality_level
Sets the modem functionality level using AT+CFUN=<n>.
Common values: 0 = minimum, 1 = full, 4 = airplane mode.
Error handling
All AT commands automatically detect error responses and raiseCommandFailure: