Ethernet ENC28J60 MAC Address & IP

please anyone can help me to find out the mac address for my ethernet enc28j6o or how to find it and its IP address ??

and how can i use it for make a hello world page ??

thanks in advance.

You have to specify the MAC address in your sketch, the module doesn't have a fixed one. The IP address is either also fixed in the sketch or provided by a DHCP server on your network (usually in the router).

and how can i use it for make a hello world page ??

By using any of the available libraries for this chip and use the provided examples.

I suggest the Ethercard library, https://github.com/jcw/ethercard

The rbbb server is a webserver, https://github.com/jcw/ethercard/blob/master/examples/rbbb_server/rbbb_server.ino

You can set the IP yourself (static IP), but the Ethercard library has also DHCP (to let the router give the IP for the Arduino board).

Guess what ? The ENC28J60 does not have a mac, you set the mac yourself.

thanks a lot appreciate these answers a lot :)

But how to specify the MAC address in the sketch ??

and how enable the router to make an IP address for my arduino ?

If you look at the "rbbb_server.ino" file in the link in my previous post, you see that the mac (variable 'mymac') is set to a certain value. You can use any value you like.

Almost every router will be a DHCP server, to assign new IP address to devices that request it. You don't have to do something, it should be enabled in the default settings.

In Windows you can set the ip to a static value (somewhere in the network settings for IPv4) but it is almost always set to 'automatic'. That is DHCP. So you use DHCP every time you turn on the PC.

This example of the Ethercard library, https://github.com/jcw/ethercard/blob/master/examples/testDHCP/testDHCP.ino shows how to get an IP from the router. The sketch prints its own IP (it was given by the router DHCP service) to the serial monitor.

I combined both example sketches (some time ago) for a webserver with DHCP and it works.

thanks a lot for your post :slight_smile: , but i tried https://github.com/jcw/ethercard/blob/master/examples/testDHCP/testDHCP.ino

and that what appeared in the attachment
what is the problem ??

thanks a lot it works ;)

hi ,when i upload testDHCP example on arduino ,it shows in serial monitor the below text ,where is the problem???? [testDHCP] MAC: 74:69:69:2D:30:31 Setting up DHCP DHCP failed My IP: 0.0.0.0 Netmask: 0.0.0.0 GW IP: 0.0.0.0 DNS IP: 0.0.0.0