Chat freely about anything...

User avatar
By rant
#8330 I am trying to connect to a simple website and get an html respond . i have tried many websites, all same results .
I have connection, i am sending the request and get the "ok send" . everything works great, expect that i dont get any respond .

I would like to get an html respond from any website to check the module ,but no respond from anyone .

This is the arduino code :


Code: Select all //TCP

 #define DST_IP "www.bbc.com" 

  String cmd = "AT+CIPSTART=4,\"TCP\",\"";
  cmd += DST_IP;
  cmd += "\",80";
  Serial.println(cmd);
  if(Serial.find("Error"))
    return;
 
//  delay(5000);
//  if(!Serial.find("OK"))
 //   return;
   
   
    //WORD LENGH
    cmd="GET /www.bbc.com";
    String cipsendcmd = "AT+CIPSEND=4,";
    cipsendcmd += (cmd.length());
    cipsendcmd += "\r\n";
    Serial.print(cipsendcmd);
 
 
  //WAIT FOR LINE
  delay(3000);
  if(!Serial.find(">"))
  {
   Serial.println("AT+CIPCLOSE");
   Serial.println("connect timeout");
   delay(1000);
   return;
 }

  //SEND REQUEST
 Serial.print(cmd);
 delay(2000);
 
 //SEND OK
  if(!Serial.find("SEND OK"))
  {
       Serial.println("havnt sent");
       delay(1000);
       return;
  }
 
 //READ RESPOND
 String content="";
 char character;

  while(Serial.available())
      {
       
      character = Serial.read();
      content.concat(character);
         delay(10);
       
        }

  Serial.println(content);
  Serial.println("======");

  delay(1000);




This is the monitor respond :


Code: Select allAT+CIPSTART=4,"TCP","www.bbc.com",80
AT+CIPSEND=4,16
GET /www.bbc.com

======



Which means that i dont get any respond after the request, but a blank one (you can see spaces here )

Why is that , and how can i get any respond from any website ?
User avatar
By flagtrax
#8352 Hello, I am new to the 8266 wifi modules as well. I found a great deal of information from a website by Phillip J Lindsey called rancidbacon(dot)com. I think you'll find what you need by goggling "rancidbacon 8266". You will see a PDF start up guide. Hope that helps.
User avatar
By rant
#8390 Thanks a lot both .

I have tried what you said :

Code: Select allAT+CIPSTART=4,"TCP","www.bbc.com",80
AT+CIPSEND=4,38
GET / HTTP/1.1
 HOST: www.bbc.com



And i got this :

Code: Select all+IPD,4,1352:HThis._store=new window.window.bbc.Mandolin.Storage(CA_staepETtt=dtamDLg;Tnf .TsRR;g(unnppi.hnfdg (A easfrtanbywr : r(!e.p1n"ARbn".>Tn(A m a)ssg&g=Twrd:d tn}it;d.est
3mdeitwiE<n.s=heei;nisesg.}ishest.lton.,nw...tn mca,vhrstt.nttes}iexah.(Iertt.et.eir(uta( rprLOoy{e=&xnrxe[wiad(ei i)bnpcmamls.otro{tdesoc} oK



What does it means ,and why i dont get the home page html ?