Assigning Spinneret MAC addresses
Phil Pilgrim (PhiPi)
Posts: 23,514
When I programmed my first Spinneret, I used the MAC address that Beau provided in his SimpleServer example. When I got the second one, I knew it needed a different MAC address, so I just added one to the first one. Now I assume, if the Spinneret is not visible outside my local network (except via NAT), that it doesn't really matter what MAC address is used, so long as each MAC on the local network is unique. Right? Or is there more to it than that?
-Phil
-Phil
Comments
I don't know how they are determined.
Anyway, as long as they are distinct I think you can get away with anything within your own network.
Oh. You're right. My first one was an early proto and did not have that sticker. So I never looked for it on the new one. That being the case, why does the W5100 initAddresses method require one to specify a MAC address if one is already hardwired in? And what does it really change, in that case?
-Phil
You can plug any MAC address into your device you want as long as you keep track on your physical segment and don't duplicate MAC addresses....but it's easier to use your assigned addresses.... much less chance of conflict.
Hope this helps.
Rick
The MAC address is not hardwired in the W5100 chip. You need to write it to the W5100 in the init phase of the program. They just provide you a personal worldwide unique address on the sticker.
Andy
... No wonder I keep seeing everything your testing ... I got so many partial strip charts, it's not even funny .... j/k
Ok, yeah, use the MAC address labeled on the bottom of your spinneret ... if you have an older version that doesn't have a MAC label, I would 'borrow' one from an old PC that has been retired (...or just an old Ethernet card I don't plan on using anytime soon. Personally I have a few lying around.)
When you assign your Spinneret an IP and/or MAC, you MAY need to flush your ARP cache **especially when changing its MAC**. Here is a great way to check:
Run this command from command prompt without quotes "arp -a xxx.xxx.xxx.xxx" where x = Spinneret IP and please make absolutely sure that the same MAC you assign to your Spinneret is displayed in the output of the arp -a command. That should mean at least your workstation can talk to the Spinneret, that's all it means since you're running the command from the workstation.
There are many different devices on a network that utilize ARP cache. Most router/switches just need to be powered off to flush it. Computers, operating systems, other network devices just google how to clear their ARP cache. IF you do not see a MAC associated with the IP, you may experience comm failure.
PLEASE just reboot everything on your network every time you make changes to the Spinneret, you have to make sure those changes propagate on the network.
Here is the working output from mine-
\Users\xanadu>arp -a 192.168.3.33
Interface: 192.168.3.148 --- 0x8
Internet Address Physical Address Type
192.168.3.33 00-08-dc-16-ef-81 dynamic
It would be nice if WIZNet assigned the MAC. It could be that WIZNet expected the OEM to handle the MAC.
MAC addresses are assigned by hardware manufacturers.
This gives me a total of 16 million possible MACs, so even with dozens of WIZ modules on a LAN there is a very low probability of duplication. It's also automatic in that whenever I use a new eeprom, it gets a mac assigned at the first bootup.
You'll have a stale ARP cache if you use dynamic MAC addressing without using an ARP look-up to assign it. That applies to any layer 2 device.
On subsequent bootups the code sees that a valid mac address already exists and leaves it alone. It's only the 1st time the program runs with a blank eeprom that a mac address is created. I guess it's a bit confusing as I posted it since I didn't show that, prior to the code segment shown, the mac address is read from the eeprom into the MAC array.