Hey guys,
Just a quick question. I'm trying to interface my Arduino (Mega) and my PC with an Ethernet shield. I uploaded the following simple code in order to check everything works.
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177);
void setup()
{
Ethernet.begin(mac,ip);
}
void loop()
{}
Windows detects correctly the network. Details are joined to this post. As you can see the hardware address ("adresse physique" : AC-22-0B-02-79-B9) that is shown is not the same as the one provided in the code (DE-AD-BE-EF-FE-ED).
Is this normal ? How should I do so that the detected MAC address is the one provided ?
Regards,
AC-22-0B-02-79-B9 is apparently the MAC address of the PC, not the ethernet shield.
That MAC id registered to ASUSTek COMPUTER INC.
Oh ok I see.
That leads to another question :
Is there a way to "identify" the Arduino from the PC ? I've actually several network interfaces available, and one of it is my Arduino. I plan to have a piece of software that needs to communicate with it, and not annoying the user with connecting manually would be great. So I need the software to identify which interface is actually the Arduino.
How could I do that ? I don't need something very fancy. For example just giving a name to the interface would work. Is there a way to do it ? (currently it appears just as "ethernet" in the interfaces list).
Thanks in advance,
If they are on the same localnet, you can identify it by its IP. If not, you can send an identifier to the PC embedded in the request if HTTP or the first couple/few bytes of the packet if UDP.