Pages: [1]   Go Down
Author Topic: Ethernet ENC28J60 MAC Address & IP  (Read 1616 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 06, 2013, 03:27:41 am by moataz » Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4758
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).

Quote
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.
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 06, 2013, 02:33:46 pm by Erdin » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks a lot appreciate these answers a lot  smiley

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

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

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks a lot for your post smiley , 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 ??



* Untitled.png (165.11 KB, 1366x768 - viewed 193 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks a lot it works smiley-wink
Logged

Pages: [1]   Go Up
Jump to: