Ethernet Connection with Arduino


hello, having trouble arduino ethernet board. trying connect xampp server , trying retrieve data php file have created.

code: [select]

#include <ethernet.h>
#include <spi.h>

byte mac[] = {0x90, 0xa2, 0xda, 0x00, 0x7e, 0xae}
ipaddress server { 192, 168, 1, 223 };
ipaddress ipaddress { xxx,xxx,xxx,xxx };
ipaddress mydns {8,8,8,8};
ipaddress mygateway{192,168,1,1};
ipaddress mysubnet{255,255,255,0};

ethernetclient client;

void setup()
{
serial.begin(9600);
ethernet.begin(mac, ipaddress, mydns, mygateway, mysubnet);

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

if(client.connect(server, 80))
{
    serial.println("connected");
    client.println("get /localhost/xampp/rec.php?name=mahmoud http/1.1");
}
else
    serial.println("not connected");

if(client.avialable())
{
    serial.println("client connected");
}
else
    serial.println("not connected");

}

void loop()
{

}

now when run code on serial monitor not connected, need know why arduino doesn't connect xampp server. running windows server 2003. thank you

is ip address correct? given fact you've redacted it, assume isn't 192 series address , rather looks though should be.


Arduino Forum > Using Arduino > Programming Questions > Ethernet Connection with Arduino


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62