GAAAAAHGHHAAARRR!! What is the correct format for the mac address?

As noted in the subject field, GAAAAAHGHHAAARRR!! Couldn't find answer anywhere. I have found the mac address on the back of my ethernet shield, and now I want to put it in the sample Web Client sketch to see if I have hooked up my lcd to the shield, thence to the Duemilanove, but I am not sure I have the format right.

Let us say the mac address is 90 A2 EA 01 97 10 (I am assuming those 0s are zeros and not Os, but who knows).

The dummy mac address in the sketch reads 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

So what do I put, exactly, in the sketch?

Sorry am 'tarded! Many thanks!

Perfectly reasonably question, I didn't find it explained anywhere either. The MAC address on the sticker on the back of the shield will work. Yes, those are zeroes. It's hexadecimal, so it'll be 0-9 and A-F.

I've experimented some, the MAC address is software configured like the IP address, I think pretty much anything will work. However, you wouldn't want to duplicate a MAC already on your network. I haven't tried the default in the sample code (DEAD BEEF FEED, someone has a sense of humor) but I assume it will work.

My interpretation is if you're behind a firewall, you can use a "locally administered" address denoted by setting bit 2 of the most significant byte, and the rest can be anything you want. That's what I'm currently doing, actually I'm using 02:00:00:00:00:00. See http://en.wikipedia.org/wiki/MAC_address for more details.

So what's the sticker for? I guess it's just a recommendation. If my device were on the public network, I might use it then. Using your example MAC address, code it as follows. No "ohs", just zeroes :)byte mac[] = {0x90, 0xA2, 0xEA, 0x01, 0x97, 0x10};

I see, so I keep the 0xs and replace the other parts. Sweet. Thank you. Incidentally the dummy code, DEAD BE EF FEED, is a lament for the old ef-feed motor invented by Nicola Tesla (countryman of Arduino) but sabotaged by Edison.

So what's the sticker for? I guess it's just a recommendation. If my device were on the public network, I might use it then. Using your example MAC address, code it as follows. No "ohs", just zeroes

It'd not a recommendation. That is a unique address. If everyone starts using the same MAC address yes we can expect "collisions" out there. Use your own MAC address that came with your board.

I think the MAC address only has to be unique on a subnet, after that packets are sent by routers by IP address. However I think you are asking for trouble if you write sketches which are uploaded to multiple devices, which may possibly be on the same subnet, and all have the same MAC address.

Probably a moderately reasonable approach would be to store the MAC address in the EEPROM (assuming you upload the same sketch to different devices, it will be a pain to modify the sketch all the time). If the MAC address is uninitialized (0xFF 0xFF … I think) then you could randomly generate one based on the time of day or something which probably would not clash with other ones.

My interpretation is if you’re behind a firewall, you can use a “locally administered” address denoted by setting bit 2 of the most significant byte, and the rest can be anything you want. That’s what I’m currently doing, actually I’m using 02:00:00:00:00:00.

Yes, but only use that particular address on one device. After that you need to generate random numbers. Within the subnet the MAC address is how you tell one device from another.

thighmister: I see, so I keep the 0xs and replace the other parts. Sweet. Thank you. Incidentally the dummy code, DEAD BE EF FEED, is a lament for the old ef-feed motor invented by Nicola Tesla (countryman of Arduino) but sabotaged by Edison.

First, it's Nikola... Second, as you may start to wonder, he wasn't Italian. He was from Serbia, although, had he been born there today, he'd be Croatian.

Are Arduinos made in the Balcans??

I want to give you a direct answer to this problem since I noticed the folks above didn’t.

If the sticker says “90 A2 EA 01 97 10”

Then you would put the line:

byte mac = {0x90, 0xA2, 0xEA, 0x01, 0x97, 0x10};

in your code. I bet you knew that and were just confused by various things going on at the time.

good luck (and yes, all the round things are zeros)