Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved]Problem sending GET to webserver from SIM900 with AT commands

Status
Not open for further replies.

nimaaa

Newbie level 6
Joined
Jul 25, 2014
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
Tehran, Iran, Iran
Activity points
122
Sending a Single data to Web Server via Sim900's Get Method

HI All
I want to send a single data to my webserver , and I want to use get Method

but after using AT+HTTPACTION sim900 gives me the 404 error
do you know how I should solve that ??


my At Commands are :

AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","http:///mydomain.in/nri.php?data=10"
AT+HTTPACTION=0
AT+HTTPTERM


and my php code in nri.php is :

<?php

echo " Nima" ;

$var1=$_GET['data'] ;
echo $var1 ;

?>


Thanks in Advance

Referring To Old Thread :

https://www.edaboard.com/threads/281314/
 
Last edited:

Re: Sending a Single data to Web Server via Sim900's Get Method

why three / in ?
Code:
AT+HTTPPARA="URL","http:///mydomain.in/nri.php?data=10"
 
  • Like
Reactions: nimaaa

    nimaaa

    Points: 2
    Helpful Answer Positive Rating
Re: Sending a Single data to Web Server via Sim900's Get Method

Hi horace

thank you . but when I was trying my code in hyperterminal , I entered it correctly with two "//". I'm sure about this part
and '.in' is part of my domain address like .com
any way thank you for reminding my mistake . I'm going to edit it right now

AT+HTTPPARA="URL","http://mydomain/nri.php?data=10"

any idea ?
 

Re: Sending a Single data to Web Server via Sim900's Get Method

@nimaaa, has the problem been solved?
 

Re: Sending a Single data to Web Server via Sim900's Get Method

Hi ogbeni

yes . now I don't get the 404 error and I connected to my host successfully.
my mistake was that I was entering my AT Command with uppercase letters while my nri.php is saved with lowercase letters in my host

AT+HTTPPARA="URL","HTTP://MYDOMAIN/nri.php?data=10" is OK


but still I cant' see any data in my PHP page
I just need a simple PHP code to get this data and show it in my page without any options
what is problem with my php code ??

<?php

echo " nimaaa" ;

$var1=$_GET['data'] ;
echo $var1 ;

?>

I tried your php code , too , but it didn't work
 

I reviewed your post. To be serious I don't know if you actually understand the difference between GET and POST.

Common sense helps, GET means to read data from a server. Respectively you'll perform first an AT+HTTPACTION=0 command, then use AT+HTTPREAD to receive the data. There are pretty clear examples in the SIMCOM FTP HTTP AT Commands User Guide.
 

Hi FVM

Get is not just for receiving data . It can sends data too . but it's difference with post that it doesn't have enough security because in this Method data is included in the URL and it is visible for everyone

Both of them are methods for sending and recieving data . when data is sent with GET method , it should be received by GET method , too
as you see I have included my data in URL , in my second HTTPPARA at command
 

Apart from the question what can be generally done with HTTP GET and POST methods (I'm not motivated to argue in this regard), it's possibly reasonable to refer to the description in SIMCOM manual.

I don't think that SIMCOM is prepared to interact with php scripts.
 

you are right FVM . we are not here to argue :wink:
I'm sending data to my webserver via sim900's GET method ( as you said POST method is possible too) and surly in my webserver I'll need PHP code to receive the data

I'm just looking for this php code :(
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top