cellular-at-modem-integration
Skill36 starsChanged 5 months agoMITView on GitHub
Use when integrating or debugging cellular AT modems (Quectel, SIMCom, u-blox) over UART for CREG/CEREG registration, CGDCONT APN/PDP, TCP/UDP sockets, or URC parsing
In this repository75 other files it gives its agents.
- 8051-mcu-debugSkill
- avem-integrationSkill
- battery-charger-fuel-gauge-integrationSkill
- ble-gatt-integrationSkill
- bootloader-debugSkill
- canbus-integrationSkill
- canopen-integrationSkill
- cmbacktrace-integrationSkill
- cmsis-dsp-integrationSkill
- cortex-m-debugSkill
- cortex-r5-debugSkill
- crc-checksum-integrationSkill
- easylogger-integrationSkill
- embedded-app-example-libsSkill
- embedded-buffer-queue-libsSkill
- embedded-data-parsing-libsSkill
- embedded-debug-entrySkill
- embedded-fault-debugSkill
- embedded-framework-libsSkill
- embedded-input-libsSkill
- embedded-library-entrySkill
- embedded-linux-login-debugSkill
- embedded-peripheral-bringupSkill
- embedded-serial-log-debugSkill
- embedded-state-machine-libsSkill
- embedded-timing-libsSkill
- epd-integrationSkill
- esp-idf-integrationSkill
- fatfs-integrationSkill
- flashdb-integrationSkill
- freemodbus-integrationSkill
- freertos-kernel-debugSkill
- freertos-plus-tcp-integrationSkill
- gnss-gps-integrationSkill
- hardware-interface-debugSkill
- heatshrink-integrationSkill
- letter-shell-integrationSkill
- littlefs-integrationSkill
- low-power-debugSkill
- lvgl-integrationSkill
- lwip-integrationSkill
- mbedtls-integrationSkill
- mcuboot-integrationSkill
- mcu-flashing-debugSkill
- micro-ecc-integrationSkill
- miniz-integrationSkill
- mqtt-embedded-integrationSkill
- nanopb-integrationSkill
- nrf-connect-sdk-integrationSkill
- nr-micro-shell-integrationSkill
- openocd-jlink-stlink-debugSkill
- openthread-integrationSkill
- ota-update-integrationSkill
- plooc-integrationSkill
- power-management-integrationSkill
- qspi-xip-flash-debugSkill
- readme-writingSkill
- riscv-mcu-debugSkill
- rtos-debugSkill
- rt-thread-integrationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use this skill when the UART link itself is unproven.
- Very specific: line 41
Use AT+CREG? for 2G/CS registration, AT+CGREG?
- Very specific: line 53
Run a line-based state machine that classifies each line as echo, intermediate (>), final (OK/ERROR/+CME ERROR), or URC (RING, +CMTI:, …
- Very specific: line 64
After AT+CPSMS/AT+CEDRXS the module sleeps and drops the socket.
- Distinctive: line 68
Before claiming the link works:
- Distinctive: line 75
If PSM/eDRX is enabled, confirm wake, re-registration, and data resume.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cellular AT Modem Integration
Overview
Use this skill to drive a 2G/4G/NB-IoT/LTE-M cellular modem from an MCU over UART with the AT command set. The hard parts are parsing unsolicited result codes (URCs) that interleave with command responses on one serial line, choosing the right registration command per radio access technology, using the correct socket command set for the specific module family, and getting PWRKEY boot timing right before any AT works.
When To Use
Use this skill when:
- The user integrates Quectel (
EC25,BG96,BC66), SIMCom (SIM7600,SIM800C,A7670), or u-blox (SARA-R4,SARA-R5) over UART. - The issue involves registration (
AT+CPIN?,AT+CSQ,AT+CREG?,AT+CGREG?,AT+CEREG?), APN/PDP (AT+CGDCONT,AT+CGATT,AT+CGACT), or sockets (AT+QIOPEN,AT+QISEND,AT+CIPSTART/AT+CIPOPEN,AT+USOCO). - URCs such as
RING,+CMTI, or+QIURCcorrupt command parsing, or power saving (AT+CPSMS,AT+CEDRXS) breaks reachability.
Do not use this skill when the UART link itself is unproven; confirm the modem echoes AT with OK at the configured baud first.
First Questions
Ask for:
- Exact module and firmware revision (
ATI,AT+CGMR), and radio technology: 2G, LTE Cat-1, Cat-4, Cat-M1, or NB-IoT. - UART wiring: baud, flow control (RTS/CTS), and whether
PWRKEY/reset lines are MCU-controlled. - SIM type and the operator APN (some IoT SIMs need username/password or a specific
<PDP_type>). - Transport goal: raw TCP/UDP, or bridging to MQTT/TLS on top of the socket AT layer.
- Current failing command and its literal response or error code.
Integration Checklist
- Bring up the modem.
Assert
PWRKEYfor the module's specified pulse width, wait for boot (often signalled by anRDYURC), then confirmATreturnsOKand disable echo withATE0. - Unlock and check signal.
AT+CPIN?must return+CPIN: READY;AT+CSQRSSI must be non-99(0-31 valid). SetAT+CFUN=1if radio is off. - Confirm registration on the right command.
Use
AT+CREG?for 2G/CS registration,AT+CGREG?for GPRS/PS, andAT+CEREG?for LTE/Cat-M1/NB-IoT (EPS).<stat>must be1(home) or5(roaming). - Define and activate the PDP context.
AT+CGDCONT=1,"IP","<apn>", thenAT+CGATT=1to attach andAT+CGACT=1,1to activate. Verify an assigned IP withAT+CGPADDR. - Open the socket with the correct vendor stack for the module family.
- Quectel (
EC25/BG96/BC66):AT+QIOPEN, thenAT+QISEND/AT+QIRD/AT+QICLOSE. - SIMCom 2G (
SIM800-class):AT+CIPSTART, thenAT+CIPSEND(write payload after>, terminate withCtrl+Z0x1A). - SIMCom LTE (
SIM7600/A76XX-class):AT+NETOPENfirst, thenAT+CIPOPENto open a socket andAT+CIPSENDto send (AT+CIPSEND=<link>,<len>takes an explicit length; noCtrl+Zwhen a length is given). Read buffered data withAT+CIPRXGET; close withAT+CIPCLOSE/AT+NETCLOSE. - u-blox (
SARA):AT+USOCRto create,AT+USOCOto connect,AT+USOWRto write,AT+USORDto read,AT+USOCLto close.
- Quectel (
- Build a URC-aware parser.
Run a line-based state machine that classifies each line as echo, intermediate (
>), final (OK/ERROR/+CME ERROR), or URC (RING,+CMTI:,+QIURC:), and route URCs to callbacks instead of the command waiter.
Common Failures
- Sending AT before boot completes; commands are dropped until the
RDYURC or a fixed power-on delay elapses. - Checking
AT+CREG?on an LTE-only module that only registers via+CEREG, so registration looks stuck at0,2. - Registration fails from wrong APN, disabled radio (
AT+CFUN=0), locked SIM, or poor signal (+CSQ: 99,99). - Using the wrong socket stack: sending
AT+CIPSTARTto aSIM7600/A76XXmodule (which needsAT+NETOPEN+AT+CIPOPEN), or forgettingAT+NETOPENbeforeAT+CIPOPEN. - Fixed read timeout truncates variable-length responses like
AT+QIRDor a slowAT+COPS=?scan. - URC (e.g.
+QIURC: "recv") arrives mid-response and the parser mistakes it for the command reply, causing a parse race. AT+CIPSENDon aSIM800-class module sent without theCtrl+Zterminator, so the modem waits forever at the>prompt.- After
AT+CPSMS/AT+CEDRXSthe module sleeps and drops the socket; sending during PSM fails until wake and re-attach.
Verification
Before claiming the link works:
- State the module, technology, APN, and which registration command applies.
- Confirm
+CPIN: READY, a valid+CSQ, and<stat>=1or5on the correctCxREG. - Confirm
AT+CGPADDRshows an IP before opening any socket. - Send a round-trip TCP payload and confirm the receive path for the module family (
+QIURC: "recv"/AT+QIRD, or+CIPRXGET, or+USORD). - Prove the URC parser handles an unsolicited
RING/+CMTIarriving during a command without desync. - If PSM/eDRX is enabled, confirm wake, re-registration, and data resume.
Example
User:
BG96 用 AT+CEREG? 一直返回 0,2,连不上网,该怎么查?Agent:
- Confirms boot done,
ATE0set, then checksAT+CPIN?=READYandAT+CSQis not99. - Verifies
AT+CFUN=1and the APN viaAT+CGDCONT?; fixes APN if wrong for the IoT SIM. - Waits for
+CEREG: 0,1/0,5, then runsAT+CGACT=1,1andAT+CGPADDRbefore opening a socket withAT+QIOPEN.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

