Pages: [1]   Go Down
Author Topic: ethernet and lighttpd  (Read 485 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found the cause of the problem with lighttpd:
client.println("string") uses print to send the string in on packet, then \r in a second packet and \n in a thirth packet. And obviously ligttpd doesn't like that. If you use print("string\r\n"), lighttpd responses correctly. The last string in the message should end with double \r\n! Moreover, the communication is far more efficient: only 1 packet instead of 3!
Still better is to combine all strings in the message:

print("GET / HTTP/1.0\r\nHost: www.example.com\r\nUser-Agent: Arduino Ethernet\r\n\r\n");
This uses only 1 packet for the complete message.
Logged

Pages: [1]   Go Up
Jump to: