Go Down

Topic: MAC Address (Read 572 times) previous topic - next topic

108buzz

How can I find the MAC address of an Ethernet shield?

PaulS

Quote
How can I find the MAC address of an Ethernet shield?

Look on the sticker attached to it. Or, make one up.
The art of getting good answers lies in asking good questions.

zoomkat

With the w5100 based Ethernet shield, the below is commonly used.

Code: [Select]
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

mgth

I use to do :
   for (byte i = 0; i < 6; i++){ mac = (i ) ? random(256) : ((random(256) & B11111110) | B00000010); }
may not be politically correct, but it works : the probability of duplicates is so small that it will never append.
after what, I store it in eeprom, to reuse the same after reboot.
the big advantage is you can use the same sketch with several devices without the need to take care of mac address.

ap431

I have been trying to complete the tutorial found at the below link but I keep getting stuck at this step "Finally, set your Mac address and IP address as normal with this shield."

I have been searching the internet trying to figure out how to determine what IP and MAC address they are talking about and how to find that.

The Ardunio site says that "Newer Arduino Ethernet Shields include a sticker with the device's MAC address. "

My Shield has the following numbers on it's sticker "90-A2-DA-0E-FE-16" problem is this looks nothing like what the program is asking for. The tutorial example looks like
Code:
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
static byte myip[] = { 192,168,1,203 };
So at this point the problem is:

1. What MAC and IP are they asking for?
2. How do I locate them and include them in the code using number on sticker which came on ethernet sheild box please?

I am trying to display Temp/humidity using Arduino on web server using Ethernet Sheild !
please someone can help me.
Thank you

mgth

mac is just an array of six bytes so :
byte mac[] = {  0x90, 0xA2, 0xDA, 0x0E, 0xFE, 0x16 }; but this is not mandatory, almost anything will work. This just has to have no duplicate on the local network, that's why you got an unique address on the package.

For the IP, this referer to a free address on your local network, (DHCP might not be an option, it's usually simpler to use a static IP for http servers.)
you will be able to see your web page at http://192.168.1.203 in you browser if you use the IP in the example you gave.

Go Up