Arduino Web Client ( server ip??)

how i assign the server ip address?? , i am using WAMP server (localhost 127.0.0.1)
can anyone help my to understand this ?
Thanks in advance :slight_smile:

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 42, 42 };
byte server[] = { 192, 168, 42, 1 };// i am asking for this IP ??

Client client(server, 80);

void setup() {
Ethernet.begin(mac, ip);
Serial.begin(9600);

delay(1000);
Serial.println("connecting...");

if (client.connect()) {
Serial.println("connected");
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
else {
Serial.println("connection failed");
}
}

void loop() {
if (client.available()) {
char c = client.read();
Serial.print(c);
}

if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;:wink:
;
}
}

Please use code tag, which make every one's eye happy.

//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
//char server[] = "www.google.com";    // name address for Google (using DNS)
IPAddress server(192,168,42,2); 

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192,168,42,177);

"192.168.42.2" or something like that is your web server ip address. "127.0.0.1" - Localhost IP Address is Arduino itself localhost address. Most case "192.168.42.1" is router ip address.

What is the actual ip assigned to the WAMP server interface?

Is it connecting and not working, or not connecting? The most common problem with this setup is the Windows firewall. Insure you allow port 80 through the firewall on the WAMP server.

Find out actual ip assigned to the WAMP server interface, at WAMP server command prompt type "ipconfig /all", It will tell you actual ip.

Confirm Windows firewall setting is OK, disconnect Arduino, connect one laptop which use same ip address of Arduino to access WAMP server.

hello there...could you provide a process to find the ip address to use so that the arduino can connect to the wamp server in my computer...thanks

On the WAMP server, open a command prompt and type "ipconfig"