HTTP/GET Request using AT Command – SIM800L Internet Connection Tutorial (Part 1)

HTTP/GET Request using AT Command – SIM800L Internet Connection Tutorial (Part 1)

Congratulation your SIM800L HTTP
request has been successful so this is the page I made on this URL and now we successful accessing that page so this is my setup it’s 12 power supply
12 volt power supply this is step down to make the voltage to about 4.2 volt and it’s the SIM800L and of course this is the Arduino so the wiring diagram is just like this okay you can see me right here and now
we will try to turn on this power supply so that the SIM is on okay it’s already
light up and so they SIM it’s blink on the corner so we can start our test with the
Arduino IDE so right now we will learn how to send the HTTP request with SIM800L
let’s open the Arduino IDE okay we already open the arduino IDE and
this is the simple sketch the function is to forward the text from serial monitor
to our SIM800L so every text that we type in serial monitor will send to the
SIM800L and if there is a reply from SIM800L this sketch will
send back to the serial monitor so let’s upload this sketch and this
Serial use pin 10 and 11 for Rx and Tx okay let’s open our serial monitor and
first thing to do is check the AT command so if the SIM is already connect and ready to answer our text when we type AT the sim will answer with OK so
the communication between the Arduino and SIM800L is already connected now
we first will check the SIM800L is it ready or not
by typing CFUN? and it’s answer CFUN : 1 okay so SIM800L seems no problem and then we can continue by type AT+SAPBR=3, 1,”Contype”,”GPRS” it means that we use the GPRS connection and it’s
answer OK and then we will set the APN by type AT+CSTT this
will differ for every cellular providers so maybe you have the different setting
for the APN for me it’s 3GPRS or the APN the user name is 3GPRS too and
then the password is 3GPRS too so the first is APN the second is user name
and third is password okay it’s answer OK then we use the AT+SAPBR=1 the from now we can start the HTTP request by first initiate HTTP services with HTTP init and then continue with the set HTTP
session by typing HTTPPARA=CID,one and then you can type
the URL we want to access so for this example I will access my page it’s on the complete URL is so I just make a page that the content is just a text
and we will read what its content after we read the content using this HTTP
requests okay it’s answer OK and we will wait for the HTTP action the
action is to start the session so you will read the code is it ok or not
so it 200 it’s mean that the connection is okay the HTTP session the HTTP
session is successful but if it return another code maybe like 601 it means network error and another code you can read here okay after we success make session we
will read what the content of the page AT+HTTPREAD this is the content of the page Congratulation yout SIM800L HTTP request has been successful it is the page I make on
this URL and now we successful accessing the page okay you can test in
your browser too, to make sure return the same content, to
terminate the session we just use the AT+ HTTPTERM we can start another
HTTP session and now we will try to GET requests we will input a data to
my PHP page that the PHP page will submit data to my database using the GET request so we will start a new session using the AT+ HTTPINIT okay so if we want to start a new
session we just start from the HTTPINIT and then HTTPPARA just like what we
do the first time and then the URL so for now I will edit the URL the URL will
submit the data it’s 11 the data to my getdata.PHP so my PHP will
submit the data 11 to my database and then action to execute the URL and it’s
return 200 and then HTTPREAD OK data 11 successfully added it’s mean that we success use the HTTP
request with SIM800L then to test we can make sure by open URL in our
browser so we will check if it same Congratulation
and blablabla this is like what we see in our serial monitor so our SIM800L has doing a good job and make the complete data returned to the serial monitor and
this is the second test we add the data to database by using GET request okay
that is our tutorial for now and next tutorial we will try to make the HTTP
requests automatically by arduino without we have to type in serial
monitor thank you bye

2 thoughts on “HTTP/GET Request using AT Command – SIM800L Internet Connection Tutorial (Part 1)

  1. I think twice before buying the expensive 4G module. then I came across this video. you saved me a lot of money for using sim800l. Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *