SIM800L internet Connection Tutorial – AT Command List to make HTTP/GET request
In this article we will examine how to make a HTTP/GET Request to web page using AT Command of SIM800L. We will give you the list of AT Command needed and step by step the sequence of the AT Command.
If you are using arduino to make GET request you need a sketch to forward data from your computer’s serial monitor to SIM800L. Use this sketch :
#include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX void setup() { // put your setup code here, to run once: Serial.begin(9600); mySerial.begin(9600); //pinMode(13, OUTPUT); } void loop() { if (mySerial.available()) { Serial.write(mySerial.read()); } if (Serial.available()) { mySerial.write(Serial.read()); } }
Use pin 10 and 11 for Serial connection between arduino and SIM800L. I use a step down to make the voltage about 4.2V from 12V power supply. So here’s the wiring diagram.
And below is step by step AT command to use
Set Connection to GPRS :
AT+SAPBR=3,1,"Contype","GPRS"
Set the APN, username and password.
AT+CSTT="3gprs","3gprs","3gprs"
(the APN, username and password i’m using is 3GPRS
Enable the GPRS
AT+SAPBR=1,1
Check if we already got IP Adress
AT+SAPBR=2,1
Enabling HTTP mode :
AT+HTTPINIT
OPTIONAL, If you are using or SSL use :
AT+HTTPSSL=1
Setting HTTP bearer profile :
AT+HTTPPARA="CID",1
Give URL of website we want to access :
AT+HTTPPARA="URL","https://miliohm.com/miliohmSIM800L.php"
Start HTTP GET Session :
AT+HTTPACTION=0
Read the content of webpage :
AT+HTTPREAD
Terminate the session :
AT+HTTPTERM
The Detail of how to do this you can watch on video below :
1 Komentar
Tinggalkan Balasan
Anda harus masuk log untuk mengirim sebuah komentar.
Tinggalkan Balasan
Anda harus masuk log untuk mengirim sebuah komentar.
SIM800L internet Connection Tutorial – AT Command List to make HTTP/GET request
Very useful tutorial. Thank you.
I flush my ESP8266 with your code and I tried giving AT commands. All of them worked right as in your video except the command AT+HTTPPARA=”URL”,”http://my.site.com/getdata.php” that answer “ERROR”. I don’t use SSL so I ommited the AT+HTTPSSL=1 command.
I tried with “url” but the same. I closed the session and tried again but same result. The SIM800L is connected to the network (flashes every 3 seconds).
Can you help me please to solve this critical problem ?
Thanks in advance