i just cant see to get the addresses sorted in able to get them running .
the mac address has me stumped . how do i convert the mac address on the back of the ethernet board ?
there appears to be 4 addresses that need to be in the right format .the arduino books dont go into detail enough for a newby
i have the arduino cookbook for guidance but no use so far
the arduino books dont go into detail enough for a newby
Why should they? Internet access is NOT a newbie project.
The MAC address sticker shows something like AB-CD-EF-01-02-03. The Mac array looks something like:
byte macAddr[6] = {0xAB, 0xCD, 0xEF, 0x01, 0x02, 0x03};
It really isn't that difficult to see how the characters on the sticker match those of the MAC address in the code.
i have the arduino cookbook for guidance but no use so far
Are you cooking your Arduino?
thanks for the smartypants reply
it is if you have never done it before ,it might as well be martian language
This is not a newbie project, but if you want to give it a try with a working example, here is my client code in the playground.
http://playground.arduino.cc/Code/WebClient
Here is my server code:
http://playground.arduino.cc/Code/WebServerST
zoomkat's code also works ok. Search this forum for his examples.
it is if you have never done it before ,it might as well be martian language
That's why Ethernet and WiFi are not beginner projects. I've you have a decent background in client/server architecture, having connected two computers together, then replacing one of them with an Arduino is very simple. If you don't, then there approximately 14 bazillion things that go wrong, and troubleshooting them will drive you nuts.
I don’t have any wifi stuff, but below is some simple client code you can try to see if it will work with your ethernet setup.
//zoomkat 9-22-12
//simple client test
//for use with IDE 1.0.1
//with DNS, DHCP, and Host
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields
//remove SD card if inserted
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;
//////////////////////
void setup(){
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
Serial.begin(9600);
Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
Serial.println("Send an e in serial monitor to test"); // what to do to test
}
void loop(){
// check for serial input
if (Serial.available() > 0) //if something in serial buffer
{
byte inChar; // sets inChar as a byte
inChar = Serial.read(); //gets byte from buffer
if(inChar == 'e') // checks to see byte is an e
{
sendGET(); // call sendGET function below when byte is an e
}
}
}
//////////////////////////
void sendGET() //client function to send/receive GET request data.
{
if (client.connect(serverName, 80)) { //starts client connection, checks for connection
Serial.println("connected");
client.println("GET /~shb/arduino.txt HTTP/1.1"); //download text
client.println("Host: web.comporium.net");
client.println("Connection: close"); //close 1.1 persistent connection
client.println(); //end of get request
}
else {
Serial.println("connection failed"); //error message if no client connect
Serial.println();
}
while(client.connected() && !client.available()) delay(1); //waits for data
while (client.connected() || client.available()) { //connected or data available
char c = client.read(); //gets byte from ethernet buffer
Serial.print(c); //prints byte to serial monitor
}
Serial.println();
Serial.println("disconnecting.");
Serial.println("==================");
Serial.println();
client.stop(); //stop client
}