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
Change Static IP from code
Started by FelixEmman, Feb 03 2011 07:21 PM
3 replies to this topic
#1
Posted 03 February 2011 - 07:21 PM
#2
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
- bgreer5050 likes this
#3
Posted 03 February 2011 - 07:54 PM
Awesome, just what I needed! Thanks for the quick reply!
#4
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