Arduino GSM shield http Get Verbindung

ok
hat etwas gedauert
musste den Rechner neu aufsetzen

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "inetGSM.h"

InetGSM inet;

char msg[20];
int numdata;
char inSerial[50];
int i=0;
boolean started=false;

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(2400)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");

if(started){
//GPRS attach, put in order APN, username and password.
//If no needed auth let them blank.
if (gsm.attachGPRS("internet.eplus.de", "eplus", "internet"))
Serial.println("status=ATTACHED");
else Serial.println("status=ERROR");
delay(1000);

//Read IP address.
gsm.SimpleWrite("AT+CIFSR");
delay(5000);
//Read until serial buffer is empty.
gsm.WhileSimpleRead();

//TCP Client GET, send a GET request to the server and save the reply.
numdata=inet.httpGET("www.google.de", 80, "/", msg, 50);
//Print the results.
Serial.println("\nNumber of data received:");
Serial.println(numdata);
Serial.println("\nData received:");
Serial.println(msg);
}
};

void loop()
{
//Read for new byte on serial hardware,
//and write them on NewSoftSerial.
serialhwread();
//Read for new byte on NewSoftSerial.
serialswread();
};

void serialhwread(){
i=0;
if (Serial.available() > 0){
while (Serial.available() > 0) {
inSerial*=(Serial.read());*

  • delay(10);*
  • i++; *
  • }*

_ inSerial*='\0';_
_
if(!strcmp(inSerial,"/END")){_
Serial.println("");
_
inSerial[0]=0x1a;*

* inSerial[1]='\0';*
* gsm.SimpleWrite(inSerial);*
* }*
* //Send a saved AT command using serial port.*
* if(!strcmp(inSerial,"TEST")){*
* gsm.SendATCmdWaitResp("ATE0", 500, 50, "OK", 5);*

* Serial.println("SIGNAL QUALITY"); *
* gsm.SimpleWrite("AT+CSQ");*
* }*

* //Read last message saved.*
* if(!strcmp(inSerial,"MSG")){*
* Serial.println(msg);*
* }*

* else{*
* Serial.println(inSerial);*
* gsm.SimpleWrite(inSerial);*
* } *

* inSerial[0]='\0';*
* }*
}
void serialswread(){
* gsm.SimpleRead();*
}
DEBUG Rückgabe:
------------------------
GSM Shield testing.
DB:ELSE
DB:ELSE
DB:ELSE
DB:CORRECT BR
status=READY
DB:STARTING NEW CONNECTION
DB:APN OK
DB:CONNECTION OK
DB:ASSIGNED AN IP
status=ATTACHED
10.151.210.62
DB:RECVD CMD
DB:OK TCP
DB:>
DB:SENT
Number of data received:
49
Data received:
HTTP/1.0 302 Found
1
e/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=abf8f714c5e52192:FF=0:TM=1334859529:LM=1334859529:S=B2iPNgj00qPq4Bhg; expires=Sat, 19-Apr-2014 18:18:49 GMT; path=/; domain=.google.com
Set-Cookie: NID=58=QabGqO48aErMwsk3wzLPxnj785EDuKH0Ne9NOiyJA7XHjVxXzMlTHo027hs3fM3Mp3A1k6XJpkQJWJSbgRd_IbbU96pQr7gHyj6_xukVZA6ThpMp36ersNTmNxe-FWCE; expires=Fri, 19-Oct-2012 18:18:49 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See P3P and Google's cookies - Google Account Help for more info."
Date: Thu, 19 Apr 2012 18:18:49 GMT
Server: gws
Content-Length: 218
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

302 Moved

302 Moved


The document has moved
here.

CLOSED
---------------------------
unten sieht man recht gut, dass er mit dem DNS nicht klar kommt
Gruß,
Marko