I have a Seeeduino GPRS, I have problem with read data from a web site
seeedstudio.com/depot/Seeedu … ?cPath=6_7
I get strange output
Her is my code
[code] mySerial.println(“AT+CREG?”);
delay(300);
ShowSerialData();
mySerial.println(“AT+CGATT?”);
delay(500);
ShowSerialData();
mySerial.println(“AT+SAPBR=3,1,“Contype”,“GPRS””);
delay(500);
ShowSerialData();
mySerial.print(“AT+SAPBR=3,1,“APN”,”");
mySerial.print(“internet”);
mySerial.println(’"’);
delay(300);
ShowSerialData();
Serial.println(“AT+SAPBR=1,1__”);
mySerial.println(“AT+SAPBR=1,1”);
delay(1000);
ShowSerialData();
Serial.println(“AT+SAPBR=2,1__”);
mySerial.println(“AT+SAPBR=2,1”);
delay(1000);
ShowSerialData();
mySerial.println(“AT+CSQ”);
delay(500);
ShowSerialData();
mySerial.println(“AT+HTTPINIT”);
delay(500);
ShowSerialData();
mySerial.println(“AT+HTTPPARA=“CID”,1”);
delay(500);
ShowSerialData();
mySerial.print(“AT+HTTPPARA=“URL”,”");
ShowSerialData();
mySerial.print(“http://suderbobi.dk/time.php”);
mySerial.println(’"’);
delay(1000);
ShowSerialData();
mySerial.println(“AT+HTTPACTION=0”);
delay(8000);
ShowSerialData();
mySerial.println(“AT+HTTPREAD”);
delay(50);
ShowSerialData2(15000);[/code]
And the output[code]T+CREG?
+CREG: 0,1
OK
AT+CGATT?
+CGATT: 1
OK
AT+SAPBR=3,1,“Contype”,“GPRS”
OK
AT+SAPBR=3,1,“APN”,“internet”
OK
AT+SAPBR=1,1__
AT+SAPBR=1,1
OK
AT+SAPBR=2,1__
AT+SAPBR=2,1
+SAPBR: 1,1,"10.22.±·°®¶³¢ÏËAT+CSQ
+CSQ: 13,0
OK
AT+HTTPINIT
OK
AT+HTTPPARA=“CID”,1
OK
AT+HTTPPARA=“URL”,“http://suderbobi.dk/téíå®ðèð”
OK
AT+HTTPACTION=0
OK
+HTTPACTION: 0,200,383
AT+HTTPREAD
+HTTPREAD: 383
¼¡ÄÏÃÔÙÐÅ èôíì ÐÕ ¢¯¯³¯¯[/code]
[code]void ShowSerialData(){
while(mySerial.available()!=0)
Serial.write(mySerial.read());
}
void ShowSerialData2(unsigned long duration){
unsigned long startTime = millis();
while(millis() - startTime < duration){
while(mySerial.available()){
Serial.write(mySerial.read());
}
}
}[/code]
What am I doing wrong ?