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.
Photo

Socket and DCHP


  • Please log in to reply
1 reply to this topic

#1 pxl357

pxl357

    Member

  • Members
  • PipPip
  • 18 posts

Posted 31 August 2011 - 04:31 AM

Hey Everybody , I have some issues about getting an ip for a socket server. I tried several method i'm struggling on solve this issue. After some reading i understood the best approach is to actually set a static ip for the netduino. I was wondering if anybody would be kind enough to provide me an example or a step by step explanation ? I tried by myself to set the Ip/Mac NetworkInterface networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0]; networkInterface.PhysicalAddress = new byte[] { 0x5C, 0x86, 0x4A, 0x00, 0x00, 0x00 }; networkInterface.EnableStaticIP("192.168.0.75", "255.255.255.0", "192.168.1.2"); I tried to parse an Ipad as well but nothing seems to work. Thanks ! Pxl

#2 ColinR

ColinR

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationCape Town, South Africa

Posted 31 August 2011 - 06:32 AM

NetworkInterface networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0];
//networkInterface.PhysicalAddress = new byte[] { 0x5C, 0x86, 0x4A, 0x00, 0x00, 0x00 };
networkInterface.EnableStaticIP("192.168.0.75", "255.255.255.0", "192.168.1.2");

Try that; PhysicalAddress is read only, if I'm not mistaken. The rest looks good to go - just remember not to set it on every run, rather check for differences in the value, and set if required.




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.