Pages: [1]   Go Down
Author Topic: Ethernet Shield mac address help  (Read 2301 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? :-)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Code:
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks !
It works smiley)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use the ethernet card in this project
http://i-arduino.blogspot.ro/p/iarduino-tutorial.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

http://www.microchip.com/forums/m147413-print.aspx

Hope it helps, best of luck!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you. the compiler accepted the "made up" mac address  smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: smiley
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?
Logged

Pages: [1]   Go Up
Jump to: