FEZ Raptor ECN28 Networkng

I am not very familiar with how to read the Ethernet conversation that relates to the failure of dhcp, but here is a picture of what is happening when it fails for me as outlined above.
The request for dhcp generates a NAK from the router.

You can find the GHI Electronics’ premium extensions API listed under our webpage at Support>NETMF, links are under “Library Documentation”

On the same page you may find this useful:

[quote]New to our website?
Review our how to find information guide.[/quote]

switch


to (my mistake, see the API)
            
```vb]ethernet_ENC28.RefreshNetworkInterface()[/code


If this doesn't work, please send both the traffic screen shot as well as the debug output from the program.

I'll also consult other members of my team.

@ Jeff - thanks, now I find the reference to it at your website. However, when I enter that line, I do not see the method you described! I checked and I have a reference to GHI.Premium.Net version 4.2.11.1 which matches the documentation. What am I doing wrong?
Below is a screen grab of the options available as presented by VS, and you can see that all but the refresh method are listed.
I have unsuccessfully tried at least three different ways of finding the method and all throw an error:
:



                ethernet_ENC28.refreshnetworkinterface() ' refreshnetworkinterface is not a menber of Gadgeteer.modules.ghielectronics.ethernet_enc_28
                ethernet_ENC28.Interface.refreshnetworkinterface()  ' refreshnetworkinterface is not a member of GHI.Premium.Net.EthernetENC28J60
                GHI.Premium.Net.NetworkInterfaceExtension.refreshnetworkinterface() ' refreshnetworkinterface is not a member of GHI.Premium.net.networkinterfaceextension



Today I changed locations where I have been testing to my work facilities. I find that the DHCP will connect most of the time on this different network. Other threads have mentioned that the problem may be due to router interaction.

Additionally, the code fragment of the code earlier in this thread:

        Private Sub InternetTimer_Tick(timer As Gadgeteer.Timer) Handles InternetTimer.Tick
            Dim i As Integer = 0
            Debug.Print("tic...")
            If listening = False Then
                'iface = Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(0)

                '      ethernet_ENC28.Interface.refreshnetworkinterface()

                Debug.Print(ethernet_ENC28.Interface.NetworkInterface.IPAddress.ToString)

                If ethernet_ENC28.Interface.NetworkInterface.IPAddress = "0.0.0.0" Then
                    Debug.Print("DHCP=" & ethernet_ENC28.Interface.NetworkInterface.IsDhcpEnabled.ToString & ", but no connectionL " & ethernet_ENC28.Interface.NetworkInterface.IPAddress.ToString)
                    Exit Sub
                Else
                    Dim dnses() As String = {"8.8.4.4", "8.8.8.8"}
                    ethernet_ENC28.Interface.NetworkInterface.EnableStaticDns(dnses)
                    Debug.Print(ethernet_ENC28.Interface.NetworkInterface.IPAddress.ToString)
                End If

shows another issue. if the enable static DNS method is executed, the ipaddress will revert to 0.0.0.0, with the specified DNS selected, while if that line is commented out, the ipaddress will remain valid and DNS values are collected from the local network. This implies that there is an interaction here.

Furthermore, on this completely different development system, the method RefreshNetworkInterface also cannot be found. I cannot find any use of that method in either the forum or codeshare.

Additionally, in all cases the NetworkDown event fires, but the NetworkUP event never fires.

Perhaps importantly, the code base at work (where DHCP works) is slightly older = several assemblies are 4.2.101 while at home (where DHCP does not work) they are 4.2.102 (as is seen earlier in this thread).

Output:
Attaching deployed file.
Assembly: RaptorNetServer (1.0.0.0) Attaching deployed file.
Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.
Assembly: GTM.GHIElectronics.Ethernet_ENC28 (4.2.101.0) Attaching deployed file.
Assembly: Microsoft.VisualBasic (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.IO (4.2.11.1) Attaching deployed file.
Assembly: GTM.GHIElectronics.UsbClientDP (4.2.101.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.11.1) Attaching deployed file.
Assembly: GHIElectronics.Gadgeteer.FEZRaptor (4.2.101.0) Attaching deployed file.
Assembly: Gadgeteer.SPI (2.42.0.0) Attaching deployed file.
Assembly: GHI.Hardware.G400 (4.2.11.1) Attaching deployed file.
Assembly: GTM.Seeed.Barometer (1.6.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.Hardware (4.2.11.1) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.11.1) Resolving.

There’s really little value in doing tests on networking, in two different network locations, with two different firmware versions. Test two firmware versions in one network, and tell us the difference if any. Test two networks with the same kit and code and firmware, and tell us the difference. The way your last test panned out we have nothing “common” to know what is changing the behaviors.

@ Brett - I updated the software on my work machine and now the deployed file version match that of the original system at home. Both how have the latest NETMF and Gadgeteer package 2014 R1.
When I rerun the tests on the office machine, the results are the same.

  1. DHCP will connect
  2. Enabling static DNS will cause the IP address to reset to 0.0.0.0
  3. Network Down always fires, NEtwork UP never fires.
  4. I cannot find the method RefreshNetworkInterface - nor do I see it used in any online code in a google search.
    As far as I can tell, the only differences are the office network. The hardware boards I am using are the same in both tests.

sorry, more careful reading of the docs show that the refresh member is[em] protected[/em].

@ Jeff:
Too bad it is protected - lt looked promising, I imagine it is called by something else in that class.
So, back on my home machine. DHCP still fails (same versions as at work).

I have attached the screen grab you requested from Wireshark, and the debug output along with the output outputs below.
My home router is a Netgear WNDR3700 running the latest firmware.

Another issue has come up with this code. When running at home, static IP, I can connect from a client program running on a PC, and via TCP query the Raptor. I put this in a loop, connecting, querying, and receiving responses. After some 25,000 cycles over several hours, the Raptor will crash with the following exception:
#### Exception System.OutOfMemoryException - CLR_E_OUT_OF_MEMORY (6) ####
#### Message:
#### System.Collections.Queue::Enqueue [IP: 0000] ####
#### Microsoft.SPOT.Dispatcher::BeginInvoke [IP: 001e] ####
#### Microsoft.SPOT.DispatcherTimer::Callback [IP: 0010] ####
A first chance exception of type ‘System.OutOfMemoryException’ occurred in mscorlib.dll

Should I start a new thread to discuss this issue, or can we try to handle this here?
DEBUG OUTPUT:
Found debugger!

Create TS.

Loading start at 202ce7d4, end 202fd79c

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2
.0.0) Assembly: System.Security (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Assembly: Microsoft.SPOT.TinyCore (4.2.0.0)
Assembly: Microsoft.SPOT.IO (4.2.0.0) Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.Touch (4.2.0.0)
Assembly: Microsoft.SPOT.Ink (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)
Loading Deployment Assemblies.

Attaching deployed file.
Assembly: GTM.GHIElectronics.Display_HD44780 (4.2.102.0) Attaching deployed file.
Assembly: RaptorNetServer (1.0.0.0) Attaching deployed file.
Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.
Assembly: GTM.GHIElectronics.SDCard (4.2.102.0) Attaching deployed file.
Assembly: GTM.GHIElectronics.Ethernet_ENC28 (4.2.102.0) Attaching deployed file.
Assembly: Microsoft.VisualBasic (1.0.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.IO (4.2.11.1) Attaching deployed file.
Assembly: GTM.GHIElectronics.UsbClientDP (4.2.102.0) Attaching deployed file.
Assembly: GHI.Premium.Net (4.2.11.1) Attaching deployed file.
Assembly: GHIElectronics.Gadgeteer.FEZRaptor (4.2.102.0) Attaching deployed file.
Assembly: Gadgeteer.SPI (2.42.0.0) Attaching deployed file.
Assembly: GHI.Hardware.G400 (4.2.11.1) Attaching deployed file.
Assembly: GTM.Seeed.Barometer (1.6.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.Hardware (4.2.11.1) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.11.1) Attaching deployed file.
Assembly: GTM.GHIElectronics.LED7C (4.2.102.0) Resolving.
GC: 1msec 284604 bytes used, 66821160 bytes available

Type 0F (STRING ): 24 bytes
Type 15 (FREEBLOCK ): 66821160 bytes
Type 17 (ASSEMBLY ): 34920 bytes
Type 1E (BINARY_BLOB_HEAD ): 249588 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
GC: performing heap compaction…
The debugging target runtime is loading the application assemblies and starting execution.
Ready.

IMMEDIATE WINDOW:
Using mainboard GHI Electronics FEZRaptor version 1.0
Program Started
Cable connected = True
activated = True
True
network down fired
0.0.0.0
DHCP=True, but no connectionL 0.0.0.0
0.0.0.0
DHCP=True, but no connectionL 0.0.0.0
0.0.0.0
DHCP=True, but no connectionL 0.0.0.0
(repeats endlessly)

@ Jeff:
Did the wireshark capture you requested tell you anything?
As a reminder:

  1. On some routers DHCP will always fail - you have the wireshark capture
  2. On networks where DHCP works, enabling static DNS will cause the IP address to reset to 0.0.0.0
  3. Network Down always fires, NEtwork UP never fires, in all instances I have seen.

I need to resolve these issues so I can make some progress.

Rocky

@ Jeff, or anyone @ GHI, or anyone…
Have not heard anything back from GHI.
In further testing I tried the C# example test code from
http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/Ethernet ENC28/TestApp/Program.cs
and get the same results.
I have retested the cable connection with my laptop and all seems well. The hardware works on another router as noted above (aside from other issues mentioned).
All my various internet appliances and computers work fine with DHCP except the ENC28/Raptor.
I do not know how to take advantage of the Wireshark data I provided.

Any suggestions on what to try next, or is it a waste of time?

Hello Rocky,

Sorry, we should have kept you updated on our work on this one. We have a version of the firmware we would like you to use/try. Can you send us your email address (click on my picture and “Send a Direct Message” to me)? We will email you the necessary files.

Hi Jeff, Dat:

The update you sent works quite well!
I no longer have a problem with DHCP (there is a few seconds delay before NetworkAddressChanged event fires, but it always does, after the IP address has been granted).

Also I have no problem setting a fixed DNS.

I verified this both in C# and VB.

The only remaining question is why the NetworkDown event fires after AssignNetworkingStackTo is executed, and also after the IsCableConnect has returned TRUE.

Please note that these events are listed as available events IN VB in the Program.vb module that is automatically generated in Gadgeteer. I do not see a reference to these in C#, so maybe the disconnect is here. I appended a screen capture so you can see these events.

Also, I have never seen the NetworkUp event fire.

On the other hand, the CableConnectivityChanged event can be manually added and it does work fine.

Thanks for the great progress!

Rocky

@ rockybooth -

Thanks for your confirmation, it sounds good now

we will check 2 minor thing as you said.