Ethernet Shield mac address help

How do I find mac address for ethernet shield? - I have no stickers pasted on board. Is there a code? : ( Thanks

From one newbie to another, I believe the answer is “you just make one up” and ensure that it’s unique among the devices on your network. Weird, right? :slight_smile:

That is right. You must pick you mac, and then pass it to the ethernet library on startup.

This is an example of MAC definition:

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

Thanks ! It works :))

Are you using it as a client or server? I’m asking because I’m struggling with mine as a server and I’m trying to collect experiences from others to see if anyone is having the same type of trouble. Keep us posted!

I use the ethernet card in this project

Followup - I just learned that the Ethernet Shield has a label on the back giving each card's unique MAC address. This would be important if you're trying to contact the card of the web, rather than just on a local network.

I'm using a ENC28J60 Ethernet modules which don't come with a sticker. So it is said to be able to run on any made-up mac address which of course is not conflict with other device. But the fact is that I can't pick up my own mac address randomly or use those from other projects I came across, it is necessary to use "0x74,0x69,0x69,0x2D,0x30,0x31" which is included in the default example.

That doesn't make sense. I'm thinking something else must be going on. The MAC address for that chip is stored in a set of writeable registers, that (I would guess) get written during setup by whatever you have stored in the mac byte array.

If you're saying that you can change one byte of your mac address and the example fails, and if you change it back it passes again I'm pretty surprised. I guess there could be a bug in the Ethernet driver for that chip? Here's a forum snipped with some chat about the particular chip and how the mac address relates to it:

Hope it helps, best of luck!

Even stranger is that if I replace a different router( brand new), the previously-working sketch is no long working. Replugging it back with the old router, it worked again.Do you think it has something to do with the router itself?

thank you. the compiler accepted the "made up" mac address :)

I was testing the DHCP demo example when I encountered the same problem, where only the mac address given in the example sketch will work in my network. If I changed the last digit of the mac address from { 0x74,0x69,0x69,0x2D,0x30,0x31 } to { 0x74,0x69,0x69,0x2D,0x30,0x32 }, and re-upload the revised sketch to the Arduino, it it will fail to detect the DHCP.

I solve the problem as follows: :) 1. Remove the Arduino from my computer's USB port (running Window7), 2. Open up "Device Manager" and re-scan the COM ports, 3. Re-insert the Arduino to my USB port and upload the revised sketch to it again.

Perhaps, my router is remembering the previous mac address?

I was able to find my MAC by running "arp -a" and searching for an IP I didn't recognize. That command should work in *nix and windows.