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.

DHCP issues with Netduino Plus

  • Please log in to reply
23 replies to this topic

#21 jeffdrew



  • Members
  • PipPip
  • 10 posts

Posted 22 March 2012 - 01:21 AM

Hi Chris, It took a lot but I'm finally able to deploy using firmware v4.2. Prior to getting your response, I flashed the board again and reinstalled the N usb driver. Did a reboot and could deploy using a fresh VS .Net application. I think I went through all this for nothing. The original .Net app I was workign with was a sample from the web site. If I strip out a bounch of code I'm not using I'm able to deploy. Did the deployment size get reduced from frimware 4.1.06 to 4.2 RC4? What is the deployment size for v4.2 RC4? Again, I thank you for all your time. Jeff

#22 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 March 2012 - 04:39 AM

Hi Jeff, No problem at all. We're here to help make community members successful together. RC4 has 48KB for deployment. RC5 may get an extra 8KB. If we can get it all the way up to 64KB I'll be in heaven, but it's looking like 56KB may be the upper limit. Chris

#23 AxelG


    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 17 May 2012 - 10:06 PM

Hoping to keep the discussion moving on the socket-related questions. I am new to the Netduino Plus with about 2 weeks under my belt of playing with it. A lot of my time is spent in .NET Visual Studio Emulator mode and moving to the hardware when I need to work on the hardware integration parts. I have noticed a few quirks with various differences between emulator and hardware deployed versions; this socket problem is one I am playing with and have not found a reliable workaround; yet. I reset all of my networking settings to static IP through MFDeploy.exe, and make my router aware of the NDP MAC address and reserved IP address; until I get a successful network ping on that static IP address. This sometimes takes a couple router resets to get right so Netduino responds to a ping. I am running a "tried-and-true" windows socket service on port 8484 on a completely different server. It is a basic service listening on port 8484 for a simple "HELLO" to come across the Tcp socket. The following snippet of a program works fine in emulator mode and I can connect 100% of the time. When I deploy to the hardware; no good. It sometimes connects, and generally stays connected; but when it fails to connect - forget it. It just keeps timing out. (this code is in a loop that keeps trying to connect until it does in the "real" software) I am including code and the associated debug output. Any insight on what I can try next would be helpful. Oh, I flashed to 4.1.1 from and fixed my SD card issues; but seemed to make this issue worse (but I may have just been tired and hopped up on Coke Zero...) I have not tried 4.2 yet. -->(snip)<-- public class Program { public static void Main() { int port = 8484; string server = ""; ShowNetworks(); try { Debug.Print("Defininig new socket "); Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); Debug.Print("Defininig new static endpoint and connecting to "+ server + "on port " + port.ToString()); IPHostEntry hostEntry = Dns.GetHostEntry(server); serverSocket.Connect(new IPEndPoint(hostEntry.AddressList[0], port)); Debug.Print("Sending a HELLO statemnt to the waiting service"); Byte[] bytesToSend = Encoding.UTF8.GetBytes("HELLO\n" + "12345678910\n"); serverSocket.Send(bytesToSend, bytesToSend.Length, 0); } catch (SocketException se) { Debug.Print("SocketException when connecting to " + server + "."); Debug.Print("Socket Error Code: " + se.ErrorCode.ToString()); Debug.Print(se.ToString()); } } private static void ShowNetworks() { NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { int i = 0; foreach (string s in adapter.DnsAddresses) { i++; Debug.Print("DNS Address : " + s); } if (i == 0) Debug.Print("No DNS Address"); Debug.Print("Default Gateway: " + adapter.GatewayAddress); Debug.Print("IP Address : " + adapter.IPAddress); Debug.Print("Is DHCP Enabled: " + adapter.IsDhcpEnabled); Debug.Print("Is Dynamic DNS : " + adapter.IsDynamicDnsEnabled); Debug.Print("Interface Type : " + adapter.NetworkInterfaceType.ToString()); Debug.Print("MAC Address : " + ToHexString(adapter.PhysicalAddress)); Debug.Print("SubnetMask : " + adapter.SubnetMask + "\n"); } } } -->(Debug Output)<-- No DNS Address Default Gateway: IP Address : Is DHCP Enabled: False Is Dynamic DNS : False Interface Type : 6 MAC Address : 5C-86-4A-00-4F-1D SubnetMask : Defininig new socket Defininig new static endpoint and connecting to port 8484 #### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) #### #### Message: #### Microsoft.SPOT.Net.SocketNative::connect [IP: 0000] #### #### System.Net.Sockets.Socket::Connect [IP: 001d] #### #### NetduinoPlusApplication1.Program::Main [IP: 0044] #### #### SocketException ErrorCode = 10053 #### SocketException ErrorCode = 10053 A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll #### SocketException ErrorCode = 10053 #### SocketException ErrorCode = 10053 SocketException when connecting to Socket Error Code: 10053 System.Net.Sockets.SocketException The thread '<No Name>' (0x1) has exited with code 0 (0x0). Done. Waiting for debug commands... The program '[3] Micro Framework application: Managed' has exited with code 0 (0x0).

#24 Valkyrie-MT


    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 18 May 2012 - 05:23 PM

You should consider switching to the 4.2 firmware. There have been many Network fixes since 4.1. Is this really your router address ( This is usually the default value. It can be set in MFDeploy. Also, when you run this, print out your DNS server address. DNS lookup will fail if that is not set correctly. -Valkyrie-MT

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.