# Ethernet shield. Assistance needed!

**URL:** <https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577>\
**Category:** Networking, Protocols, and Devices\
**Created:** [January 16, 2014, 2:48am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577 "2014-01-16T02:48:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goldfile](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/goldfile/32/217187_2.png) [@Goldfile](https://forum.arduino.cc/u/Goldfile)\
**Post date:** [January 16, 2014, 2:48am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/1 "2014-01-16T02:48:45Z")

</div>

Hello!

I have just received the ethernet shield today, but I can't figure out how to give it a MAC address.  
There was also no sticker with the MAC address on it either.  
Since I have never worked with MAC addresses before, I just need a hand.  
I have tried to follow this tutorial right here:

> **[Arduino Ethernet Shield Tutorial](https://www.instructables.com/Arduino-Ethernet-Shield-Tutorial/)**
>
> Arduino Ethernet Shield Tutorial: The Arduino Ethernet Shield allows you to easily connect your Arduino to the internet. This shield enables your Arduino to send and receive data from anywhere in the world with an internet connection. You can use it...

And I got stuck on step 3.  
(when I try to put in a MAC address, it gives me the yellow error code line at the mac address) ( Please find picture attached)

Thank in advance!

Kind regards,  
-Goldfile

---

<div class="post-metadata">

**Author:** ![Magicj](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Magicj](https://forum.arduino.cc/u/Magicj)\
**Post date:** [January 16, 2014, 4:31am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/2 "2014-01-16T04:31:51Z")

</div>

What MAC address are you using?

Can you attach a copy of your sketch and the error received?

---

<div class="post-metadata">

**Author:** ![zoomkat](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zoomkat/32/1190177_2.png) [@zoomkat](https://forum.arduino.cc/u/zoomkat)\
**Post date:** [January 16, 2014, 5:21am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/3 "2014-01-16T05:21:27Z")

</div>

Client code with an assigned mac address. You chose the address and put it in the appropriate format.

```cpp
//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

}

```

---

<div class="post-metadata">

**Author:** ![Goldfile](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/goldfile/32/217187_2.png) [@Goldfile](https://forum.arduino.cc/u/Goldfile)\
**Post date:** [January 17, 2014, 1:15am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/4 "2014-01-17T01:15:50Z")

</div>

Hello!  
Thanks for your reply!  
but, I don't know how to make a MAC address, I have no experience in it what so ever.  
I have tried different MAC address generators, to see if I could get a unique one, and one that actually works.  
In a tutorial I read a couple of days ago, it said that you could put in a random MAC address in the right format, and it should work. Could anyone give me a random (of the top of your head) MAC address that I can use?  
Thanks lots !

Kind regards,  
-Goldfile

---

<div class="post-metadata">

**Author:** ![SurferTim](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/surfertim/32/1072341_2.png) [@SurferTim](https://forum.arduino.cc/u/SurferTim)\
**Post date:** [January 17, 2014, 5:12am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/5 "2014-01-17T05:12:40Z")

</div>

> Goldfile:  
> Could anyone give me a random (of the top of your head) MAC address that I can use?

Use the mac address in zoomkat's code above. It only has to be unique to your localnet. Or increment it by one if you feel you must have it absolutely unique. Your choices are hexadecimal (0-9 and A-F).

```arduino
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };

```

---

<div class="post-metadata">

**Author:** ![JimboZA](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jimboza/32/215171_2.png) [@JimboZA](https://forum.arduino.cc/u/JimboZA)\
**Post date:** [January 17, 2014, 5:17am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/6 "2014-01-17T05:17:43Z")

</div>

Seems DEAD BEEF FEED is the world's most popular MAC.... easy to remember 8)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 10:46am UTC](https://forum.arduino.cc/t/ethernet-shield-assistance-needed/205577/7 "2021-05-06T10:46:28Z")

</div>


