harlequin-tech / WiFlyHQ

WiFly RN-XV Arduino Library
Other
110 stars 68 forks source link

Problem pulling down webpage via GET #2

Closed iball closed 12 years ago

iball commented 12 years ago

In the httpclient example I'm connecting to to my AP just fine and it's connecting to the web server fine however when it sends the get command it's getting back a 404.

Only code changes to the httpclient example were the SSID, passphrase, site name, and GET command as follows:

const char site[] = "rss.aviatorjoe.net";

wifly.println("GET /2/KQWM.rss HTTP/1.0");

Important part of the serial output follows:

404 Not Found

The server can not find the requested page:

``` 95.154.244.83/2/KQWM.rss (port 80) ```

Please forward this error screen to 95.154.244.83's WebMaster.


So it looks like it's pulling down the IP address for the DNS name and using that IP address to try to connect directly to the site however for sites that use redirects like this I don't think it's working well. I have no issues parsing this XML data using the WiFlySerial.h or WiFly.h libraries so I know it's not the website itself. Perhaps the solution is to be found in comparing your library to WiFlySerial? Or maybe it's an issue with the RN-XV not being in HTTP client mode when it's trying to pull this down?

iball commented 12 years ago

Solved it:

wifly.println("GET http://rss.aviatorjoe.net/2/KQWM.rss HTTP/1.0");

Is the correct GET command to print to the wifly after opening the site. Now it pulls down the XML just fine.