Main Site Documentation

Use new DHCP Functionality


#1

Hi All,

I just can’t get DHCP to run, I get the following error:

Code is as follows:

  
using System;
using System.Text;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using GHIElectronics.NETMF.FEZ;

using GHIElectronics.NETMF.Net;
using GHIElectronics.NETMF.Net.Sockets;
using GHIElectronics.NETMF.Net.NetworkInformation;

using Socket = GHIElectronics.NETMF.Net.Sockets.Socket;

public static class MySocketServer
{
    public static void Main()
    {
    
        byte[] mac = { 222, 173, 190, 239, 254, 237 };

        WIZnet_W5100.Enable(SPI.SPI_module.SPI1,
                            (Cpu.Pin)FEZ_Pin.Digital.Di10,
                            (Cpu.Pin)FEZ_Pin.Digital.Di9, true);

        NetworkInterface.EnableDhcp(mac, "domino");

Anyone got an idea?

Best regards,
Jeroen


#2

It tells you to use new Dhcp class instead of NetworkInterface class

http://www.ghielectronics.com/beta_01979/Library%20Documentation/html/19c17dc5-e9ce-6497-425a-f330f7ffc1fe.htm


#3

Thank you! It’s working now ;D


#4

Did you get to the bottom of it? There is nothing in beta docs about not using NetworkInterface. Just curious.


#5

The unused DHCP methods in NetworkInterface are going to be removed, in the next release.


#6

Thanks Joe! Good to know.


#7

Just curious,
Does the new dhcp functionality retrieves/updates the dns server information as well as the ip address/mask/gateway ?


#8

[quote]Does the new dhcp functionality retrieves/updates the dns server information as well as the ip address/mask/gateway ?
[/quote]
Yes it does that.