GPRS using POST/GET with SIM900

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

GPRS using POST/GET with SIM900

Post by hyperion007 »

Hi,

So I've been trying to get this going for quite some time now and can't seem to get it.

I have the webserver set up and working. Tested using a simple web form that uses method="post" to send data to insert.php that looks like this:

This is the HTML page code:

<form action="insert.php" method="post">
Temperature 01: <input type="text" name="temperature_01"><br>
<input type="Submit">
</form>

This is the PHP code:

<?
$username="domain.com";
$password="*********************";
$database="database";

$temperature_01=$_POST['temperature_01'];

$db=mysql_connect("database.mysql", $username,$password);
mysql_select_db($database, $db) or die( "Unable to select database");

$query = "INSERT INTO LOGGER001 VALUES ('','$temperature_01')";
mysql_query($query);

mysql_close();
?>


Like I said, works fine when using my computer to input a value in the web form and submitting it.

But I can't get the hang of configuring my SIM900 module. I have tried the simple things like sending an SMS to my phone and such, it works fine.
Getting all the settings correct for the GPRS and HTTP stuff, and sending data to my database, has not worked at all!

I have attached my test program, now set up for method="get" instead of post but I've tried so many different things, examples, etc. nothing seems to work.


Any help with this would be much appreciated.

/Daniel S
Last edited by hyperion007 on Sun Apr 20, 2014 10:02 am, edited 1 time in total.

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by Jordy101091 »

Hi Hyperion007,

Maybe this link could be useful for you.

http://forum.arduino.cc/index.php/topic,116867.0.html

Regards Jordy
the will to learn, should not be stopped by any price

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by hyperion007 »

Thanks Jordy,

Been all over google and tried just about all examples I have found. Now even the one from the link you provided. Still no go. I can get it to work buy simply writing this as the URL in my browser: http://www.level6.se/insert2.php?temperature01=35

that will write the value 35 to the database. but the SIM900 is a no go. Don't think the instructions or help files for the GSM component is that great :(
Last edited by hyperion007 on Sun Apr 20, 2014 10:02 am, edited 1 time in total.

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by Jordy101091 »

Could it be possible that the SIM900 module doesn't support that type of communication.

Rg, Jordy
the will to learn, should not be stopped by any price

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by hyperion007 »

Well according to all the examples and datasheet it seems to work just fine for others

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by Jordy101091 »

The following link is for a SIM300 module but it might also work with yours,

http://www.edaboard.com/thread126547.html

Regards Jordy
the will to learn, should not be stopped by any price

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by hyperion007 »

Ok, I apparently was a bit blind when setting this up. I had chosen the PIC18F4450 and not the correct PIC18F4550.

So I got the coms working but am still unable to figure out what is going wrong. Probably just the order of doing things or missing a step or setting. I've tried so many examples that are claimed by the authors to work, on this very same SIM900.

The only part of the code I am having particular problem with is the very last bit, where I need to send data to the module in a STRING like: "GET /input.php?var1=1" followed by the ESC char (26) without sending a Line Feed or CR until after the ESC char is sent. I think anyway. it's not at all clear from the datasheet nor the many examples. Some of which use functions like POST (which I would like to use instead of GET) or URL or HTTP (functions as in function names of the SIM900)

I even tried using the RS232 component instead of the GSM component and though I might try that, but it didn't help, I don't know if I didn't do it correctly or something (probably didn't :) )

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by Jordy101091 »

Hi,

I need to confess that I don't have any experience with the SIM900 module so I will help you be searching for examples that you might missed during your search on the web.

So maybe you have already find the following link:

http://www.edaboard.com/thread281314.html

If not maybe it can be useful for you.

Regards Jordy
the will to learn, should not be stopped by any price

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by hyperion007 »

I do appreciate the help Jordy, but I think it will require some hands on experience with AT commands and such to get this going.

I might just offer a free SIM900 module to the person willing and able to provide a custom component for it, that incorporates functions like GET and POST data over GPRS, FTP, SMTP, etc.
A lot to ask maybe but the modules are not cheap either :) Making calls and sending text messages (SMS) works with the standard GSM component (both outgoing and incoming calls and texts)

Now a days when just about every prepaid SIM card will allow GPRS after the allowed data traffic quota over 3G/4G has been reached it would be a great and cheap way to add wireless capabilities to any project. All you would need to do is have a prepaid SIM card and charge it with the smallest amount possible, and remember to use it to send an outgoing text message once a year to keep it active (policies will differ between carriers of course)

So if you think you're up for it Jordy just let me know :) Or if the staff at Matrix have the time and willingness I could supply them with the same SIM900 module.

Heck, there will probably be a more modern and better GSM module out there, so suggestions are welcome for alternatives to the SIM900. It is quite power hungry and might not be the best for battery powered projects :)

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: GPRS using POST/GET with SIM900

Post by Jordy101091 »

Well I'm always up for a challenge, but it kind of feels wrong to ask if you could send such a module, because I don't have any experience with it.
So I will let that decision up to you, if you decide to send me a module I will help you with you problems.
If not then I will try to help anyway I can.

Regards Jordy
the will to learn, should not be stopped by any price

Post Reply