Skip to main content

Documentation 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.

Moler’s AT command module provides structured parsers for the AT command set defined in 3GPP TS 27.007. All commands inherit from 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

ClassModuleAT command sent
Atmoler.cmd.at.atBare AT
Attachmoler.cmd.at.attachAT+CGATT=1
CreatePduSessionmoler.cmd.at.create_pdu_sessionAT$QCRMCALL=1,1
Cumoler.cmd.at.cucu (serial proxy)
Detachmoler.cmd.at.detachAT+CGATT=0
EnableEchomoler.cmd.at.enable_echoATE1
ExitSerialProxymoler.cmd.at.exit_serial_proxy(escape sequence)
GetApnsmoler.cmd.at.get_apnsAT+CGDCONT?
GetAttachStatemoler.cmd.at.get_attach_stateAT+CGATT?
GetCellIdmoler.cmd.at.get_cell_idAT+CREG?
GetCellIdGprsmoler.cmd.at.get_cell_id_gprsAT+CGREG?
GetCellIdLtemoler.cmd.at.get_cell_id_lteAT+CEREG?
GetCellIdNrmoler.cmd.at.get_cell_id_nrAT+C5GREG?
GetFunctionalityLevelmoler.cmd.at.get_functionality_levelAT+CFUN?
GetImeimoler.cmd.at.get_imeiAT+CGSN / AT+CGSN=1
GetImsimoler.cmd.at.get_imsiAT+CIMI
GetIpmoler.cmd.at.get_ipAT+CGPADDR
GetManufacturerIdmoler.cmd.at.get_manufacturer_idAT+CGMI
GetProductInfomoler.cmd.at.get_product_infoATI
GetRevisionIdmoler.cmd.at.get_revision_idAT+CGMR
GtCellLockmoler.cmd.at.gt_cell_lockAT%NRCELLLOCK
PlinkSerialmoler.cmd.at.plink_serialplink (serial)
QuectelLockNrEarfcnmoler.cmd.at.quectel_lock_nr_earfcnAT+QNWLOCK
QuectelNetworkPreferencesmoler.cmd.at.quectel_network_preferencesAT+QNWPREFCFG
ReleasePduSessionmoler.cmd.at.release_pdu_sessionAT$QCRMCALL=0,1
RunScriptmoler.cmd.at.run_script(script execution)
SetApnmoler.cmd.at.set_apnAT+CGDCONT=...
SetCellIdmoler.cmd.at.set_cell_idAT+CREG=...
SetCellIdGprsmoler.cmd.at.set_cell_id_gprsAT+CGREG=...
SetCellIdLtemoler.cmd.at.set_cell_id_lteAT+CEREG=...
SetCellIdNrmoler.cmd.at.set_cell_id_nrAT+C5GREG=...
SetFunctionalityLevelmoler.cmd.at.set_functionality_levelAT+CFUN=<n>
SetModemoler.cmd.at.set_modeAT+CNMP=...
GenericAtCommandmoler.cmd.at.genericat(abstract base)

Detailed reference

GenericAtCommandmoler.cmd.at.genericat

Base class for all AT commands.
connection
object
required
Moler connection to the device (modem/UE serial port or proxy).
operation
str
AT command mode: "execute" (default), "read" (appends ?), or "test" (appends =?).
prompt
re.Pattern | str
Prompt pattern signalling end-of-command. Defaults to matching OK, ERROR, +CME ERROR:, +CMS ERROR:, NO CARRIER.
newline_chars
list
Characters used to split lines.
runner
object
Runner used to execute the command.

GetImeimoler.cmd.at.get_imei

Retrieves the IMEI (International Mobile Equipment Identity) using AT+CGSN.
connection
object
required
Moler connection to the device.
sn_type
str
Serial number type: "default" (AT+CGSN), "imei" (AT+CGSN=1), "imeisv", or "svn". Default "default".
Result dictionary keys (for sn_type="default")
KeyTypeDescription
imeistrRaw IMEI string, e.g. "490154203237518"
Result dictionary keys (for sn_type="imei")
KeyTypeDescription
imeistrFull IMEI string
tacstrType Allocation Code (8 digits)
snrstrSerial number (6 digits)
cdstrCheck digit (1 digit)
from moler.cmd.at.get_imei import GetImei

cmd = GetImei(connection=conn)
result = cmd()
print(result['imei'])  # '490154203237518'

GetImsimoler.cmd.at.get_imsi

Retrieves the IMSI (International Mobile Subscriber Identity) using AT+CIMI. Result:
KeyTypeDescription
imsistrIMSI number, e.g. "49009123123123"
from moler.cmd.at.get_imsi import GetImsi

cmd = GetImsi(connection=conn)
result = cmd()
print(result['imsi'])  # '49009123123123'

Attachmoler.cmd.at.attach

Triggers PS domain attachment using AT+CGATT=1. Waits up to 180 seconds for OK. Result: {} (empty dict, ret_required=False)
from moler.cmd.at.attach import Attach

cmd = Attach(connection=conn)
cmd()  # blocks until OK or timeout

Detachmoler.cmd.at.detach

Detaches from the PS domain using AT+CGATT=0. Result: {} (empty dict)

CreatePduSessionmoler.cmd.at.create_pdu_session

Establishes a PDU session using AT$QCRMCALL=1,1 (Qualcomm RM-call interface). Result: {} (empty dict, ret_required=False)

ReleasePduSessionmoler.cmd.at.release_pdu_session

Releases a PDU session using AT$QCRMCALL=0,1.

GetCellIdLtemoler.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):
KeyTypeDescription
nstrUnsolicited result code presentation setting
statstrRegistration status
lacstrLocation area code
cistrCell identity
AcTstrAccess technology
cause_typestrReject cause type (level 3)
reject_causestrReject cause value (level 3)
from moler.cmd.at.get_cell_id_lte import GetCellIdLte

cmd = GetCellIdLte(connection=conn)
result = cmd()
print(result.get('stat'))  # '5' = registered, roaming
print(result.get('ci'))    # cell identity hex string

GetFunctionalityLevelmoler.cmd.at.get_functionality_level

Reads the current modem functionality level using AT+CFUN?.

SetFunctionalityLevelmoler.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 raise CommandFailure:
# AT command returns ERROR:
# AT+CGSN
# ERROR
# → raises CommandFailure

# AT command returns CME error:
# AT+CIMI
# +CME ERROR: 10
# → raises CommandFailure with error type and code
To work with a modem over a serial port, use PlinkSerial or Cu from the AT module to establish the connection before sending AT commands.

Build docs developers (and LLMs) love