Netduino home hardware projects downloads community

Jump to content

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

Change Static IP from code

  • Please log in to reply
3 replies to this topic

#1 FelixEmman



  • Members
  • PipPip
  • 25 posts

Posted 03 February 2011 - 07:21 PM

While still waiting for my NPlus to arrive, I was wondering if I will be able to set it up to use static IP addresses, but be able to change it according to what the user wants. So for example, i would store a config file on the SD card, which would hold IP address, MAC, gateway, subnet and things like that. Upon start up I would read the config file and set all these settings accordingly. I was looking through topics and its not really apparent what the options are as far as connecting/disconnecting, DHCP/static. Could someone with more knowledge shed some light here... Thanks

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 February 2011 - 07:30 PM

Hi Felix, Yes, yes, and yes :) Here are all the options: http://msdn.microsof...y/ee435204.aspx You'll be able to switch between DHCP and Static IP on the fly, read/write your IP settings, etc. Your settings are automatically saved on the Netduino Plus's microcontroller...but you can change them at any time. Quick tips: 1. Be sure to update your Netduino Plus to v4.1.0.6 (or to one of the v4.1.1 betas) for best DHCP reliability. 2. Since setting the network settings saves them in Flash on the microcontroller, best practice is to only write to those settings if they have changed (i.e. after reading them). Flash has 10,000+ cycles, but they will wear out eventually if written to constantly. Chris

#3 FelixEmman



  • Members
  • PipPip
  • 25 posts

Posted 03 February 2011 - 07:54 PM

Awesome, just what I needed! Thanks for the quick reply!

#4 Illishar


    Advanced Member

  • Members
  • PipPipPip
  • 146 posts

Posted 04 February 2011 - 08:29 AM

Reminds me of the "Option 3" issue... It would be nice if the upcomming Netduino netmf source were compileable with gcc 4.4. It would be easy to make a fix then.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.