ESP8266 AT Command Project
IntroductionThe ESP8266 is a powerful and cost-effective Wi-Fi module widely used for IoT applications. To streamline communication with the module, I developed an enhanced AT Command firmware that enables serial communication with microcontrollers, allowing easy control over network functions without deep programming knowledge.
Features :This project provides an extended set of AT commands that allow users to:
- Connect to Wi-Fi networks.
- Retrieve and set IP addresses.
- Send HTTP GET and POST requests.
- Manage files using SPIFFS or LittleFS.
- Adjust baud rate for serial communication.
- Retrieve firmware versions.
- Perform firmware updates over the air (OTA).
- ESP-NOW for direct device-to-device communication.
Hardware Requirements
- ESP8266 module.
- 5V power supply.
- UART interface (e.g., USB-to-Serial converter or MCU with UART support).
- A terminal software like PuTTY or Arduino Serial Monitor.
- connect 5V ---> 5V of Arduino
- connect GND ---> GND of Arduino
- connect TX ---> pin 2 of Arduino
- connect RX ---> pin 3 of Arduino
follow the wiring below
upload the code below to the Arduino then open the Serial Monitor and configure the baud Rate to 9600 and the end message to "NL & CR" then type "AT"
#include <SoftwareSerial.h>
#define RX_PIN 2
#define TX_PIN 3
SoftwareSerial esp(RX_PIN, TX_PIN);
void setup() {
esp.begin(9600);
Serial.begin(9600);
}
void loop() {
if (esp.available() > 0) {
Serial.print((char)esp.read());
}
if (Serial.available() > 0) {
esp.print((char)Serial.read());
}
// put your main code here, to run repeatedly:
}
Here are some of the key AT commands available in this firmware
- AT : Test serial communication.
- AT+RESET : Reboot the module.
- AT+CHECKUPDATE : Check for firmware updates
- AT+UPDATE : Update firmware
- AT+WICON=<SSID>, <PASS> : Connect to a Wi-Fi network
- AT+WIFIP? : Retrieve IP address
- AT+HTGET=<URL> : Send an HTTP GET request
- AT+HTPOST=<URL>, <DATA> : Send an HTTP POST request
- AT+FSWRITE=<FILE>, <DATA> : Write data to a file
- AT+FSREAD=<FILE> :Read data from a file
- AT+MACADDR? :Retrieve MAC address
- AT+NOWSEND=<DATA> : Send data via ESP-NOW
For a full list, check out the official project repository or documentation.
Note: To upload your own ESP8266 code, connect the module to a USB-to-TTL converter and tie G0 to GND before powering the module to enter programming mode.
Applications- IoT automation
- Smart home projects
- Remote data logging
- Wireless communication between devices
This AT Command firmware extends the functionality of the ESP8266, making it easier to integrate Wi-Fi communication into embedded projects. With support for HTTP requests, file handling, and ESP-NOW, it simplifies IoT development.
Comments
Please log in or sign up to comment.