Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

djr1965's Content

There have been 1 items by djr1965 (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#64860 Introducing Netduino 3 Ethernet

Posted by djr1965 on 05 February 2016 - 07:39 PM in Netduino 3

Hi Chris,

 

I recently purchased a Netduino 3 Ethernet running the latest MF 4.3 firmware update.

 

In the past I've been setting the static IP address for my Netduino Plus 2 using .NET MF 4.2 as listed below:

 

public static void Main()
        {
            //Set the Neduino Plus 2 Static IP
            NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("172.24.16.98", "255.255.255.0", "172.24.16.1");
            string localip = NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress;
            Debug.Print("The local IP address of your Netduino Plus 2 is " + localip);
            
            // Create and initialize the program instance
            Program Initiate = new Program();
 
            Initiate.InitTimers();
 
            //Thread.Sleep is necessary to keep the program running
            Thread.Sleep(Timeout.Infinite);
 
        }
 
I created a test program for my Netduino 3 Ethernet with the same NetworkInterface information.
 
When I deploy and debug the application I get the error "An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll" at the line of code NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("172.24.16.98", "255.255.255.0", "172.24.16.1");
 
I've referenced SecretLabs.NETMF.Hardware.Netduino for the device. Static IP is also enabled with MFDeploy.
 
Is there another networking related reference I need to add to my application and possibly a different method for setting a static IP than above?




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.