9 years, 9 months ago.

Ethernet Interface

if I dont't want to use DHCP ,what should I do?

Question relating to:

1 Answer

9 years, 9 months ago.

Hi zhang jun,

Once you have the Ethernet Interface library in your project, you should be able to expand the folder tree to see the classes - and by clicking on EthernetInterface in that view you can get access to the help.

There you will see:

static int 	init ()
 	Initialize the interface with DHCP. 
static int 	init (const char *ip, const char *mask, const char *gateway)
 	Initialize the interface with a static IP address. 

So, with no parameters, the init uses DHCP, but if you provide the parameters, it will attempt to init with them instead.

You might then bring your module online with:

    net.init("192.168.1.240", "255.255.255.0", "192.168.1.1");

Accepted Answer

I have already solved the problem!Thank you for your help

posted by zhang jun 04 Aug 2014