AT commands is the protocol you use to talk to cellular modules. It stands for attention commands — a standardised language that goes back to dial-up modems. The A7670E is a modern LTE module that speaks the same language. You send it a command over UART, it sends back a response. That's it.
This is about making a real HTTP GET request over a live SIM card, from an ESP8266, using nothing but AT commands typed in over serial. No libraries, no abstractions — just the raw flow.
Parts
- ESP8266 (NodeMCU v2 or similar)
- A7670E LTE module
- SIM card with a data plan
- A capacitor (recommended — the module can spike to 2A)
- USB power + jumper wires
Wiring
You only need three wires between the ESP8266 and the module:
- GND → GND
- D5 (ESP RX) → A7670E TX
- D6 (ESP TX) → A7670E RX
TX goes to RX and vice versa. Power from USB. If the SIM card is inserted, you'll see the module LED flash when it powers up. The capacitor goes across the power rail — the current draw can spike hard during network activity, and without it you'll get random resets.
Sketch
The sketch sets up a software serial port on D5/D6 at 9600 baud and bridges it to the hardware serial (USB). Type go into the monitor and it starts forwarding — everything you type goes to the module, everything the module replies comes back to you. Upload with:
pio init --board nodemcuv2
pio run -t upload && pio device monitor -b 9600
Full sketch is on GitHub — link in the description.
The HTTP flow
Once you're in the serial bridge, run these commands in order. Steps 1–7 set up the connection. Steps 8–12 are the actual HTTP request — you can repeat those for different URLs without redoing the setup.
AT— ping the module. Should returnOK. If it doesn't, check wiring and baud rate.AT+CPIN?— check SIM status. You want+CPIN: READY. Anything else means the card isn't seated properly.AT+CSQ— signal quality. The first number is 0–31. Anything 15 or above is usable. 99 means the module can't read signal yet.AT+CREG?— network registration.0,1means registered on the home network.0,5is roaming.0,3is denied — usually a carrier lock or no coverage.AT+CGATT=1— attach to the packet data network. Think of it as turning on mobile data.AT+CGDCONT=1,"IP","internet"— set your APN. Replaceinternetwith your carrier's APN. Croatian carriers: A1 usesinternet, T-Com usesweb.ht.hr, Tele2 usesinternet.tele2.hr.AT+CGACT=1,1— activate the data context. This is where the module connects to the carrier and gets an IP. If this fails, the APN is wrong or there's no data on the SIM.AT+HTTPINIT— start an HTTP session. If you getERROR, a previous session is still open — runAT+HTTPTERMfirst.AT+HTTPPARA="URL","http://httpbin.org/ip"— set the URL.AT+HTTPACTION=0— execute a GET request. You getOKimmediately, then a few seconds later:+HTTPACTION: 0,200,31. That's method, HTTP status, and response byte count.AT+HTTPREAD=0,31— read the response body. Use the byte count from the previous step. You'll get back the raw response — in this case your public IP in JSON.AT+HTTPTERM— close the session. Always do this. If you skip it, the nextAT+HTTPINITwill fail.
That's the whole flow. A complete reference of all A7670E commands — including SMS, MQTT, GPS, and HTTPS — is linked in the description.
If something doesn't work, the most common issues are: wrong APN, SIM with no data plan, or a power supply that can't handle the current spikes. If you get it working or hit a weird error, come share it in the Discord — link's below.