My Spider Gadgeteer is not stable

I’m using the latest sdk 4.2.10.1. Can you show your code?

@ Patrick -


    Private Sub SetupNet()

        AddHandler ethernet.Interface.CableConnectivityChanged, AddressOf _CableConnectivityChanged
        AddHandler ethernet.Interface.NetworkAddressChanged, AddressOf _NetworkAddressChanged

        ethernet.Interface.Open()

        If Not (ethernet.Interface.IsActivated) Then
            GHI.Premium.Net.NetworkInterfaceExtension.AssignNetworkingStackTo(ethernet.Interface)
        End If

        ethernet.Interface.NetworkInterface.EnableDhcp()

        ethernet.UseDHCP()

    End Sub

    Private Sub _CableConnectivityChanged(sender As Object, e As GHI.Premium.Net.EthernetBuiltIn.CableConnectivityEventArgs)
        If ethernet.Interface.IsCableConnected Then
            debugging.Print(DateTime.Now.ToString + ": cable connected")
            ethernet.UseDHCP()
        Else
            debug.Print(DateTime.Now.ToString + ": cable lost")
        End If
    End Sub

    Private Sub _NetworkAddressChanged(sender As Object, e As EventArgs)
        debug.Print(DateTime.Now.ToString + ": new IP --> " + ethernet.NetworkSettings.IPAddress.ToString)
        If ethernet.NetworkSettings.IPAddress = "0.0.0.0" Then
            'code when network down
        Else
            'code when network up and ip received
            NtpTimeRequest()

        End If
    End Sub

@ VB-Daniel -

Your code compared with mine is comparable. I’ve got some additional code to determine the use of dhcp or fixed ip. I’ll post it tomorrow.

@ Patrick - maybe the fixed ip is the problem, don’t see it again since the static code is deleted.