Software apps and online services | ||||||
![]() |
| |||||
Mr. Abhishek Maurya, founder of Yarana IoT Guru, wanted to build a smart home sensor system that could fit into a compact space.
He discovered the Arduino Nano ESP32 — a tiny yet powerful board packed with Wi-Fi and Bluetooth features.
Within just a few hours, he developed a mobile-controlled lighting system and a temperature monitoring setup, fully powered by Yarana Smart Home Technology.
💬 “It amazed me — a tiny board doing everything a full ESP32 Dev Board can do!”
🚀 Powered by Yarana IoT Guru
📞 Contact: +91 7052722734
🌐 Website: https://yaranaiotguru.in
- 📺 YouTube: @YaranaIot Guru
- Basic AT Commands (must-know)
- If HTTP AT commands not present, use TCP socket commands:
- MQTT/TCP (module-specific, many modules have QMT commands)
- Example: Minimal Arduino/ESP32 Sketch (HTTP POST using AT commands)
- Example AT Command Scenarios
- Check SIM & network
- Setup APN and attach
- HTTP GET via HTTP AT commands (if supported)
Basic AT Commands (must-know)
C/C++Format: AT<command> — send via UART. Replace <CR> by pressing Enter.
Core / Device info
AT → OK (basic comms check)
AT+GSV → firmware & module version (vendor-specific)
AT+CGSN or AT+GSN → IMEI
AT+CPIN? → SIM PIN status
Network / Signal
AT+CSQ → signal strength. Response +CSQ: <rssi>,<ber> (rssi 0-31, 99 unknown).
AT+COPS? → current operator.
AT+CREG? → network registration (2G). AT+CGREG? for GPRS, AT+CEREG? for EPS (LTE).
PDP / APN (activate data)
AT+CGDCONT=1,"IP","your.apn.here" → set APN (replace with operator APN).
AT+CGACT=1,1 or AT+CGATT=1 → attach PDP context (varies by module).
Some modules use AT+CGDATA="PPP",1 for PPP mode (less common on dev boards).
HTTP (module built-in HTTP commands vary by firmware)
Many lightweight modules offer HTTP AT commands (AT+HTTPINIT, AT+HTTPPARA, AT+HTTPACTION, AT+HTTPREAD, AT+HTTPTERM). If your firmware supports them, use those. If not, open a TCP socket and implement HTTP manually via AT commands.
Example HTTP sequence (firmware with HTTP support):
Core / Device info
AT → OK (basic comms check)
AT+GSV → firmware & module version (vendor-specific)
AT+CGSN or AT+GSN → IMEI
AT+CPIN? → SIM PIN status
Network / Signal
AT+CSQ → signal strength. Response +CSQ: <rssi>,<ber> (rssi 0-31, 99 unknown).
AT+COPS? → current operator.
AT+CREG? → network registration (2G). AT+CGREG? for GPRS, AT+CEREG? for EPS (LTE).
PDP / APN (activate data)
AT+CGDCONT=1,"IP","your.apn.here" → set APN (replace with operator APN).
AT+CGACT=1,1 or AT+CGATT=1 → attach PDP context (varies by module).
Some modules use AT+CGDATA="PPP",1 for PPP mode (less common on dev boards).
HTTP (module built-in HTTP commands vary by firmware)
Many lightweight modules offer HTTP AT commands (AT+HTTPINIT, AT+HTTPPARA, AT+HTTPACTION, AT+HTTPREAD, AT+HTTPTERM). If your firmware supports them, use those. If not, open a TCP socket and implement HTTP manually via AT commands.
Example HTTP sequence (firmware with HTTP support):
AT+HTTPINIT
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","http://example.com/path?x=1"
AT+HTTPACTION=0 // 0=GET, 1=POST
// wait for +HTTPACTION: 0,<status>,<bytes>
AT+HTTPREAD
AT+HTTPTERM
AT+NETOPEN // or AT+QIOPEN / AT+QIOPEN=1,0,"TCP","example.com",80,0,0
AT+NTP? // module-specific
AT+QIOPEN=1,0,"TCP","example.com",80,0,0 // Quectel style example
AT+QISEND=0, <len>
<send raw HTTP GET request here>
AT+QICLOSE=0
MQTT/TCP (module-specific, many modules have QMT commands)
C/C++Example (Quectel-like):
(Exact commands vary; consult vendor-specific AT manual.)
(Exact commands vary; consult vendor-specific AT manual.)
AT+QMTCFG="...",...
AT+QMTOPEN=0,"broker.hivemq.com",1883
AT+QMTCONN=0,"clientid"
AT+QMTPUB=0,0,0,0,"topic"
Example: Minimal Arduino/ESP32 Sketch (HTTP POST using AT commands)
C/C++his is a robust, single-file sketch using HardwareSerial on ESP32. It demonstrates sending sensor-like JSON to http://example.com/endpoint via plain HTTP using TCP socket style (manual HTTP) — works if module exposes TCP socket AT commands. Adapt APN, UART pins, and socket commands to your exact module firmware.
/* ESP32 + SIM A7670C example: HTTP POST using AT (manual TCP)
- Connect:
SIM_RX -> ESP32 TX2 (GPIO17)
SIM_TX -> ESP32 RX2 (GPIO16)
GND common
- Power: stable VBAT for SIM module
- Update APN, server, path, and UART pins as needed
*/
#include <HardwareSerial.h>
HardwareSerial simSerial(2); // UART2: RX2=16, TX2=17 on many ESP32
const int SIM_RX = 16; // connect to module TX
const int SIM_TX = 17; // connect to module RX
const unsigned long BAUD = 115200;
void sendAT(const char* cmd, unsigned long wait=1000) {
simSerial.println(cmd);
Serial.print(">> "); Serial.println(cmd);
delay(wait);
readResponse();
}
void readResponse(unsigned long timeout=1000) {
unsigned long t0 = millis();
while (millis() - t0 < timeout) {
while (simSerial.available()) {
char c = simSerial.read();
Serial.write(c);
}
}
}
void setup() {
Serial.begin(115200);
simSerial.begin(BAUD, SERIAL_8N1, SIM_RX, SIM_TX);
delay(1000);
Serial.println("Starting SIM A7670C example...");
// Basic check
sendAT("AT", 500);
sendAT("ATE0", 200); // turn off echo (optional)
sendAT("AT+CPIN?", 500); // check SIM
sendAT("AT+CSQ", 500); // signal
sendAT("AT+CREG?", 500); // registration
// Set APN - replace with your operator APN
sendAT("AT+CGDCONT=1,\"IP\",\"internet\"");
delay(500);
// Optional: attach PDP
sendAT("AT+CGATT=1", 2000);
// Open TCP connection (module-specific; replace with your module's socket open command)
// Example for generic module using AT+QIOPEN style - adapt as needed
sendAT("AT+QIOPEN=1,0,\"TCP\",\"example.com\",80,0,0", 3000);
// Wait and read +QIOPEN response...
}
void loop() {
// Prepare HTTP POST content
String payload = "{\"device\":\"A7670C\",\"temp\":29.5}";
String http = "";
http += "POST /endpoint HTTP/1.1\r\n";
http += "Host: example.com\r\n";
http += "Content-Type: application/json\r\n";
http += "Content-Length: ";
http += String(payload.length());
http += "\r\n\r\n";
http += payload;
// Send length then actual data (module-specific - use appropriate send command)
String sendCmd = "AT+QISEND=0," + String(http.length());
simSerial.println(sendCmd);
delay(500);
readResponse(1000);
// Now send raw HTTP bytes
simSerial.print(http);
delay(2000);
readResponse(3000);
// Close socket (module-specific)
sendAT("AT+QICLOSE=0", 1000);
// Sleep or wait before next send
delay(60000); // send every 60s
}
AT+CPIN?
+CPIN: READY
AT+CSQ
+CSQ: 23,0 // good signal
AT+COPS?
+COPS: 0,0,"MyOperator"
AT+CREG?
+CREG: 0,1 // registered
43 projects • 19 followers
Yarana Iot Guru
Yarana IoT Guru: Arduino,
ESP32, GSM, NodeMCU & more.
Projects, Tutorials & App Development. Innovate with us!
Thanks to YaranaIot Guru.











Comments