Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: wallabybob on January 28, 2010, 12:37:47 am

Title: MAC address
Post by: wallabybob on January 28, 2010, 12:37:47 am
How is the MAC address of a web platform derived?

Since it seems it does not have a "guaranteed unique" MAC address it would appear that at most one web platform can be connected to a LAN.

So, I'd second Scorpia's request in http://whereisian.com/forum/index.php?topic=190.0 (http://http://whereisian.com/forum/index.php?topic=190.0)
Title: Re: MAC address
Post by: Scorpia on January 28, 2010, 04:41:01 am
from what i understand the software sets the mac address.

So if you wanted to run 2 of these on the same network at the same time you might need a custom compile of the code with a different mac address in it.

Other than that I think the standard mac address will work fine for most people.
Title: Re: MAC address
Post by: wallabybob on January 28, 2010, 06:48:58 am
"Standard" MAC address is fine if you can also stop your mates, your kids, their mates etc putting their device on your network. It's fine if you are sure you will never want more than one on your network. (That possibly cuts out the educational market such as school labs.)

For my part, I would prefer to pay a little more to make the problem go away. The 25AA02E48 provides a globally unique MAC address for probably not much more than $0.50. (I realize end costs might be more because the PCB might need to be bigger etc.) Other microchip LAN chips also include a globally unique MAC address but at a little more expense than the 25AA02E48.
Title: Re: MAC address
Post by: ian on January 28, 2010, 07:51:53 am
It would also be possible to load the MAC from a file on the SD card, or generate one randomly. The MAC on the web platform came from a 24AA02E48.
Title: Re: MAC address
Post by: Scorpia on January 28, 2010, 10:00:21 am
Well im gonna say theres a good howto right there.

maybe something along the lines of the changes required to load from the sd card.

as for the generate randomly. i dont think that would normally be a good idea as it could grab a different dhcp address every time you reboot. so it might fill the routers dhcp table . maybe generate the first time its loaded and then save to sd card would be an idea.
Title: Re: MAC address
Post by: wallabybob on January 29, 2010, 12:34:53 am
My desire for the unique MAC address comes from a concern (based on experience) about the time it can sometimes take to track down duplicate address problems.

"Random" MAC addresses don't really solve the problem because there is still the chance of duplication. Perhaps an analysis might show that a particular algorithm or generating "random" addresses minimises the likelihood of collision with other web platforms, but that doesn't cover all the other stations on the LAN that need to have unique MAC addresses.

For some time now I've been interested in a cheap datalogger capable of logging from a number of sensors for periods of up to a few days. In Nov 2009 Silicon Chip, an electronics magazine, published plans and circuit for a "web server in a box" using a 28 pin dsPIC33. It looked close enough to what I had in mind to be useful to me BUT they had to remove DHCP client so the code would fit into the 64k available on the model they chose. The Microchip document on their TCP stack says the DHCP client takes about 1200 bytes so there would apparently be little scope for further enhancements to the Silicon Chip server. I emailed Silicon Chip a number of suggestions including that they do a respin using a PIC with larger program memory and more pins for more i/o. A few weeks later I stumbled across the Web Platform which looked to be more useful to me than the Silicon Chip design as well as being cheaper and more compact.

I think the Web Platform has great potential as a datalogger. There is a good range of cheap sensors available for temperature, light intensity, magnetic fields etc. The cheap sensors are not usually accurately calibrated so they are not useful where precision is required but they are useful for logging changes or measuring changes.

A web platform with suitable sensors could be a very useful tool in school laboratories but if they are networked they need unique MAC addresses.

A web platform with its digital outputs could be a useful appliance controller. Again, unique MAC addresses are needed to network more than one.

I noticed the Networked LED driver proposal (http://whereisian.com/forum/index.php?topic=210.0 (http://http://whereisian.com/forum/index.php?topic=210.0)) recognises the need for unique MAC addresses so more than one can be connected to a network. What's different about the Web Platform that it doesn't need a unique MAC address?
Title: Re: MAC address
Post by: Scorpia on January 29, 2010, 03:30:24 am
Keep in mind that from what i believe the code only has part of the full mac address changeable. Same as the eeprom chips address is only the random portion of the address

The code would have a Microchip assigned portion of the address as static still.

So even if the mac address was the same as another device it should only be another microchip device. SO the chances of having 2 microchip devices with the same randomly generated mac address would be very slim.

And if that did happen there would be no reason why the address couldnt be changed by hand to a known mac address.

As a last resort you could hand solder one of the mac address chips to the board and use its address. This shouldnt take to much hacking as most/all of the needed pins are allready on the current eeprom. about the only thing that might be needed is a second c/s pin.

But if there was a ver 2 of this board, yes i would like to see the eeprom chip on the board by default.
Title: Re: MAC address
Post by: ian on January 29, 2010, 08:04:36 am
Quote
I noticed the Networked LED driver proposal (http://whereisian.com/forum/index.php?topic=210.0 (http://whereisian.com/forum/index.php?topic=210.0)) recognises the need for unique MAC addresses so more than one can be connected to a network. What's different about the Web Platform that it doesn't need a unique MAC address?

I designed the project about 8 months ago, and I really wasn't thinking about unique MAC addresses at the time. Since then it's been a major request, so it'll go in my future designs. Should I do another little web dev board in the future, it will either have the MAC EEPROM, or the newer 44 pin 10/100MBPS ethernet chip with a unique MAC burned in it.
Title: Re: MAC address
Post by: colin.i on January 29, 2010, 04:59:06 pm
Where is this new 44 pin 10/100 ethernet chip?  They're all at least 64 pins :)  Trust me, I wish there was a nice 44 pin version.
Title: Re: MAC address
Post by: ian on January 29, 2010, 05:02:32 pm
ENC424J600 is 44tqfp with a unique MAC address:

http://www.microchip.com/wwwproducts/De ... e=en542414 (http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en542414)
Title: Re: MAC address
Post by: colin.i on January 29, 2010, 09:08:28 pm
Ah, I thought you meant a PIC with embedded ethernet.  My bad.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01052072432session_write_close ( )...(null):0
20.01082204008ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01082204784Database_MySQL->query( ).../DatabaseHandler.php:119
40.05402343504Database_MySQL->error( ).../Db-mysql.class.php:273