[Lab] Arduino Eithernet shield help
Andrew O'Malley
aomalley at gmail.com
Tue Feb 1 14:18:03 EST 2011
Will,
Yeah, that was the problem, that host line in the get request.
First time I've had to explicitly form a GET request, having
previously used libraries where it was hidden away in a function.
Thanks again, you helped me finish my piece for this show:
http://www.facebook.com/#!/event.php?eid=122375724497443
I made a light sculpture that takes an analysis of the Parliament Hill
cam and displays the spectrum of the sky.
Cheers,
ao.
On Sat, Jan 29, 2011 at 9:48 AM, Will Harding <harding.will at gmail.com> wrote:
> Hi Andrew,
>
> My guess would be that because your server error is returning "(none)"
> before the path that you requested, you may have your server setup to
> only respond to certain host names. Try adding the "Host" header to
> the request:
>
> client.println("GET /ctrm/bf_last_tweet.txt HTTP/1.0");
> client.println("Host: andrews-server.com");
> client.println();
>
> Another option would be to put the fully qualified URL into the get line:
>
> client.println("GET http://andrews-server.com/ctrm/bf_last_tweet.txt
> HTTP/1.0");
> client.println();
>
> but it would go with the Host header, since its mandatory in HTTP/1.1+
> anyway. Let me know if that works, or at least gets you a different
> error that might be more helpful.
>
> --wnh
>
> PS. If it keeps up you can always fire me some server logs and I can
> have a look.
>
>
>
> On Fri, Jan 28, 2011 at 6:46 PM, Andrew O'Malley <aomalley at gmail.com> wrote:
>> Hi gang,
>>
>> Was wondering if anyone out there has any experience w/ the Arduino
>> Eithernet shield? This is my first time using it, and I'm not having
>> any luck w/ GET requests.
>>
>> I'm adapting the WebClient sketch from the Arduino (0021) examples,
>> and I am able to connect to my server via port 80, but I cannot
>> succeed in my GET request.
>>
>> These are the two lines which I think are giving me problems:
>>
>> client.println("GET /ctrm/bf_last_tweet.txt HTTP/1.0");
>> client.println();
>>
>> The response from my server is this:
>>
>> <h1>404 Not Found</h1>
>> <p>The server can not find the requested page:</p>
>> <blockquote>
>> (none)/ctrm/bf_last_tweet.txt (port 80)
>> </blockquote>
>>
>> So I'm wondering if I'm screwing something up w/ slashes, hard
>> returns, etc., or maybe I should use a different port altogether? I've
>> verified that the file/path is correct, and tried w/ other pages but
>> just can't get any GET requests to return anything. It does not work
>> w/ the default example to Google, either.
>>
>> Any suggestions would be greatly appreciated.
>>
>> Cheers,
>> ao.
>>
>> _______________________________________________
>> Lab mailing list
>> Lab at artengine.ca
>> http://artengine.ca/mailman/listinfo/lab
>>
>
More information about the Lab
mailing list