FEZ Spider with J11D - MAC address issue

Hi guys,

Maybe I overlooked some crucial information regarding the proper way to enable networking on a FEZ Spider together with the J11D Ethernet module. I was under the impression that my gadget was working fine and all, until I connected a whole bunch of them on the same LAN at the same time. Much to my surprise every single one of them was getting the SAME IP ADDRESS from the router (I’m using DHCP). Upon closer inspection, I noticed that all devices were reporting the same MAC address to the router – therefore, the same IP address was being given back to all the devices.

For all I know, every Spider should have its own unique (factory assigned) MAC address, isn’t that so? At least that’s what the sticker on the back of the board suggests. But that’s not what’s happening – they’re all reporting the same address to the router: 00-21-03-00-00-01

This got me quite puzzled and I hope someone can help me with this.

use fezconfig to assign the MAC address that is on the label to each device. they all come from the factory with the same default address. upgrading the firmware changes the MAC address back to the default.

Thanks, Mike. You saved the day! It’s my first project using networking, so I guess bumps like these are somewhat expected, albeit, in my defense, I must say that I never saw this being recommended on any of the available documentation.

I also thought that for EMX the MAC address is “burned” into the network chip.

Well, the source is directly in my head. And it’s not an rumor, just what I thought.

G120 (and most G400) does not have built in Ethernet. You have to use ENC28 or WiFi.
The ENC28 module does not even has a MAC address printed on the module.

So in fact, it’s exactly the same with the only difference you have to “create” your own MAC Address.

My guess was that on EMX, the MAC Address is not stored in EMX Flash, but in the Network Chip, and that the EMX Firmware would read it from the chip on startup.
But that seams just to be a silicon dream.
But since we never use DHCP for the devices, and so far there was only one device per network, we never had any issues because of MAC Address.

For ENC28 I added some code to my network initializer that generates a MAC address by an seed based on an ID from SD card, that normally is unique.

With this knowledge, I’ll add this code to built in ethernet and WiFi too, ignoring the printed MAX Address.

I was hoping to use a hash of the MAC address as a key for each of my devices so that the web server can tailor its reply to each client. Not having a unique MAC address for each ethernet module certainly scuppers that plan :frowning:

Have a look at this:
https://www.ghielectronics.com/community/codeshare/entry/756
This would allow you to write a unique number on each SoM, without the need to rewrite it after every FW update.

Each network interface must have a unique MAC address. If not provided with the interface, there are sites on the internet that will generate MAC address for you.

for example: MAC Address Generator