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

DHCP issues with Netduino Plus


  • Please log in to reply
23 replies to this topic

#1 JakeG

JakeG

    New Member

  • Members
  • Pip
  • 5 posts

Posted 09 March 2011 - 06:00 PM

I received my Netduino Plus about a month ago and have been unsuccessful in getting the Ethernet up and running. I'm hoping that I'm not doing something stupid. :)

Things I’ve tried so far:
  • Updated firmware to the latest version (4.1.1 alpha7)
  • Confirmed that I reconfigured the network settings after updating the firmware.
  • Setup an IP address reservation for the Netduino’s mac address.
  • Configured network settings with ‘0.0.0.0’ prior to enabling DHCP (using MFDeploy)
  • In the application code, set static IP address of ‘0.0.0.0’ prior to enabling DHCP
  • Plugged the netduino directly into the router to eliminate any cabling issues.
  • Tried two different routers unsuccessfully (Netgear FVS318 ProSafe VPN Firewall Router)
  • Using Wireshark, both routers appear to be communicating with the Netduino, however the IP address assigned doesn’t seem to get set.

Other points of interest:
  • When I plug the Netduino into a hub using a long (~20 ft?) Ethernet cable, I only get one light (ACT) beside the Ethernet jack which blinks on and off slowly.
  • If I eliminate the cable and hub and plug the Netduino directly into the wall I get three lights (ACT, 100, FDX).

I’ve attached two files:
  • netduinoplus-dhcp.pcap.zip = A Wireshark capture of the DHCP traffic that I can see between my Netduino and the router.
  • DhcpTest.zip = A simple Netduino application which attempts to connect via DHCP every 30 seconds and prints its network settings to Debug output.

Attached Files



#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 10 March 2011 - 10:55 AM

Perhaps a silly suggestion, but I made this mistake once with a notebook and this also resulted in only one led on my router burning. Are you using a cross cable on the netduino by any chance? Tried different (straight) cables?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 JakeG

JakeG

    New Member

  • Members
  • Pip
  • 5 posts

Posted 10 March 2011 - 02:18 PM

Perhaps a silly suggestion, but I made this mistake once with a notebook and this also resulted in only one led on my router burning.


Great point, Stefan. That may be what was going on when I was plugged into the hub (see "Other points of interest" in my original post). Also, to clarify, the three LEDs I was referring to were on the Netduino itself, just to the left of the Ethernet jack (labeled ACT, 100, FDX) - not on my router. Ever since I took the hub out of the equation, I've been consistently getting three lights on the Netduino. Can anyone confirm that this is an indication the Netduino is connected correctly?

Maybe this is a topic for another day, but I was able to plug my laptop into that same (possibly cross-over) Ethernet cable and the laptop could connect to the network without any problems.

Are you using a cross cable on the Netduino by any chance? Tried different (straight) cables?


Unfortunately (for me), I can confirm that I'm using a straight-through cable plugged directly into the back of the router. I've also used different straight-through cables and different routers.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 10 March 2011 - 02:27 PM

Maybe this is a topic for another day, but I was able to plug my laptop into that same (possibly cross-over) Ethernet cable and the laptop could connect to the network without any problems.

It can happen that devices work on both straight and cross cable, then they have Auto-MDIX as it's called. Don't know if the Netduino has that though.
But if the problem insists with different cables and routers I guess it's not that then ;)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 JakeG

JakeG

    New Member

  • Members
  • Pip
  • 5 posts

Posted 11 March 2011 - 04:51 PM

Continuing in my quest to get this working...

I'm beginning to wonder if it's not a DHCP issue but rather a general Ethernet issue. I've tried setting a static IP address and it get's set (i.e. networkInterface.IPAddress returns "192.168.192.42"), however there's no connectivity. I can't ping the device and when I setup a socket to listen on the IPAddress on the socket instance is "0.0.0.0:80".

Is there some sort of test firmware I can run on the device to ensure that this isn't hardware related?


This is the code I'm using to test connectivity with a static IP:
...
// setup static IP
NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("192.168.192.42", "255.255.255.0", "192.168.192.1");
Debug.Print(NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress); // returns "192.168.192.42"
...
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(IPAddress.Any, 80));
Debug.Print(NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress); // returns "192.168.192.42"
Debug.Print(socket.LocalEndPoint.ToString()); //returns "0.0.0.0:80"
Debug.Print(socket.Available.ToString()); //returns "0"


#6 JakeG

JakeG

    New Member

  • Members
  • Pip
  • 5 posts

Posted 12 March 2011 - 03:05 PM

Woo hoo! I was able to get my Netduino to connect using a static IP address!!

I believe the issue had to do with a combination of a bad Ethernet wall jack in my office and (possibly) some mac address strangeness on my router. I decided to change the entire IP address range on my router to see if that could be the issue... yeah, I'm trying just about anything at this point. When I applied the settings my IP reservation for the netduino disappeared, even though other reservations I have on my network remained. I re-entered the mac address and now the device can be ping'd and will serve up a "Hello World" over HTTP.

One thing to note is that...
Debug.Print(socket.LocalEndPoint.ToString());
... still returns "0.0.0.0:80". So, for future readers, I doubt this is a good indication of connectivity.

Re: DHCP -
After my success with static IP, I reattempted using DHCP. The Netduino still isn't able to connect via DHCP.

Thoughts on what to do next?

#7 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 15 March 2012 - 07:17 PM

Hi... My Netduino + arrived last week and I noticed some inconstancies with the ethernet connection. It came with firmware version 4.1.0.6. In order for it to acquire an IP address from the router I had to have the device plugged in and bounce the router. If I remove the ethernet cable and plug the device appears to loose the ability to communicate. I’m no longer able to see the device from the router or ping from a workstation unless I bounce the router again. I might be able to code around this issue but right now I’m getting familiar with how stable the device is. When I upgrade the firmware to version 4.2.0.0 RC4 the ethernet post doesn’t work at all. My thought is they disabled DHCP all together and have to manually enable it through code even though it’s an option in MFDeploy.

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 March 2012 - 08:04 PM

Hi jeffdrew, DHCP is enabled in .NET MF 4.2, although there were some bug fixes made in the NETMF core to make it work with more routers. If you select a static IP address instead, does that work? Chris

#9 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 15 March 2012 - 09:18 PM

Hi Chris, Thanks for the quick response. When firmware 4.2 RC4 installed, the only Ethernet port indication I have is ACT. I've taken the sames steps several times to isolate if it's a firmware issue between 4.1 and 4.2. May I have the wrong 4.2 firmware? I've noticed it's more difficult to upgrade the firmware to 4.2. The only reason I upgraded the firmware to 4.2 so I could write in VB but it's looking to be a pain. Firmware 4.1.0.6 works, as long as I follow a set of sequences. As soon as I remove the network connection and reconnect I'm unable to ping Netduino nor does the router see Netduino. I'm also having issues with the following code lines; what am I missing.... Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(0).EnableDhcp() Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(0).ReleaseDhcpLease() Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(0).RenewDhcpLease()

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 March 2012 - 10:20 PM

Hmm, that's not right. Did you erase your board completely when updating to 4.2...including reflashing the TinyBooterDecompressor? If you're just getting the ACT light, something is wrong indeed. Chris

#11 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 March 2012 - 03:01 PM

Hmm, that's not right. Did you erase your board completely when updating to 4.2...including reflashing the TinyBooterDecompressor?

If you're just getting the ACT light, something is wrong indeed.

Chris


Chris,

Maybe I'm not updatng the firmware to 4.2 correctly. When clicking Erase in MFDeploy "ver 4.2\tools", the only option I see is "Deployment" after 4.2 firmware upgrade. Not sure how to reflash the TinyBootDecompressor.

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 March 2012 - 06:03 PM

Hi jeffdrew,

Maybe I'm not updatng the firmware to 4.2 correctly. When clicking Erase in MFDeploy "ver 4.2\tools", the only option I see is "Deployment" after 4.2 firmware upgrade. Not sure how to reflash the TinyBootDecompressor.

To update to 4.2, you'll need to erase the Netduino Plus completely using the gold ERASE pad. Then, do this:
http://wiki.netduino...ep-by-step.ashx

Chris

#13 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 March 2012 - 07:59 PM

Hi jeffdrew,

To update to 4.2, you'll need to erase the Netduino Plus completely using the gold ERASE pad. Then, do this:
http://wiki.netduino...ep-by-step.ashx

Chris


chris,

Prior to your resonse, I found the same linq. Not sure I want to run through all this.Atmel doesn't mention Netdino plus, it's all mini. As a mid level developer I would think all firmware upgrade would include all update file to complate an update. I know that's no always true. The board shipped with firmaware 4.1.0.6.


What are the steps to totally whip aout a board and rebuild it?
I'm running windows vista.

#14 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 March 2012 - 04:49 PM

Chris, I was able to flash the Netduino Plus late last and earlier today. I have two sets of zip files for RC4, Netduino and Netduino Plus. If I flash the board using Netduino, TinyBooterDecompressor, ER_Config and ER_Flash the Ethernet port doesn’t work, I can deploy from VS .Net to the device. If I flash using the Netduino Plus files, Ethernet port works but unable to deploy from VS .Net to the device. Flashing the device, I followed theses steps. http://wiki.netduino...ep-by-step.ashx I see the device with either flash. Is there another step when flashing a Plus? May I have the wrong boot decompressor? Here’s the device list from MFDeploy: Netduino Plus HalSystemInfo.halVersion: 4.2.0.0 HalSystemInfo.halVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC HalSystemInfo.oemCode: 34 HalSystemInfo.modelCode: 177 HalSystemInfo.skuCode: 4097 HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000 HalSystemInfo.systemSerialNumber: 0000000000000000 ClrInfo.clrVersion: 4.2.0.0 ClrInfo.clrVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion: 4.2.0.0 SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC SoftwareVersion.BuildDate: Feb 2 2012 SoftwareVersion.CompilerVersion: 410713 FloatingPoint: True SourceLevelDebugging: True ThreadCreateEx: True LCD.Width: 0 LCD.Height: 0 LCD.BitsPerPixel: 0 AppDomains: True ExceptionFilters: True IncrementalDeployment: True SoftReboot: False Profiling: False ProfilingAllocations: False ProfilingCalls: False IsUnknown: False Here’s the device list from MFDeploy: Netduino HalSystemInfo.halVersion: 4.2.0.0 HalSystemInfo.halVendorInfo: Netduino (v4.2.0.0 RC4) by Secret Labs LLC HalSystemInfo.oemCode: 34 HalSystemInfo.modelCode: 177 HalSystemInfo.skuCode: 4096 HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000 HalSystemInfo.systemSerialNumber: 0000000000000000 ClrInfo.clrVersion: 4.2.0.0 ClrInfo.clrVendorInfo: Netduino (v4.2.0.0 RC4) by Secret Labs LLC ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion: 4.2.0.0 SolutionReleaseInfo.solutionVendorInfo: Netduino (v4.2.0.0 RC4) by Secret Labs LLC SoftwareVersion.BuildDate: Feb 2 2012 SoftwareVersion.CompilerVersion: 410713 FloatingPoint: True SourceLevelDebugging: True ThreadCreateEx: True LCD.Width: 0 LCD.Height: 0 LCD.BitsPerPixel: 0 AppDomains: True ExceptionFilters: True IncrementalDeployment: True SoftReboot: False Profiling: False ProfilingAllocations: False ProfilingCalls: False IsUnknown: False

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 March 2012 - 05:55 PM

Hi jeffdrew, Just to confirm... You can ping the board from MFDeploy correct? After flashing with Netduino Plus firmware, have you tried changing the deployment transport from USB to Serial and back (in your project properties, .NET Micro Framework tab)? It may be stuck trying to deploy to device "Netduino_Netduino" instead. If you can ping the board from MFDeploy, deployment from Visual Studio should work properly... Chris

#16 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 March 2012 - 06:40 PM

Chris, To clearify we're talking the same terms, Netduino and Netduino Plus are two different devices built using on the same technology. My plus board is using chipset AT91SAM7x512. After more investigation, here's what I've been able to notice between the two decompressors and flash files. The plus only has 1 deployment location while the netduino has 2. (Snap shots listed below). I'm able to do everything in MFDeploy with either flash. VS is able to recognize the divice with either flash. I get ethernet ability when using the Plus but no deployment and deployment with Netduino but no ethernet. Like to get them both working using the Plus ver 4.2 RC4. I'm tending to lean towards it has to do with the memory map, Plus not being able to deploy from VS. Hope the flash info below helps. Like to get this working. Thanks, Jeff Netduino: Flash Sector Map Command Sector Start Size Usage ----------------------------------------------- 0 0x00100000 0x0000c000 Bootstrap 1 0x0010c000 0x00012000 Code 2 0x0011e000 0x00040000 Code 3 0x0015e000 0x00004000 Deployment 4 0x00162000 0x0001c000 Deployment 5 0x0017e000 0x00002000 Configuration Flash Sector Map Complete Netduino Plus: Flash Sector Map Command Sector Start Size Usage ----------------------------------------------- 0 0x00100000 0x0000c000 Bootstrap 1 0x0010c000 0x00066000 Code 2 0x00172000 0x0000c000 Deployment 3 0x0017e000 0x00002000 Configuration Flash Sector Map Complete

#17 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 March 2012 - 07:51 PM

Hi Chris, Any update on what might be happening between the two firmware versions? Jeff

#18 Cabadam

Cabadam

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 21 March 2012 - 08:44 PM

I get ethernet ability when using the Plus but no deployment and deployment with Netduino but no ethernet. Like to get them both working using the Plus ver 4.2 RC4.


Jeff,
You mentioned that you are unable to deploy when you flash the Plus firmware. If you are unable to put your software onto the ND+ after the flash, what are you doing to say "I get ethernet ability when using the Plus"?

Also, after deploying the ND+ firmware (which you have to be using if you want the Ethernet to work), what shows up in Visual Studio in the Project Properties -> .NET Micro Framework Tab? Specifically, in the dropdown list for "Device" (toggle the "Transport" dropdown to something besides USB and then back to USB to make sure it has refreshed correctly).

#19 jeffdrew

jeffdrew

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 March 2012 - 10:15 PM

When I flash to ND+ firmware, the ethernet port on the device connects to my router and obtains an IP address. After I completed the flash, VS shows the ND+ device. I've closed VS and went as far in doing a complete reboot of my PC and ND+. The ND+ is listed, i can ping it but unable to deploy software to it. Right now I have it flashed as ND not the plus. I'll flash it again using the ND+ firmware.

#20 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 March 2012 - 12:49 AM

When I flash to ND+ firmware, the ethernet port on the device connects to my router and obtains an IP address. After I completed the flash, VS shows the ND+ device. I've closed VS and went as far in doing a complete reboot of my PC and ND+. The ND+ is listed, i can ping it but unable to deploy software to it. Right now I have it flashed as ND not the plus. I'll flash it again using the ND+ firmware.

Hi Jeff,

The most likely scenario is that Visual Studio is confused as to which board you're trying to deploy to.

In your project properties, select the .NET Micro Framework Deployment tab. Then switch from USB to Serial deployment. Save. Then switch from Serial to USB deployment. Save again, and redeploy.

Due to a bug in how the .NET Micro Framework SDK interacts with Visual Studio...sometimes the pulldown will show that it's targeting a USB device but the project files won't reflect that same target. To fix that issue, just switch the deployment target and then switch it back (as we just did) and everything should work.

Chris




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.