Want to visit link with SIM900A GPRS

Hello Guys,
I have Arduino UNO and SIM900A Mini. I want to invoke one URL in order I send some data to database.
I wrote script for myself which accept GET method so I should pass data in parameters:

http://[mywebsite]/projects/page.php?start=started&stop=stoped&total=yes
Where:

  • started
  • stoped
  • yes

are variable I will have to send from Arduino.

So how should I invoke this URL from Arduino via SIM900A Mini Module.
Please help and give me some idea.

Just a piece of note, My SIM900A isn't Shield but it's a Module.

How much research have you done? In a few moments I found this web page that shows how to make an http request.

Thank You very much :slight_smile:
Well I didn't find anything working, I need simple example. :confused: I am working on it since 8 hours.
As the example you have shown is using "SoftwareSerial.h" not all commands are working on my Module as SoftwareSerial work perfectly on Sheilds.
Also I can get it work, if you can check and help me with this:

https://arduino.stackexchange.com/questions/45060/problem-testing-gprs-with-sim900a-example-testgprs

That is a simple example. Extract the http request code, upload a serial relay program and see how far you get.

Thank You. :slight_smile:
I will definitely require this method SubmitHttpRequest();
Any help you can do here

Which country are you in?

And regarding your other thread,

AT+QIFGCNT=0%13%

is a command specifically for the Quectel M10, as used in the Arduino GSM shield, NOT supported by the Simcom family.

Pakistan.
And I am using Telenor, I wrote all details here:
https://arduino.stackexchange.com/questions/45060/problem-testing-gprs-with-sim900a-example-testgprs

Pakistan isn't on the list on countries in which the SIM900A will work:

http://zapro.dk/div/pdf/20111031145224.pdf

I can send message from here:

Also I can call from it here:
https://arduino.stackexchange.com/questions/45060/problem-testing-gprs-with-sim900a-example-testgprs
As it says:

My SIM900A isn't shield but module, and not all AT Commands of SoftwareSerial.h works on it. I tested SIM900.println("ATD+ +92xxxxxxxxx;"); for call which is working but SIM900.println("AT+CMGS="+92xxxxxxxxx"\r"); for text message is not working

Hello I got this by inputting h into Serial Monitor, it executes method called: SubmitHttpRequest();, I got this:

AT+CSQ

+CSQ: 30,0

OK
AT+CGATT?

+CGATT: 1

OK
AT+SAPBR=3,1,"CONTYPE","GPRS"

OK
AT+SAPBR=3,1,"APN","CMNET"

OK
AT+SAPBR=1,1

OK
AT+HTTPINIT

OK
AT+HTTPPARA="URL","www.google.com.hk"

OK
AT+HTTPACTION=0

OK

+SAPBR 1: DEACT

+HTTPACTION:0,601,0AT+HTTPREAD

OK

Is it Okay? :confused:

PS:
How do I fill this:
mySerial.println("AT+SAPBR=3,1,"APN","CMNET""); with My APN and Username Password?

You need the APN settings for your network provider. CMNET is China Mobile.

I pass there parameters as:

APN:          internet
Username: Telenor
Password: Telenor

as

mySerial.println("AT+SAPBR=3,1,\"internet\",\"Telenor\",\"Telenor\"");

I got this upon entering h

⸮AT+CSQ

+CSQ: 29,0

OK
AT+CGATT?

+CGATT: 1

OK
AT+SAPBR=3(⸮⸮⸮⸮AT+SAPBR=1,1

ERROR
AT+HTTPINIT

OK
AT+HTTPPARA="URL","www.google.com.hk"

OK
AT+HTTPACTION=0

OK

+HTTPACTION:0,601,0
AT+HTTPREAD

OK

What I am doing wrong?

I change: CMNET on Line 142 From:

mySerial.println("AT+CSTT=\"CMNET \"");

to:

mySerial.println("AT+CSTT=\"internet\"");

And output now is:

AT+CSQ

+CSQ: 31,0

OK
AT+CGATT?

+CGATT: 1

OK
AT+SAPBR=3,1,"CONTYPE","GPRS"

OK
AT+SAPBR=3,1,"internet","Telenor","Telenor"

ERROR
AT+SAPBR=1,1

OK
AT+HTTPINIT

ERROR
AT+HTTPPARA="URL","www.google.com.hk"

OK
AT+HTTPACTION=0

OK
AT+HTTPREAD

OK


+HTTPACTION:0,200,11279

Instead of trying to connect to Google.com.hk, why not try your URL and see what happens? The return code of 200 suggests that despite the error messages your are connecting.

Good idea :slight_smile:
BTW What is this: :o It just printed now. Is this something a part of above, or is it just garbage ?

+CMTI: "SM",13

It means you have received a text message / SMS.

Hello
Wow
So the URL is successfully invoking and data is inserting into database :slight_smile:
(1):

AT+CSQ

+CSQ: 28,0

OK
AT+CGATT?

+CGATT: 1

OK
AT+SAPBR=3,1,"CONTYPE","GPRS"

OK
AT+SAPBR=3,1,"internet","Telenor","Telenor"

ERROR
AT+SAPBR=1,1

OK
AT+HTTPINIT

OK
AT+HTTPPARA="URL","http://[mywebsite]/projects/page.pAT+HTTPACTION=0

OK

+HTTP(U⸮⸮J⸮b00,18
AT+HTTPREAD

+HTTPREAD:18
Successfully Added
OK

(2):
I just got this issue that my LONG link isn't showing completely like

http://[mywebsite]/projects/page.php?start=started&stop=stoped&total=yes

but it trimed at: page.php....

(3):
Also I am curious that when I give APN Username and Password why s it showing:
ERROR

AT+SAPBR=3,1,"internet","Telenor","Telenor"

ERROR
AT+SAPBR=1,1

(4):
Oh this is weired:

+HTTP(U⸮⸮J⸮b00,18

Also I am getting some garbage ? ? ? ? at the end when system is idle.

THANK YOU very much for all the time,
Hail Arduino.cc community.