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.

Ellen

Member Since 14 Jun 2012
Offline Last Active Feb 02 2013 01:49 PM
-----

#38434 P1 & S0 Port monitoring with Netduino Plus

Posted by Ellen on 03 November 2012 - 04:06 PM

Hello to All, As a member of the Tweaker forum club (I do the coffee for my father and my friend who do.....nothing) i want to inform you that there is quality software available on Codeplex for monitoring PV power and home boards. It is all in Beta status but I think (as student VB) from a high quality. Here is the link: http://p1netduinoplus.codeplex.com/ Thank you and enjoy.


#33712 Netduino Plus Firmware v4.2.0

Posted by Ellen on 15 August 2012 - 07:59 PM

Chris, You did not tell that also Netduino SDK 4.2.0.1 and .NET Micro Framework SDK v4.2Q2 is needed Without windows can not recognize the Netduino. Ellen


#33577 N+ hangs sometimes when try to receive Time

Posted by Ellen on 14 August 2012 - 09:03 AM

Hello,

How can i resolve hanging my N+ when i want to sync my Netduino with a time server.

Function call:

Utility.SetLocalTime(NTPTime("time-a.nist.gov"))
"time-a.nist.gov" : ntp ok, time,daytime busy, not recommended

He will sometimes hang when receive :

s.Receive(ntpData)

I can choose out of many servers but that is for now not the point.
http://tf.nist.gov/tf-cgi/servers.cgi

How to resolve?
Thanks in advance, Ellen



        Private Shared Function NTPTime(ByVal TimeServer As [String]) As DateTime

            Dim ep As New IPEndPoint(Dns.GetHostEntry(TimeServer).AddressList(0), 123)
            Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
            Dim ntpData As Byte() = New Byte(47) {}
            Array.Clear(ntpData, 0, 48)

            ntpData(0) = &H1B
            s.SendTimeout = 5000

            s.SendTo(ntpData, ep)
            s.Receive(ntpData)     'with debugging, HERE he will stop.'

            Dim offsetTransmitTime As Byte = 40

            Dim intpart As Long = 0
            Dim fractpart As Long = 0

            For i As Integer = 0 To 3
                intpart = (intpart << 8) Or ntpData(offsetTransmitTime + i)
            Next

            For i As Integer = 4 To 7
                fractpart = (fractpart << 8) Or ntpData(offsetTransmitTime + i)
            Next

            Dim milliseconds As Long = CLng(intpart * 1000 + (fractpart * 1000) / &H100000000L)

            s.Close()

            Dim timeSpan__1 As TimeSpan = TimeSpan.FromTicks(CLng(milliseconds) * TimeSpan.TicksPerMillisecond)
            Dim dT As New DateTime(1900, 1, 1)
            dT += timeSpan__1

            'daylight saving'
            If dT.Month < 3 OrElse dT.Month > 10 Then
                Return dT.AddHours(1)
            End If
            If dT.Month > 3 AndAlso dT.Month < 10 Then
                Return dT.AddHours(2)
            End If
            If dT.Month = 3 Then
                '      in march'
                If (dT.Day - CInt(dT.DayOfWeek)) < 25 Then
                    Return dT.AddHours(1)
                End If
                If (CInt(dT.DayOfWeek) = 0) AndAlso (dT.Hour < 2) Then
                    Return dT.AddHours(1)
                End If
                Return dT.AddHours(2)
            End If
            '      in october'
            If (dT.Day - CInt(dT.DayOfWeek)) < 25 Then
                Return dT.AddHours(2)
            End If
            If (CInt(dT.DayOfWeek) = 0) AndAlso (dT.Hour < 2) Then
                Return dT.AddHours(2)
            End If

            Return dT.AddHours(1)
        End Function





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.