Loading web pages with the Arduino/WiFly

Hello all,

Has anyone been able to load a web page with the Arduino/WiFly? I’m able to connect to my wireless network, ping and so on. However after I use the “open http://www.google.com 80” it connects, but the GET request gets lost. Here’s a code snippet, would anyone mind taking a look and see what I may be doing wrong?

Thanks is advance

    Serial.println("Associated!");
    Serial.println("Trying to open webpage.");
    SPI_Uart_println("open www.google.com 80");
    //Flush_RX();
    delay(3000);
    Serial.println("Sending GET request.");
    SPI_Uart_println("GET / HTTP/1.1 ");
    SPI_Uart_println("host: www.google.com");
    SPI_Uart_println("\n\r");
    //Flush_RX();
    time = millis();
    while (millis() - time < 8000)
    {
       if((SPI_Uart_ReadByte(LSR) & 0x01))
      {
        incoming_data = SPI_Uart_ReadByte(RHR);
        Serial.print(incoming_data,BYTE);
      } 
    }
    Serial.println("Closing.");
    SPI_Uart_print("$$");
    SPI_Uart_println("close");
    Flush_RX();

Hi,

Thanks for your question.

Have you considered using the [WiFly Shield library that was released recently? It’s designed to save you a lot of hassle. :slight_smile:

There is an included example “WiFly_WebClient” that shows how to retrieve a web page.

–Philip;](WiFly Shield code library alpha 0 release (also SPI UART) - SparkFun Electronics Forum)