Hello,
maybe this question is a little bit stupid but i am not yet very familiar
with arduinio and the language.
i am trying to connect my arduino to the internet with the official ethernet shield and i managed to set up everything based on the
http://arduino.cc/en/Tutorial/WebClient code. Now i want to get a step further and connect the arduino to my own webserver which does not have an unique ip adress (shared hosting). Therefore i need to use the domain name but i was not able to modifiy the webclient code to get this working. may anybody help me with this?
thanks a lot
tm
p.s: this ist the code which is working and almost exactly the one from the webclient example
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,0,0,77 };
byte server[] = { 173,194,33,104 }; // Google
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);
void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=test HTTP/1.0");
client.println();
}
else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
for(;;)
;
}
}