
The latest document content of this article can be found at:

1. Overview of AT Commands
AT commands are an ancient method of communication that has been in use since wired communication.
As of 2024, it has a history of over 40 years.
The use case of AT commands is to treat the 4G module as a black box accessory, with the device requiring a main control CPU.
The main control CPU of the device sends commands starting with the “AT” string through a serial port (it can also be SPI or USB, but 99% of the time it is through a serial port) to request various services from the 4G module.
After completing the service, the 4G module replies with a string to acknowledge the main control CPU.
This series of request-response interactions enables the device to have communication capabilities.
Today, AT commands have evolved and become increasingly functional.
The AT commands of manufacturers’ 4G modules at least have the following complete functions:
1. Basic network query commands such as signal strength query, carrier query, SIM card status query, IMEI query, network registration status query, etc.;
2. Support for various communication protocols such as TCP/UDP, HTTP, FTP, MQTT, etc.;
3. Use of internal module resources such as file system storage, deletion, query, etc.
Despite the convenience of using AT commands, there are still several obvious drawbacks:
1. Low operating efficiency: communication efficiency is low as it can only be asynchronous communication between two physical CPUs through serial ports. If efficient business and communication integration actions are to be performed, the cost is higher.
2. Requires an additional main control CPU;
3. For IoT devices with low complexity, although the computing and storage resources of the 4G module are already sufficient, an additional main control CPU is still needed to use AT commands.
4. To save costs, the main control CPU often chooses a model with limited resources, which usually cannot run high-level languages, so business logic is often developed in C language.
5. This requires the R&D team to be familiar with the development architecture of the main control CPU, which is still a significant learning cost.
6. Since most 4G modules have sufficient resources, they already support script development applications.
7. Therefore, eliminating the main control CPU and directly developing applications using the 4G module can lower R&D costs.
Despite these drawbacks, AT commands still have a large user base and retain a significant usage proportion today due to habitual use.
2. Overview of the Functionality Implemented in This Tutorial
This article teaches you how to use AT commands to allow the Hezhou 4G module to perform receiving or sending operations with an HTTP server through a few simple steps!
The functionality defined in this tutorial is:
1. Use an HTTP server;
2. After inserting the SIM card and powering on the 4G module, use the HTTP GET command to retrieve content from the HTTP server;
3. Explanation of TCP passive disconnection and PDP passive deactivation prompts;
3. Preparing the Hardware Environment
To do a good job, one must first sharpen their tools. Before formally introducing this functional example, you need to prepare the following hardware environment.
3.1 Air780E Development Board
Use the Air780E core board, as shown in the figure below:

The latest version of the usage instructions for the Air780E product manual in the Public Product Data – Hezhou Module Data Center (openluat.com) is:20240419155721583_开发板Core_Air780E使用说明V1.0.5.pdf (vue2.cn);If you encounter any issues during the use of the core board, you can directly refer to this usage instruction PDF document.
3.2 SIM Card
Prepare a SIM card that can access the internet, which can be an IoT card or your own mobile phone card;
Note: The SIM card must not be overdue and must be able to access the internet!!!
3.3 PC Computer
Prepare a computer;
Note: The computer must have a USB port and be able to access the internet!!!
3.4 Data Communication Cable
Prepare a data cable, which connects the Air780E development board and the PC computer to control and interact with business logic through AT commands;
There are two types of data cables that can be used, and you can choose one;
The first type of data cable is a USB data cable (the part connecting to the Air780E development board is a Type-C interface), generally, this kind of data cable is shown in the figure below:

Ordinary mobile phone USB data cables can generally be used directly;
The second type of data cable is a USB to TTL serial cable, generally, this kind of data cable is shown in the figure below:

In this tutorial, the first type of USB data cable is used.
3.5 Assembling the Hardware Environment
Insert the SIM card according to the insertion direction on the SIM card slot, being careful not to insert it incorrectly!
As shown in the figure below, push the SIM card firmly into the slot until you hear a click sound.


Connect the USB data cable between the computer and the Air780E development board, as shown in the figure below:

4. Preparing the Software Environment
To do a good job, one must first sharpen their tools. Before formally introducing this functional example, you need to prepare the following software environment.
4.1 Luatools Tool
To flash the AT firmware onto the 4G module, you need to use Hezhou’s powerful debugging tool: Luatools;
For detailed usage instructions, refer to:Luatools Tool Usage Instructionshttps://docs.openluat.com/Luatools/
4.2 AT Firmware
The correct AT firmware must be flashed into the 4G module to support AT command functionality;
You can flash the AT firmware through Luatools;
There are two ways to obtain the latest AT firmware for the Air780E module, and you can choose one;
The first way is to obtain it through Luatools, as shown in the figure below, where you can directly select the latest version of the AT firmware:

The second way is to visit: Air780E firmware version, and find the latest firmware version.
4.3 Hezhou HTTP Test Server
For convenience in testing, Hezhou provides a free non-commercial HTTP test website, Hezhou HTTP Test Server;
4.4 PC Serial Port Tool
In the hardware design of mass-produced projects, commands are generally sent from the main MCU to the 4G module via UART to achieve specific business logic;
In this tutorial, for convenience in testing, the main MCU is not used;
Instead, a serial tool on the PC, LLCOM, is used to send commands to the 4G module to demonstrate functionality;
Download link for LLCOM:https://llcom.papapoi.com/index.htmlFor detailed usage instructions, refer to the download site directly.
5. Example of Usage Method
5.1 Confirm the Development Board is Powered On and Connected to the Internet
The firmware version used in this tutorial is v1169. After flashing the firmware through Luatools, you can determine the device status by printing, as shown in the figure below:

5.2 HTTP Related Commands
Click to connect to view Hezhou 4G module HTTP commands
5.3 Adding Files on the HTTP Server
Here, we will use the Hezhou HTTP test server to demonstrate adding files
First, confirm the file you want to upload

Upload the hello.txt file to the server

After uploading, you can get the link through the email file

5.4 Example of Normal Use Process Without Certificate
Below is a demonstration of the normal connection process and performing an HTTP GET operation.
When reviewing the process, pay attention to the comments after the commands, as they help in understanding the specific functions of the commands.
5.5 HTTPS Process with SSL Certificate Verification Function
Below is a demonstration of the process with SSL certificate verification. In subsequent projects, fill in your own certificate according to the actual situation.
5.6 HTTP Downloading Large Files (Resume Support)
In actual application scenarios, it may be necessary to download a very large file, such as several hundred KB or several MB. However, the available memory buffer for HTTP in the 4G module is about 300KB (about 4KB for the 780E module). When the file size exceeds this buffer, the resume function must be used for segmented downloading. Below is an example of “downloading a 11975260-byte file” to illustrate how to use the resume feature (Note: This example only demonstrates the normal flow of HTTP AT commands; for the complete flow and exception handling, please refer to the application flow section of this article).
5.7 HTTP Download Large File Insufficient Memory Issue
You can use the above resume feature or new AT commands AT+HTTPEXACTION / AT+HTTPEXGET examples:
6. APN Settings and Private Network Cards
6.1 APN Explanation
Users can distinguish based on the type of network they are using; SIM cards can be divided into public network cards and private network cards. To determine whether your SIM card is a public network card or a private network card, you can use the following two methods: