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

Netduino Plus 2 Problems


  • Please log in to reply
31 replies to this topic

#1 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 10 November 2012 - 05:05 AM

I received my Netduino Plus 2 from Amazon today. Glad to get one, but no joy in getting started. I started off with a webserver that was running just fine on the Netduino Plus. The steps I followed are:

Plug in, Select Device USB
==========================
NetduinoPlus2_Netduino
Pinging... TinyCLR

Target --> Device capabilities
==============================
HalSystemInfo.halVersion: 4.2.0.0
HalSystemInfo.halVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
HalSystemInfo.oemCode: 34
HalSystemInfo.modelCode: 177
HalSystemInfo.skuCode: 4102
HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000
HalSystemInfo.systemSerialNumber: 0000000000000000
ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.0.3
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
SoftwareVersion.BuildDate: Oct 28 2012
SoftwareVersion.CompilerVersion: 410894
FloatingPoint: True
SourceLevelDebugging: True
ThreadCreateEx: True
LCD.Width: 0
LCD.Height: 0
LCD.BitsPerPixel: 0
AppDomains: True
ExceptionFilters: True
IncrementalDeployment: True
SoftReboot: True
Profiling: False
ProfilingAllocations: False
ProfilingCalls: False
IsUnknown: False

Restart MFDeploy TinyBootLoader Mode
=====================================
No response from device <--- WHY

Start MFDeploy normally (Target --> Configuration --> Network)
==============================================================
MAC address discovered by MFDeploy.
set DNS addresses and enabled DHCP

Joined network, Ping OK
=======================

loaded a program that was running just fine on the Plus
=======================================================

Output from main below
---------------------
GC: 102300
IP Address 192.168.0.131
GatewayAddress 192.168.0.1
PhysicalAddress 00 04 A3 00 00 00 <---- WRONG MAC
dnsAddress 0 192.168.0.1
IsDhcpEnabled True

Clock set: True
Server used: utcnist2.colorado.edu
Time from NIST
56241 12-11-10 02:53:31 00 0 0 857.9 UTC(NIST) *

Current time set from DayTimeNIST: 11/09/2012 18:53:31
disposing Daytime Client
GC: 106620
GC: 107028
hello from timer:Duration 00:00:00.4360500
hello from timer:Duration 00:01:40.0009920
hello from timer:Duration 00:03:20.0003970

Press Button(generate interrupt, see program)
=============================================

No output <---- WHY NOT

Changed to static IP address, 192.168.0.52 (outside of router DHCP range, 100-150)
============================

No ping response from 192.168.0.52 <---
Cleared arp cache, waited awhile
No ping response <---
Deleted the DHCP entry from the router

* 192.168.0.131 00:04:A3:00:00:00 1 day 00:00:00

re-ran the program, output showed the same IP address, 192.168.0.131 with wrong MAC

192.168.0.131 shows up again in the router and arp cache with wrong MAC

So, it seems we have two problems, (1) the button mapping has changed and (2) MFDeploy can't update the network configuration properly.

Baxter


Sub Main()

	PrintNetwork()
        Try
            Using NIST_Time As DayTimeNIST = New DayTimeNIST("utcnist2.colorado.edu", -8)
                NIST_Time.UTC_offset = -8
                NIST_Time.GetTimeFromNIST()
                Debug.Print("Clock set: " & NIST_Time.successful)
                Debug.Print("Server used: " & NIST_Time.TimeServer)
                Debug.Print("Time from NIST  " & NIST_Time.networkDateTime)
                Debug.Print("Current time set from DayTimeNIST: " & DateTime.Now.ToString)
            End Using
        Catch
            Debug.Print("no IP Address")
            Microsoft.SPOT.Hardware.PowerState.RebootDevice(True)
        End Try

        Debug.Print("GC: " & Debug.GC(True).ToString)

        _onBoardLED = New OutputPort(Pins.ONBOARD_LED, False)
        _onBoardButton = New InterruptPort(Pins.ONBOARD_SW1, False,
                                           Port.ResistorMode.Disabled,
                                           Port.InterruptMode.InterruptEdgeBoth)

        AddHandler _onBoardButton.OnInterrupt, AddressOf onBoardButton_OnInterrupt

	'Start timer
        StartTime = DateTime.Now
        Dim timer As New Timer(New TimerCallback(AddressOf OnTimer), Nothing, 0, 100000) '100 sec

        'Start web server
        _webServer = New WebServer(WEB_ROOT, WebServer.HTTP_PORT)
        Thread.Sleep(Timeout.Infinite)

    End Sub

Public Sub PrintNetwork()
        Dim NetInfo As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()(0)
        Dim IPaddress As String = NetInfo.IPAddress
        Dim DnsAddresses() As String = NetInfo.DnsAddresses
        Dim GatewayAddress As String = NetInfo.GatewayAddress
        Dim PhysicalAddress As Byte() = NetInfo.PhysicalAddress
        Dim IsDhcpEnabled As Boolean = NetInfo.IsDhcpEnabled
        Debug.Print("IP Address " & IPaddress)
        Debug.Print("GatewayAddress " & GatewayAddress)
        Debug.Print("PhysicalAddress " & bytesToHexString(PhysicalAddress, True))
        For i As Integer = 0 To DnsAddresses.Length - 1
            Debug.Print("dnsAddress " & i.ToString & " " & DnsAddresses(i))
        Next
        Debug.Print("IsDhcpEnabled " & IsDhcpEnabled.ToString)
        Debug.Print("")
    End Sub

#Region "Events"

    Public Sub OnTimer(state As Object)
        Dim delta As System.TimeSpan = (DateTime.Now - StartTime)
        Debug.Print("hello from timer:Duration " & delta.ToString)
        DebugPrint.Print("Hello from debugS.print : ")
    End Sub

    Private Sub onBoardButton_OnInterrupt(data1 As UInt32, data2 As UInt32, time As DateTime)

        If (data2 = 0) Then
            _onBoardLED.Write(True)
            Thread.Sleep(250)
            _onBoardLED.Write(False)
            Thread.Sleep(250)
            _onBoardLED.Write(True)
            Thread.Sleep(250)
            _onBoardLED.Write(False)
        End If
        PrintNetwork()
        Debug.Print("freemem: " & Debug.GC(True))

    End Sub

#End Region

End Module


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 November 2012 - 05:13 AM

Hi baxter, A few quick things: The pushbutton on Netduino Go and Netduino Plus 2 works differently than the older boards. When you press and hold it during powerup, the board goes into reflashing mode instead of TinyBooter. We've hopefully eliminated the need for TinyBooter. And due to the new USB circuitry, you can safely access the network settings from TinyCLR mode. On the networking: if we can boil that down to a simple sample I'd be happy to clone your board and then see what's going on here. Finally, if you're redeploying a Netduino Plus 1 app to a Netduino Plus 2, be sure to remove the SecretLabs.NETMF.Hardware.NetduinoPlus.dll and replace it with SecretLabs.NETMF.Hardware.Netduino.dll. Otherwise you'll have the wrong mapping for your pins and could get unexpected results. Chris

#3 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 10 November 2012 - 08:56 AM

Hi Chris, Thanks for the fast reply. I did as you suggested and replaced SecretLabs.NETMF.Hardware.NetduinoPlus.dll with SecretLabs.NETMF.Hardware.Netduino.dll and there is no change; the led should blink twice and print network information. Instead, the blue led simply stays on for 2-3 sec. Another thing that just started happening is that if I pick the board up and touch the bottom where the headers are soldered it will start to reboot continuously. It starts ok and then prints this, --------------------OK START-----------------------(except for wrong IP and MAC address) GC: 102288 IP Address 192.168.0.131 GatewayAddress 192.168.0.1 PhysicalAddress 00 04 A3 00 00 00 dnsAddress 0 192.168.0.1 IsDhcpEnabled True Clock set: True Server used: utcnist2.colorado.edu Time from NIST 56241 12-11-10 08:12:10 00 0 0 280.0 UTC(NIST) * Current time set from DayTimeNIST: 11/10/2012 00:12:10 disposing Daytime Client GC: 106608 GC: 107016 hello from timer:Duration 00:00:00.4360770 -------------------OK DOWN TO HERE------------------------------- -------------------TOUCHED the bottom of the board--------------- print is executed at the top of main IP Address 192.168.0.131 GatewayAddress 192.168.0.1 PhysicalAddress 00 04 A3 00 00 00 <<<<<<<<<<<<<<REBOOT dnsAddress 0 192.168.0.1 IsDhcpEnabled True IP Address 192.168.0.131 GatewayAddress 192.168.0.1 PhysicalAddress 00 04 A3 00 00 00 <<<<<<<<<<<<<<REBOOT dnsAddress 0 192.168.0.1 IsDhcpEnabled True If I could get through these problems, this would be a super board. It is extremely fast. Baxter

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 November 2012 - 09:05 AM

Hi baxter, Okay, let's start with something simpler. There's a lot going on here, and I want to make sure we diagnose the issues for you and get you running 100%. ** Please disconnect any attached components from your Netduino Plus 2, to isolate any external influences ** First question... If you create a Netduino Plus 2 Application and create a "blinky" app, does that work? Second question... While running the "blinky" app, what happens if you touch the bottom of your board? I'm heading to bed shortly, but will be happy to continue guiding you through this when I wake :) Chris

#5 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 10 November 2012 - 08:38 PM

Hi Chris, thanks for devoting some time to this.

Ok, I tried the blink on-board led (program below) with both SecretLabs.NETMF.Hardware.NetduinoPlus and SecretLabs.NETMF.Hardware.Netduino and also with an added debug.print. the ethernet cable is unplugged and nothing is connected to the Plus 2 except the USB cable. The program compiles and runs with either reference and outputs the message as expected in both MFDeploy and VB , but no onboard led blinking. Touching the bottom of the board has no effect.

I am beginning to think this is a hardware problem. Networking would not configure properly and it won't blink the led, but everything would compile and run properly.

Baxter
Create TS.
Loading start at 806a238, end 8085f88
Assembly: mscorlib (4.2.0.0)
Assembly: Microsoft.SPOT.Native (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Net (4.2.0.0)
Assembly: System (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)
Assembly: Microsoft.SPOT.IO (4.2.0.0)
Assembly: System.IO (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)
Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0)
Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0)
Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0)
Assembly: Microsoft.SPOT.Time (4.2.0.0)
Loading Deployment Assemblies.
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.0.1)
Attaching deployed file.
Assembly: Microsoft.VisualBasic (1.0.0.0)
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware.NetduinoPlus (4.2.0.1)
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware (4.2.0.0)
Attaching deployed file.
Assembly: Original Blinky (1.0.0.0)
Resolving.
The debugging target runtime is loading the application assemblies and starting execution.
Ready.

Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
'Imports SecretLabs.NETMF.Hardware.NetduinoPlus
Imports SecretLabs.NETMF.Hardware.Netduino

Module Module1

    Sub Main()

        Dim ledBlink = New blink()
        Do
            Debug.Print("in main")
            ledBlink.blinkOnboard(250, 5)
            Thread.Sleep(2000)
        Loop

    End Sub

    Public Class blink
        Dim led As OutputPort
        Public Sub New()
            Me.led = New OutputPort(Pins.ONBOARD_LED, False)
        End Sub
        Public Sub blinkOnboard(period As Integer, nTimes As Integer)
            Debug.Print("in blinkOnBoard")
            For index = 1 To nTimes
                led.Write(True)
                Thread.Sleep(period)
                led.Write(False)
                Thread.Sleep(period)
            Next
        End Sub

    End Class

End Module



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 November 2012 - 09:50 PM

Hi Baxter,

From your output:
Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0)
Loading Deployment Assemblies.
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.0.1)
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware.NetduinoPlus (4.2.0.1)

It appears that you're deploying both SecretLabs.NETMF.Hardware.Netduino and SecretLabs.NETMF.Hardware.NetduinoPlus to the board. It also appears that the old version of each (4.2.0.1) is included in your project, rather than the new 4.2.1 release.

Could you please remove both SecretLabs.NETMF.Hardware.Netduino.dll and SecretLabs.NETMF.Hardware.NetduinoPlus.dll from your project references?

Then add in the SecretLabs.NETMF.Hardware.Netduino.dll in the ".NET" pane of "Add References..." Double-check that it's version 4.2.1.0. If it's a different version, it's possible that the Netduino SDK on your computer is an older version.

Chris

#7 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 02:40 AM

Chris, Removed both SecretLabs.NETMF.Hardware.Netduino.dll and SecretLabs.NETMF.Hardware.NetduinoPlus.dll and added SecretLabs.NETMF.Hardware.Netduino.dll. In the Project, it is reported as 4.2.0.1. In debug/deploy it is reported as follows: ----------------------------- Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0) <------ Reported 4.2.1.0 Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0) Assembly: Microsoft.SPOT.Time (4.2.0.0) Loading Deployment Assemblies. Attaching deployed file. Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.0.1) <------Reported 4.2.0.1 ----------------------------- In the directory, the date of SecretLabs.NETMF.Hardware.Netduino.dll is 8/13/2012. The files in the Netduino SDK directory with a date later 8/13/2012 all refer to Netduino GO and the ShieldBase with a date of 10/9/2012. I cannot find a Netduino SDK 4.2.1.0 On the forum. I found the Netduino Plus 2 Firmware v4.2.1 initial and flashed it. The net effect of all of this is STILL NO BLINK. Perhaps someone with a Netduino Plus 2 could run the Blinky program and see if the LED blinks. Baxter

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 November 2012 - 02:47 AM

added SecretLabs.NETMF.Hardware.Netduino.dll. In the Project, it is reported as 4.2.0.1. In debug/deploy it is reported as follows:

Okay, it looks like you have the old SDK installed on your PC.

The latest Netduino SDK (4.2.1.0) is on the Downloads page, under "Netduino Go and Netduino Plus 2":
Netduino 4.2.1.0 SDK: 32-bit sdk or 64-bit sdk

When you start Visual Studio, you should see a "Netduino Plus 2 Application" template.

I ran blinky here (and turned it into a pulsing blinky using PWM too) and it's working well. If updating the SDK doesn't work for you, I can send you a copy of the Blinky project and walk you through it.

We're thinking that we may update the NetduinoPlus.dll in the latest SDK, so that users upgrading Netduino Plus projects don't need to swap out the assembly. This is all great feedback, and should help make sure everyone has an awesome experience with their new gear.

Chris

#9 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 03:17 AM

Hi Chris, SUCCESS ... I downloaded the SDK 4.2.1.0, installed it, rebooted, loaded Blinky, went to Project Properties, deleted SecretLabs.NETMF.Hardware.Netduino.dll, then added it, ran Blinky and now Netduino Plus 2 Blinks. I haven't tried the first program that started all of this, but it will likely work also. Many thanks for your assistance. Baxter

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 November 2012 - 03:59 AM

SUCCESS ...

Let's try to get everything else working here. We're using the built-in NETMF networking drivers so they should be pretty stable (and they worked well in our in-house tests). But if there are bugs we'd like to know about them so we can fix them in the core.

Thanks for all the feedback, baxter. I'm glad your Netduino Plus 2 is now blinking happily :)

Chris

#11 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 05:03 AM

Hi Chris, I tried the first program of my post. The timer works, the button interrupt works and networking works, but MFDeploy will not update the network configuration (see screen shot). Netduino Plus 2 shows this configuration: IP Address 192.168.0.131 <--- wrong GatewayAddress 192.168.0.1 PhysicalAddress 00 04 A3 00 00 00 <---wrong dnsAddress 0 192.168.0.1 <---wrong IsDhcpEnabled True <---wrong I can ping 192.168.0.131 and it shows up in the arp cache. I seem to recall posts about this problem for the Plus, but I never encountered it before. If I stop the VB debugger, start and connect MFDeploy, the output continues OK. However, if I touch the solder pads on the bottom of the headers I get this output in MFDeploy and need to disconnect, MFDeploy connected to Netduino Plus 2 partial output =================================================== IP Address 192.168.0.131 GatewayAddress 192.168.0.1 PhysicalAddress 00 04 A3 00 00 00 dnsAddress 0 192.168.0.1 IsDhcpEnabled True <----- solder pads touched Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW Buffer OVFLW If I then press the button on the Plus 2, I get two blinks so the program is alive and well. Moreover, the buffer overflow never happens in the VB debugger. I can touch the solder pads, push the button and the LED blinks and I get output Therefore, it seems that there is some sort of bizarre malfunction between the Plus 2 and MFDeploy; because, (1) it will not update the network config. and (2) touching the pads should not have anything to do with MFDeploy. Otherwise, I am convinced that the Plus 2 is performing the same way as the Plus, but much faster. Baxter

Attached Files



#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 November 2012 - 05:43 AM

Hi baxter, That's great debugging information. First, on the network issue... Could you please erase your current app from the board (unless you don't mind sharing) and then create an image of your board? And then send it to me? I can load it up here and repro the issue. BTW, this is one of the _awesome_ things about the new ST chips: we can image boards and clone them here. And then debug via onboard JTAG. This will make fixing bugs much, much easier. To create an image of your board: 1. Open up the ST DFUSE application. 2. Press the pushbutton on your Netduino Plus 2 and then plug it into your PC via USB. 3. In the "upload action" frame (I know...seems like wrong terminology) click "Choose" to select a folder where you want to save the file...and then type its file name. 4. Finally, press "Upload" to save an image of your board to a file. Thanks Baxter! Chris P.S. We can address the buffer overflow issue next. I'm guessing that you're creating a circuit between two contact points on the bottom of the board. Not easy to do necessarily but possible. We can help diagnose that too.

#13 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 06:18 AM

I don't know whether I did this correctly. 1. MFDeploy --> Ping --> Erase --> Output: Pinging... TinyCLR No debugger! Create TS. Loading start at 806a238, end 8085f74 Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Net (4.2.0.0) Assembly: System (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.IO (4.2.0.0) Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0) Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0) Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0) Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0) Assembly: Microsoft.SPOT.Time (4.2.0.0) Loading Deployment Assemblies. Resolving. Ready. Cannot find any entrypoint! Done. Waiting for debug commands... 2. Image attached. (delete txt suffix due to:or You aren't permitted to upload this kind of file) If not correct, I will do it again. Baxter

Attached Files



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 November 2012 - 08:07 AM

Baxter, perfect...thank you. Would you mind sharing a few lines of code to reproduce the issue as well (i.e. your code which is printing out the invalid IP settings)? Chris

#15 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 06:49 PM

Stripping out the other code in main(). The program prints this:

GC: 102708
IP Address 192.168.0.131
GatewayAddress 192.168.0.1
PhysicalAddress 00 04 A3 00 00 00
dnsAddress 0 192.168.0.1
IsDhcpEnabled True
GC: 101940

Correct values
==============
192.168.0.52
255.255.255.0
192.168.0.1
5c-86-4a-00-50-0f
8.8.8.8
8.8.4.4
DHCP unchecked

Prior to running this code this morning, I updated the network configuration with MFDeploy which has the values of the screenshot of post #11. MFDeploy seems to retain these from instance to instance. The router DHCP range is 100-150.

Baxter

Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino
Imports System.Threading
Imports System.Net
Imports System.Text
Imports System.Net.Sockets
Imports Microsoft.SPOT.Net.NetworkInformation

Module MainProgram
        Try
            PrintNetwork()
        Catch ex As Exception
            Debug.Print(ex.Message)
        End Try
  End Sub
End Module

Public Sub PrintNetwork()
        Dim NetInfo As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()(0)
        Dim IPaddress As String = NetInfo.IPAddress
        Dim DnsAddresses() As String = NetInfo.DnsAddresses
        Dim GatewayAddress As String = NetInfo.GatewayAddress
        Dim PhysicalAddress As Byte() = NetInfo.PhysicalAddress
        Dim IsDhcpEnabled As Boolean = NetInfo.IsDhcpEnabled
        Debug.Print("IP Address " & IPaddress)
        Debug.Print("GatewayAddress " & GatewayAddress)
        Debug.Print("PhysicalAddress " & bytesToHexString(PhysicalAddress, True))
        For i As Integer = 0 To DnsAddresses.Length - 1
            Debug.Print("dnsAddress " & i.ToString & " " & DnsAddresses(i))
        Next
        Debug.Print("IsDhcpEnabled " & IsDhcpEnabled.ToString)
        Debug.Print("GC: " & Debug.GC(True).ToString)
        Debug.Print("")
    End Sub


#16 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 11 November 2012 - 06:59 PM

Oops, Forgot bytesToHexString,

Public Function bytesToHexString(ByVal arr() As Byte,
                          Optional ByVal addSpc As Boolean = False) As String
        'by definition the string will have pairs of digits for the byte value
        Dim sb As New System.Text.StringBuilder()
        Dim separator As String = String.Empty
        If (addSpc) Then separator = " "
        For i As Integer = 0 To arr.Length - 1
            sb.Append(arr(i).ToString("x2") & separator)
        Next i
        Return sb.ToString.TrimEnd
    End Function

Baxter

#17 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 November 2012 - 08:38 PM

Thanks, baxter. We will add this to our repro testing. We should have some good info on this within a few days--sometime this week. Chris

#18 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 12 November 2012 - 02:02 AM

Chris,

A brief update ... I added code to set the network,

Public Sub SetNetworkPlus2()
        Dim SetNet As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()(0)
        Dim MAC As Byte() = {&H5C, &H86, &H4A, &H0, &H50, &HF}
        SetNet.EnableStaticIP("192.168.0.52", "255.255.255.0", "192.168.0.1")
        SetNet.PhysicalAddress = MAC
End Sub
I ran the program. PrintNework showed the correct values and Network ping was ok. However, arp -a gave an incorrect MAC (as in the previous postings). I then went to MFDeploy and updated the network configuration to the values in SetNetworkPlus2(). I then re-ran the program and the correct MAC was established in the arp cache. I then removed the SetNetworkPlus2() from the program; then re-ran, repeated the ping and arp and everything was established correctly. It looks like this has solved all my problems and Netduino Plus 2 is online. Perhaps your debugging can answer the question of why MFDeploy didn't do it right in the first place.

I am looking forward to the super performance of the Plus 2 and wish to congratulate you on a stunning product. Many thanks for the help, Chris.

Baxter

#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 November 2012 - 02:03 AM

Oh, that is bizarre. I'm glad it's working now for you but at the same time...I'm really curious what was going on. I'm still going to see if we can repro it here. If we can't...if anyone else runs into this issue, please let us know. Enjoy your new hardware :) And thanks for giving it a test run so quickly! Chris

#20 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 12 November 2012 - 02:54 AM

Blah ... I powered down the Plus 2 and hooked it up to a wireless adapter and it went back to its old ways; no static IP address and the wrong MAC. Same thing hard wired on ethernet. The router has it in its list of DHCP Clients also. So setting the network programmaticaly is not permanent. It does indeed look like something is broken here. Baxter




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.