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. For basic SIM800L tutorial, you can find it here. And if you have problems with SIM800L you can find another troubleshooting tutorial here.
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());
}
}
SIM800L Arduino Wiring Diagram
Use pin 10 and 11 for a Serial connection between Arduino and SIM800L. I use a step down to make the voltage about 4.2V from the 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 SLL 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 :
Hi. Thank you for this nice article.
I have an error “+HTTPACTION: 1,606,0”. I guess it is related with web server ssl config.
Can you share your web server’s ssl configuration?
You probably need to add resistors to RXD pin of Sim800L to reduce voltage from 5V to 3.3V
How to write in a server using this module? No At command found for writing.
Eu tenho um erro “+ HTTPACTION: 1,606,0”. e estou trabalhando em 3.3v
Is that url in php https://miliohm.com/getData.php/data=11 stored to dbms?
How is that url created? Any specification.
Mine url gives something other as an output:
URL: https://conspeer.in/temperature?temp=450&pressure=67&humidity=34
output: Apache http server ……
ERROR at AT+SAPBR=1,1 and eveything else after it.