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.

POST method not working.

Status
Not open for further replies.

andihong

Member level 1
Joined
May 13, 2015
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
216
helo, i have a GSM shield, i want to send the data to php, but it not work..

i use library https://www.open-electronics.org/arduino-gsm-shield/
and using POST example from this https://www.open-electronics.org/the-gsmgprs-gps-shield-some-http-connections-examples/

but it not work, here the serial output from UNO
Code:
GSM Shield testing.
ATT: OK
RIC: 
OK

DB:ELSE
ATT: OK
RIC: 
OK

DB:ELSE
ATT: OK
RIC: 
OK

DB:ELSE
ATT: OK
RIC: 
OK

DB:CORRECT BR
ATT: OK
RIC: 
OK

ATT: OK
RIC: 
OK

ATT: OK
RIC: ATE0

OK

ATT: OK
RIC: 
OK

ATT: OK
RIC: 
OK

ATT: OK
RIC: 
OK

ATT: OK
RIC: 
OK

ATT: +CPMS:
RIC: 
+CPMS: 34,40,34,40,34,40

OK

ATT: OK
RIC: 
OK

ATT: SHUT OK
RIC: 
SHUT OK


status=READY
ATT: ERROR
RIC: 
ERROR

DB:STARTING NEW CONNECTION
ATT: SHUT OK
RIC: 
SHUT OK

DB:SHUTTED OK
ATT: OK
RIC: 
OK

DB:APN OK
ATT: OK
RIC: 
OK

DB:CONNECTION OK
ATT: ERROR
RIC: 
1*.***.***.***

DB:ASSIGNED AN IP
status=ATTACHED
ATT: OK
RIC: 
OK

DB:RECVD CMD
ATT: CONNECT OK
RIC: 
OK

ATT: OK
RIC: 
STATE: IP STATUS

CONNECT FAIL

DB:NOT CONN
ATT: OK
RIC: 
OK

STATE: IP STATUS

CONNECT FAIL

DB:RECVD CMD
ATT: CONNECT OK
RIC: 
OK

STATE: IP STATUS

CONNECT FAIL

DB:NOT CONN
ATT: OK
RIC: 
OK

DB:RECVD CMD
ATT: CONNECT OK
RIC: 
OK

ATT: OK
RIC: 
STATE: IP STATUS

CONNECT FAIL

DB:NOT CONN


Here the httpPOST code

Code:
#include "SIM900.h"

#include <SoftwareSerial.h>

#include "inetGSM.h"

InetGSM inet;

int k = 0;

int j = 0;

char msg[150];

boolean found = false;

char data;

int numdata;

char inSerial[50];

int i = 0;

boolean started = false;

void setup()

{

  Serial.begin(9600);

  Serial.println("GSM Shield testing.");

  if (gsm.begin(2400)) {

    Serial.println("\nstatus=READY");

    started = true;

  }

  else Serial.println("\nstatus=IDLE");

  if (started) {

    if (inet.attachGPRS("internet.wind", "", ""))

      Serial.println("status=ATTACHED");

    else Serial.println("status=ERROR");

    delay(1000);

    inet.httpPOST("www", 80, "/test/test.php", "name=Marco&age=24", msg, 50);

  }

};

void loop()

{

  serialswread();

};

void serialswread() {

  gsm.SimpleRead();

}




and the PHP code

Code:
<?php


echo $_POST["name"];
echo $_POST["age"];




?>



here the conclution is :
1. i have tried httpGET , its works. but not with httpPOST
2. APN is working


please help.. :D
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top